-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Patrick GOLDBRONN (CEA)
# Date : 28/06/2001
SUBDIRS = adm_local idl resources src doc bin
-DISTCLEANFILES = a.out aclocal.m4 configure
+DISTCLEANFILES = a.out aclocal.m4 configure local-install.sh hack_libtool adm_local/unix/config_files/config.guess adm_local/unix/config_files/config.sub adm_local/unix/config_files/depcomp adm_local/unix/config_files/install-sh adm_local/unix/config_files/libtool.m4 adm_local/unix/config_files/ltmain.sh adm_local/unix/config_files/ltoptions.m4 adm_local/unix/config_files/ltsugar.m4 adm_local/unix/config_files/ltversion.m4 adm_local/unix/config_files/lt~obsolete.m4 adm_local/unix/config_files/missing adm_local/unix/config_files/py-compile
salomeinclude_DATA = VISU_version.h
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_version.h
// Author : Vadim SANDLER
// Module : SALOME
#define VISU_VERSION_STR "@VERSION@"
#define VISU_VERSION @XVERSION@
+#define VISU_DEVELOPMENT @VERSION_DEV@
#endif // __VISU_VERSION_H__
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-SUBDIRS = unix
\ No newline at end of file
+SUBDIRS = unix cmake_files
--- /dev/null
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(VISU_CXXFLAGS -I${VISU_ROOT_DIR}/include/salome)
+SET(VISU_LDFLAGS -L${VISU_ROOT_DIR}/lib/salome)
+
+FIND_LIBRARY(SalomeIDLVISU SalomeIDLVISU ${VISU_ROOT_DIR}/lib/salome)
--- /dev/null
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+dist_admlocal_cmake_DATA = \
+FindVISU.cmake
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
SUBDIRS = config_files
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
dist_admlocalm4_DATA = \
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
###########################################################
# File : check_Visu.m4
# Author : Vadim SANDLER (OCN)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+# ============================================================
+# The following is to avoid PACKAGE_... env variable
+# redefinition compilation warnings
+# ============================================================
#
+AM_CXXFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h
+AM_CPPFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h
+
# ============================================================
# This file defines the common definitions used in several
# Makefile. This file must be included, if needed, by the file
admlocalunixdir = $(admlocaldir)/unix
admlocalm4dir = $(admlocaldir)/unix/config_files
+# Directory for install cmake files
+admlocal_cmakedir = $(admlocaldir)/cmake_files
+
# Shared modules installation directory
sharedpkgpythondir = $(salomepythondir)/shared_modules
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
# non-distributed files
-THIS IS SALOME - VISU VERSION: @VERSION@
+[SALOME VISU] : @VERSION@
+[DEVELOPMENT] : @VERSION_DEV@
+[DESCRIPTION] : SALOME Post-Processing module
--- /dev/null
+#!/bin/sh
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+CURRENT_DIR=`pwd`
+CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
+cd ${CONF_DIR}
+python $KERNEL_ROOT_DIR/salome_adm/cmake_files/am2cmake.py --visu
+status=$?
+cd ${CURRENT_DIR}
+exit $status
--- /dev/null
+@REM Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+@REM
+@REM This library is free software; you can redistribute it and/or
+@REM modify it under the terms of the GNU Lesser General Public
+@REM License as published by the Free Software Foundation; either
+@REM version 2.1 of the License.
+@REM
+@REM This library is distributed in the hope that it will be useful,
+@REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+@REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+@REM Lesser General Public License for more details.
+@REM
+@REM You should have received a copy of the GNU Lesser General Public
+@REM License along with this library; if not, write to the Free Software
+@REM Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+@REM
+@REM See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+@REM
+
+%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\am2cmake.py --visu\r
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Tool for updating list of .in file for the SALOME project
# and regenerating configure script
# Author : Marc Tajchman - CEA
cd ${CONF_DIR}
ABS_CONF_DIR=`pwd`
-mkdir -p salome_adm/unix/config_files
-#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files
-#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix
-
-# remove KERNEL deprecated configure files
-#for deprecated in ac_cc_warnings.m4 ac_cxx_partial_specialization.m4 \
-# check_mico.m4 config.guess ltmain.sh ac_cxx_bool.m4 ltconfig \
-# ac_cxx_typename.m4 check_pthreads.m4 config.sub libtool.m4 ac_cxx_mutable.m4
-#do
-# rm salome_adm/unix/config_files/${deprecated}
-#done
-
-cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix
-
# ____________________________________________________________________
# aclocal creates the aclocal.m4 file from the standard macro and the
-# custom macro embedded in the directory salome_adm/unix/config_files
-# and KERNEL config_files directory.
+# custom macro embedded in the directory adm_local/unix/config_files
+# KERNEL salome_adm/unix/config_files, GUI and MED adm_local/unix/config_files
+# directories.
# output:
# aclocal.m4
# autom4te.cache (directory)
-echo "====================================================== aclocal"
+echo "======================================================= aclocal"
aclocal -I adm_local/unix/config_files \
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
# version. The files are created in the directory specified with the
# AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
# output:
-# salome_adm/unix/config_files/config.guess
-# salome_adm/unix/config_files/config.sub
-# salome_adm/unix/config_files/ltmain.sh
-#echo "====================================================== libtoolize"
+# adm_local/unix/config_files/config.guess
+# adm_local/unix/config_files/config.sub
+# adm_local/unix/config_files/ltmain.sh
+echo "==================================================== libtoolize"
libtoolize --force --copy --automake || exit 1
-# ____________________________________________________________________
-# make link to KERNEL configuration files to
-#ln -sf ${KERNEL_ROOT_DIR}/salome_adm .
-
# ____________________________________________________________________
# autoconf creates the configure script from the file configure.ac (or
# configure.in if configure.ac doesn't exist)
# AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also
# creates the Makefile.in files from the Makefile.am files.
# output:
-# salome_adm/unix/config_files/compile
-# salome_adm/unix/config_files/depcomp
-# salome_adm/unix/config_files/install-sh
-# salome_adm/unix/config_files/missing
-# salome_adm/unix/config_files/py-compile
+# adm_local/unix/config_files/compile
+# adm_local/unix/config_files/depcomp
+# adm_local/unix/config_files/install-sh
+# adm_local/unix/config_files/missing
+# adm_local/unix/config_files/py-compile
# Makefile.in (from Makefile.am)
echo "====================================================== automake"
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
rm -rf autom4te.cache aclocal.m4 configure make_config
find . -name "*~" -print -exec rm {} \;
find . -name "*.pyc" -print -exec rm {} \;
#exit
# ==================== ON SORT AVANT
-find bin -name Makefile.in | xargs rm -f
-find doc -name Makefile.in | xargs rm -f
-find idl -name Makefile.in | xargs rm -f
-find resources -name Makefile.in | xargs rm -f
-find salome_adm -name Makefile.in | xargs rm -f
-find src -name Makefile.in | xargs rm -f
-rm -f Makefile.in
+find . -name Makefile.in | xargs rm -f
+( cd adm_local/unix/config_files && rm -f config.* depcomp install-sh ltmain.sh missing py-compile )
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Author : Marc Tajchman (CEA)
# Date : 28/06/2001
# Modified by : Patrick GOLDBRONN (CEA)
# Modified by : Marc Tajchman (CEA)
# Modified by : Mikhail Ponikarov (OCN)
#
-AC_INIT([Salome2 Project VISU module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeVISU])
-AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
+AC_INIT([Salome2 Project VISU module], [6.5.0], [webmaster.salome@opencascade.com], [SalomeVISU])
+AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([-Wno-portability])
XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
AC_SUBST(XVERSION)
+VERSION_DEV=1
+AC_SUBST(VERSION_DEV)
# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
MODULE_NAME=visu
AC_PROG_MAKE_SET
AC_PROG_INSTALL
+AC_LOCAL_INSTALL
dnl
dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
dnl full-path to the binary instead.
case "$INSTALL" in
*install-sh*)
- INSTALL='\${KERNEL_ROOT_DIR}'/salome_adm/unix/config_files/install-sh
+ INSTALL='\${KERNEL_ROOT_DIR}'/adm_local/unix/config_files/install-sh
;;
esac
dnl ---------------------------------------------
dnl
-CHECK_MPICH
+dnl CHECK_MPICH
+
+echo
+echo ---------------------------------------------
+echo testing MPI
+echo ---------------------------------------------
+echo
+
+CHECK_MPI
echo
echo ---------------------------------------------
chmod +x ./bin/*; \
])
+AC_HACK_LIBTOOL
+AC_CONFIG_COMMANDS([hack_libtool],[
+sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
+ $(pwd)/hack_libtool \1 \"\$[@]\" \n\
+}\n\
+CC=\"hack_libtool\"%g" libtool
+sed -i "s%\(\s*\)for searchdir in \$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path; do%\1searchdirs=\"\$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path\"\n\1for searchdir in \$searchdirs; do%g" libtool
+sed -i "s%\(\s*\)searchdirs=\"\$newlib_search_path \$lib_search_path \(.*\)\"%\1searchdirs=\"\$newlib_search_path \$lib_search_path\"\n\1sss_beg=\"\"\n\1sss_end=\"\2\"%g" libtool
+sed -i "s%\(\s*\)\(for searchdir in \$searchdirs; do\)%\1for sss in \$searchdirs; do\n\1 if ! test -d \$sss; then continue; fi\n\1 ssss=\$(cd \$sss; pwd)\n\1 if test \"\$ssss\" != \"\" \&\& test -d \$ssss; then\n\1 case \$ssss in\n\1 /usr/lib | /usr/lib64 ) ;;\n\1 * ) sss_beg=\"\$sss_beg \$ssss\" ;;\n\1 esac\n\1 fi\n\1done\n\1searchdirs=\"\$sss_beg \$sss_end\"\n\1\2%g" libtool
+],[])
+
# This list is initiated using autoscan and must be updated manually
# when adding a new file <filename>.in to manage. When you execute
# autoscan, the Makefile list is generated in the output file configure.scan.
# This could be helpfull to update de configuration.
AC_OUTPUT([ \
- ./salome_adm/unix/SALOMEconfig.h \
Makefile \
- ./VISU_version.h \
- ./adm_local/Makefile \
- ./adm_local/unix/Makefile \
- ./adm_local/unix/config_files/Makefile \
- ./bin/Makefile \
- ./bin/VERSION \
- ./doc/Makefile \
- ./doc/salome/Makefile \
- ./doc/salome/gui/Makefile \
- ./doc/salome/gui/VISU/Makefile \
- ./doc/salome/gui/VISU/doxyfile \
- ./doc/salome/gui/VISU/doxyfile_idl \
- ./doc/salome/tui/Makefile \
- ./doc/salome/tui/doxyfile \
- ./idl/Makefile \
- ./resources/VISUCatalog.xml \
- ./resources/Makefile \
- ./src/Makefile \
- ./src/CONVERTOR/Makefile \
- ./src/PIPELINE/Makefile \
- ./src/OBJECT/Makefile \
- ./src/VVTK/Makefile \
- ./src/GUITOOLS/Makefile \
- ./src/VISU_I/Makefile \
- ./src/VISUGUI/Makefile \
- ./src/VISU_SWIG/Makefile \
- ./src/ENGINE/Makefile
+ VISU_version.h \
+ adm_local/Makefile \
+ adm_local/cmake_files/Makefile \
+ adm_local/unix/Makefile \
+ adm_local/unix/config_files/Makefile \
+ bin/Makefile \
+ bin/VERSION \
+ doc/Makefile \
+ doc/salome/Makefile \
+ doc/salome/gui/Makefile \
+ doc/salome/gui/VISU/Makefile \
+ doc/salome/gui/VISU/doxyfile \
+ doc/salome/gui/VISU/doxyfile_idl \
+ doc/salome/gui/VISU/static/header.html \
+ doc/salome/gui/VISU/static/header_py.html \
+ doc/salome/tui/Makefile \
+ doc/salome/tui/doxyfile \
+ doc/salome/tui/static/header.html \
+ idl/Makefile \
+ resources/VISUCatalog.xml \
+ resources/SalomeApp.xml \
+ resources/Makefile \
+ src/Makefile \
+ src/CONVERTOR/Makefile \
+ src/PIPELINE/Makefile \
+ src/OBJECT/Makefile \
+ src/VISU_I/Makefile \
+ src/VISUGUI/Makefile \
+ src/VISU_SWIG/Makefile \
+ src/ENGINE/Makefile
])
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
SUBDIRS = salome
usr_docs:
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# $Header$
#
SUBDIRS = tui gui
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Vasily Rusyaev (Open Cascade NN)
# Module : doc
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Vasily Rusyaev (Open Cascade NN)
# Module : doc
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-EXTRA_DIST += images input static
+EXTRA_DIST += images input static/footer.html static/doxygen.css
+
+guidocdir = $(docdir)/gui/VISU
+guidoc_DATA = images/head.png
usr_docs: doxyfile_idl doxyfile
@echo "===========================================" ; \
docs: usr_docs
clean-local:
- @for filen in `find . -maxdepth 1` ; do \
+ @for filen in `find . -maxdepth 1` ; do \
case $${filen} in \
- ./Makefile | ./doxyfile | ./doxyfile_idl ) ;; \
- . | .. ) ;; \
+ ./Makefile* | ./doxyfile* | ./images | ./input | ./static ) ;; \
+ . | .. | ./CVS ) ;; \
*) echo "Removing $${filen}" ; rm -rf $${filen} ;; \
esac ; \
done ;
install-data-local: usr_docs
- $(INSTALL) -d $(DESTDIR)$(docdir)/gui/VISU
- @for filen in `find . -maxdepth 1` ; do \
+ @if [ -e index.html ]; then \
+ $(INSTALL) -d $(DESTDIR)$(docdir)/gui/VISU; \
+ for filen in `find . -maxdepth 1` ; do \
case $${filen} in \
- ./Makefile | ./doxyfile | ./doxyfile_idl ) ;; \
- ./doxyfile.bak | ./doxyfile_idl.bak ) ;; \
- . | .. ) ;; \
+ ./Makefile* | ./doxyfile* ) ;; \
+ . | .. | ./static ) ;; \
*) echo "Installing $${filen}" ; cp -rp $${filen} $(DESTDIR)$(docdir)/gui/VISU ;; \
esac ; \
- done ;
+ done ; \
+ cp -rp $(srcdir)/images/head.png $(DESTDIR)$(docdir)/gui/VISU/visugen_doc ; \
+ fi
uninstall-local:
rm -rf $(DESTDIR)$(docdir)/gui/VISU
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "Post-Pro Module Reference Manual v.@VERSION@"
+PROJECT_NAME = "SALOME Post-Pro User's Guide"
OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = .
-HTML_HEADER = @srcdir@/static/header.html
+HTML_HEADER = @builddir@/static/header.html
HTML_FOOTER = @srcdir@/static/footer.html
-#HTML_STYLESHEET = @srcdir@/static/doxygen.css
+HTML_STYLESHEET = @srcdir@/static/doxygen.css
TOC_EXPAND = YES
DISABLE_INDEX = NO
GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 300
+#---------------------------------------------------------------------------
+#SORT related options
+#---------------------------------------------------------------------------
+SORT_GROUP_NAMES = NO
+
#---------------------------------------------------------------------------
#LaTeX related option
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
#External reference options
#---------------------------------------------------------------------------
-TAGFILES = visugen_doc.tag=visugen_doc
+TAGFILES = visugen_doc.tag=../VISU/visugen_doc #rnv: 07.04.2011 Workaround for the doxygen 1.7.3:
+ #because it wrongly defines location of the html files for search.
+SEARCHENGINE = YES
\ No newline at end of file
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "Post-Pro Module Reference Manual v.@VERSION@"
+PROJECT_NAME = "SALOME Post-Pro User's Guide"
OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = visugen_doc
-HTML_HEADER = @srcdir@/static/header.html
+HTML_HEADER = @builddir@/static/header_py.html
HTML_FOOTER = @srcdir@/static/footer.html
-#HTML_STYLESHEET = @srcdir@/static/doxygen.css
+HTML_STYLESHEET = @srcdir@/static/doxygen.css
TOC_EXPAND = YES
DISABLE_INDEX = YES
GENERATE_TREEVIEW = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = jpg
+DOT_FONTNAME = Arial
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
#External reference options
#---------------------------------------------------------------------------
GENERATE_TAGFILE = visugen_doc.tag
+SEARCHENGINE = YES
<li><b> Object Browser</b> - hides and displays the Object browser
used for management of objects created or imported into Salome application</li>
<li><b> Python Console</b> - hides and displays the Python console,
-which is a window for Pytho0n interpreter.</li>
+which is a window for Python interpreter.</li>
<li> \subpage slider_page - used for animation of presentations created on
all timestamps of a field.</li>
<li> \subpage sweeping_page "Sweep" - used for pseudo-animation of presentations created on
<ul>
<li> \subpage animating_page - another way of animation of
presentations on fields. </li>
+<li> \subpage evolution_page - tracing of temporal evolution of a
+variable at a given point.</li>
+<li> \subpage point_marker_page - allows to change the representation
+of points, using standard or custom markers.</li>
<li> \subpage translate_presentation_page - displacement of
presentations in the viewer.</li>
<li> \subpage recording_page - allows to dump user actions in an AVI
</ul>
-
*/
\image html introduction.png "Example of a 3D presentation"
-\b Post Pro module provides several types of 3D presentations,
+\b Post-Pro module provides several types of 3D presentations,
visualizing the structure of MED objects. All
presentations can be seen only in Salome VTK Viewer (ALT+K).
\n All presentation types could be divided in two main groups:
</ul>
Created presentations can be edited, animaded, recorded and viewed in
-different modes. The whole range of such operations is described in \subpage 3d_management_page "Managment of presentations" section.
+different modes. The whole range of such operations is described in \ref a3d_management_page "Managing 3D Presentations" section.
-*/
\ No newline at end of file
+*/
your animation with proportional periods of time between every frame
(not depending on the time stamps).
<br><br>
+<b>Time stamp frequency</b> spin box: this option is available if
+<b>Save animation to AVI file</b> mode is turned on. It provides a
+possibility to capture only timestamps with indices divisible by the
+specified frequency, which allows to generate less voluminous films.
+<br><br>
<b>Clean memory at each frame</b> - this option allows to optimize the
performance of the operation.
<b>Publish to Study</b> - saves your animation in the study and
presents it in the Object Browser.
+<br><b>See Also</b> a sample script of using
+\ref tui_animation_page "Animation" via TUI.
+
*/
<ul>
<li>\b H (horisontal) - the values of this column will correspond to
X-coordinates of the curve.</li>
-<li>\b V (vertical) - the values of this column will correspond to
-Y-coordinates of the curve.</li>
+<li>\b V (vertical left) - the values of this column will correspond to
+Y-coordinates of the curve to be attached to the left vertical axis of
+the Plot2d viewer.</li>
+<li>\b V2 (vertical right) - the values of this column will correspond to
+Y-coordinates of the curve to be attached to the right vertical axis of
+the Plot2d viewer.</li>
+\note If there are several curves attached both to the left and the right
+vertical axes, they will be indicated by the following icons in the
+legend:
+\image html axis_bottom_left.png
+<br>
+\image html axis_bottom_right.png
</ul>
The column \b Assigned allows to represent the values assigned to the
-points of the curve (possible for V-rows only). Any row, even
+points of the curve (possible for V- and V2-rows only). Any row, even
coinciding with the current or empty (no values assigned), can be
represented. All values are indicated with tool tips over the
corresponding curve points in the Plot2d viewer.
</li>
</ol>
-
-
+<br><b>See Also</b> a sample TUI Script of
+\ref tui_table_curves_page "Curves creation and displaying".
*/
</li>
</ol>
+<b>See Also</b> a sample script of
+\ref tui_table_curves_page "Curves creation and displaying" via TUI.
+
+
*/
<b>Tip:</b> From <b>Cut Lines</b> presentation you can create a
<b>data table</b>. This table will consist of the field scalar values
located on each cut line of the constructed presentation (see also:
-\ref creating_tables_from_cut_lines_page "Creating tables from Cut
-Lines presentations"). After that your data table can be used for
+\ref creating_tables_from_cut_lines "Creating tables from CutLines presentations").
+After that your data table can be used for
construction of a 2d plot of curves based on the scalar values from
the table (see also: \ref creating_curves_page "Creating curves" and
\ref creating_plot2d_page "Creating Plot 2D presentation").
-*/
\ No newline at end of file
+<br><b>See Also</b> a sample TUI Script of
+\ref tui_cut_lines_page "Cut Lines" presentation operation.
+
+*/
OK. Your presentation with scalar bar will be immediately displayed in
the viewer.
+<br><b>See Also</b> a sample TUI Script of
+\ref tui_cut_planes_page "Cut Planes" presentation creation.
+
*/
--- /dev/null
+/*!
+
+\page cut_segment_page Cut Segment presentation
+\image html cutsegmentprsnt.png "Example of Cut Segment presentation"
+
+\n <b>Cut Segment</b> is a simplified variant of
+\ref cut_lines_page "Cut Lines" presentation, displaying a single line
+instead of a set of lines. The axis of this line is
+defined by two points in a 3D space.
+
+<em>To create a Cut Segment presentation:</em>
+\par
+– Right-click on one of the time stamps of the field in the
+Object browser and from the pop-up menu choose <b>Cut Segment</b>, or
+\n – Click on one of the time stamps of the field in the Object
+browser and select from the main menu <b>Visualization > Cut
+Segment</b>, or click <em>"Cut Segment"</em> icon in the <b>Visualization
+Toolbar</b>.
+
+\image html cutsegmenticon.jpg
+<center><em>"Cut Segment" icon</em></center>
+
+\image html cutsegment.png
+
+\par
+<b>Cut Segment:</b> this tab of the dialog box contains the
+parameters of the cut segment.
+<ul>
+<li><b>Point 1</b> and <b>Point 2</b> spin boxes allow to set the coordinates
+of two points, defining an axis of the segment.</li>
+<li><b>Show preview</b> check box allows to edit the parameters of the
+presentation and simultaneously observe the preview of this
+presentation in the viewer.</li>
+<li><b>Invert curve</b> check box allows to invert the resulting
+curve.</li>
+<li><b>Use absolute length</b> check box allows to see the real length
+of the line, instead of [0,1] interval.</li>
+<li><b>Generate Data Table:</b> If this check box is marked, Post-Pro
+will automatically generate a data table on the basis of your Cut
+Segment presentation. This table will be created in the structure of the
+study.</li>
+<li><b>Generate Curve:</b> If this check box is marked, Post Pro
+will automatically generate curve line on the basis of values taken
+from the generated data table. This curve will be created in the
+structure of the study and can be visualized in a XY plot.</li>
+</ul>
+See more about table presentations and curve lines
+\ref table_presentations_page "here".
+
+\par
+<b>Scalar Bar</b> tab allows to define the parameters of the scalar bar
+displayed with this presentation (\ref scalar_map_page "see also").
+
+After you have finished with setting these parameters, click \b
+OK. Your presentation with scalar bar will be immediately displayed in
+the viewer:
+
+<b>Tip:</b> From <b>Cut Segment</b> presentation you can create a
+<b>data table</b>. This table will consist of the field scalar values
+located on the cut line of the constructed presentation. After that
+your data table can be used for construction of a 2d plot
+based on the scalar values from the table (see also:
+\ref creating_curves_page "Creating curves" and
+\ref creating_plot2d_page "Creating Plot 2D presentation").
+
+<br><b>See Also</b> a sample TUI Script of
+\ref tui_cut_segment_page "Cut Segment" presentation creation.
+
+*/
presentation with scalar bar will be immediately displayed in the
viewer.
-*/
\ No newline at end of file
+<br><b>See Also</b> a sample TUI Script of
+\ref tui_def_shape_page "Deformed Shape" presentation creation.
+
+*/
--- /dev/null
+/*!
+
+\page evolution_page Evolution on Point
+
+<b>Evolution</b> on Point operation allows tracing the temporal evolution of a variable at a given point.
+It can be activated via the context menu on a field:
+
+\image html evolution_context_menu.png
+
+The availability of this operation in the context menu depends on the following conditions:
+
+<ul>
+<li>The selected field should be defined on the Node entity.</li>
+<li>The selected field should have multiple time stamps.</li>
+</ul>
+
+The following dialog will be displayed (if the VTK view is active, the preview actor is also displayed):
+
+\image html evolution_dialog.png
+
+<ul>
+<li><b>Field</b> - the name of the field given for information, it cannot be changed in the dialog.</li>
+<li><b>Point</b> - the point ID. It can be input manually or by
+selection of the point in the viewer (note that the point selection
+mode is turned on automatically by the <b>Evolution on Point</b> dialog).</li>
+<li><b>Component</b> - the name of the component (scalar mode). This control is
+enabled if there are multiple components in the field data.</li>
+</ul>
+
+Clicking <b>OK</b> button leads to the creation of Plot2d a view
+with an Evolution graph:
+
+\image html evolution_result.png
+
+The X axis of the graph corresponds to the values of the time stamps,
+the Y axis - to the value of the selected field component at the specified point.
+
+\note Evolution is automatically published to the study after clicking <b>OK</b>
+button. It can be restored by selecting the <b>Show</b> action in the context
+menu on the published object:
+
+\image html evolution_restore.png
+
+<b>See Also</b> a sample script of using
+\ref tui_evolution_page "Evolution on Point" operation via TUI.
+
+*/
<li>\subpage scalar_map_page</li>
<li>\subpage iso_surfaces_page</li>
<li>\subpage cut_lines_page</li>
+ <li>\subpage cut_segment_page</li>
<li>\subpage cut_planes_page</li>
<li>\subpage deformed_shape_page</li>
<li>\subpage vectors_page</li>
To exit the dialog and apply choices press \b OK button, or press \b
CANCEL button to quit.
+<br><b>See Also</b> a sample TUI Script of
+\ref tui_gauss_points_page "Gauss Points presentations" creation.
-
-*/
\ No newline at end of file
+*/
<li>From the following standard dialog box:
-\image html importtablefromfile.png
+\image html importtables.png
+
+choose the necessary *.txt, *.tab or *.csv file containing tables and
+click \b Open button.
+
+If the checkbox "Use first string as title" is on, the
+information from the first string of the file is used as titles of
+table columns.
-choose the necessary *.xls, *.txt or *.tab file containing tables and
-click \b Open button.
</li>
<li>In the Object Browser \b Post-Pro will create a new folder having
the name of the imported file. All tables from this file will be
-located in this folder. One *.xls file can contain several
+located in this folder. One input file can contain several
tables.</li>
</ul>
contain your exported table, and click \b OK button. Your table will
be exported.
-\image html exporttable.png
+You can export table to *.txt or *.tab file
+
+\image html exporttables1.png
+
+Or you can export table to *.csv file
+
+\image html exporttables2.png
</li>
</ul>
-*/
\ No newline at end of file
+<b>See Also</b> a sample script of
+\ref tui_table_import_page "Import/Export" of tables via TUI.
+
+*/
\page importing_med_objects_page Import/Export MED objects
-\n There exist two sources of \ref structure_of_med_objects_page "MED objects": MED and other Salome
-components publishing them and MED files.
+There are two sources of \ref med_object_page "MED objects":
+- MED and other SALOME components publishing them MED objects
+- MED files
<em>To load MED objects from other components:</em>
\par
To complete file export click <b>Save</b>.
-*/
\ No newline at end of file
+<br><b>See Also</b> a sample script of
+\ref tui_import_export_page "Import/Export" of MED objects via TUI.
+
+*/
\subpage table_presentations_page "Data Table Objects",
two-dimensional data arrays, as input type for visualization.
-\n The Python interface of \b Post-Pro module is described in \subpage idl_interface_page "Access to Post-Pro module functionality" page.
+Post-Pro module preferences are described in the \subpage postpro_preferences_page section of SALOME Post-Pro Help.
+
+\n The Python interface of \b Post-Pro module is described in \subpage
+idl_interface_page "Access to Post-Pro module functionality" page.
+\n Sample Python scripts can be found in \subpage python_examples_page chapter.
*/
<li><b>Iso Surface</b> tab allows to set additional parameters of the
<b>Iso Surfaces</b> presentation:</li>
<ul>
-<li><b>Number of surfaces</b>, which will be generated in the framework of this presentation.</li>
<li><b>Minimum / Maximum value</b> fields allow to enter the range of
scalar or vector values applied to the cells, on the basis of which
-this presentation will be created.</li>
+this presentation will be created (note that these fields are editable
+only if <b>Use custom range</b> button is checked, otherwise range of
+the scalar bar values is used).</li>
<li><b>Update scalar bar range with these values</b> button allows you
to update the range of the values, displayed with by the scalar bar,
with the previously defined range of values.</li>
+<li><b>Number of surfaces</b>, which will be generated in the framework of this presentation.</li>
</ul>
<li><b>Scalar Bar</b> tab allows to define the parameters of the
scalar bar displayed with this presentation (\ref scalar_map_page "see also").</li>
presentation with scalar bar will be immediately displayed in the
viewer.
-*/
\ No newline at end of file
+<br><b>See Also</b> a sample TUI Script of
+\ref tui_iso_surf_page "Iso Surfaces presentation" creation.
+
+*/
\b MED \b Object is a specific twofold data structure
with consists of \b Mesh \b Data and \b Physical \b Data.
-\b Mesh \b Data includes geometrical information: list of nodes, edges, faces and cells
+- \b Mesh \b Data includes geometrical information: list of nodes, edges, faces and cells
of the mesh, and information on the interpolation in accordance with resulting
-elements, i.e. the mesh should be compatible with the chosen interpolation;</em></li>
-\b Physical \b Data contains initial and boundary conditions: scalar
+elements, i.e. the mesh should be compatible with the chosen interpolation.
+- \b Physical \b Data contains initial and boundary conditions: scalar
or vector values applied to the mesh cells.
-\n It is not possible to create and edit \b MED \b Objects in the \b
+It is not possible to create and edit \b MED \b Objects in the \b
Post-Pro module. You can only \subpage importing_med_objects_page
"import a MED object" from Salome MED module or from a MED file.
-\n \b MED Objects can be visualized and explored with various types of
+\b MED Objects can be visualized and explored with various types of
\subpage a3d_presentations_page "3D presentations".
-\n \b Post-Pro visualization engine bases on VTK and OpenGL
+\b Post-Pro visualization engine bases on VTK and OpenGL
technologies, which provide useful tools for
\subpage a3d_management_page "Management of presentations".
<h2>Families</h2>
A \b Family is a user-defined submesh composed of cells of a
-definite type - Nodes, Edges, Faces or Cells</em>. The
+definite type - Nodes, Edges, Faces or Cells. The
presentation created on the basis of a particular \b family will be
composed of geometrical elements, corresponding to the type of cells
of this \b family.
After you have finished with setting these parameters, click \b
OK. Your presentation will be immediately displayed in the viewer.
-*/
\ No newline at end of file
+<br><b>See Also</b> a sample TUI Script of
+\ref tui_plot_3d_page "Plot 3D presentation" creation.
+
+*/
--- /dev/null
+/*!
+
+\page point_marker_page Point Marker
+
+\n You can change the representation of points in
+the 3D viewer either by selecting one of the predefined
+shapes or by loading a custom texture from an external file.
+
+- Standard point markers
+
+The Post-Pro module provides a set of predefined point marker shapes
+which can be used to display points in the 3D viewer.
+Each standard point marker has two attributes: type (defines shape
+form) and scale factor (defines shape size).
+
+\image html point_marker_dlg1.png
+
+<br>
+
+\image html std_point_marker.png "Presentation with standard point markers"
+
+<br>
+
+There is also an additional type of point marker - Point Sprite marker,
+which allows to display points as OpenGL point sprites with predefined
+shape and alpha mask. This marker is added to the end of the list of
+standard markers.
+
+\note The Point Sprite marker is insensitive to scale factor parameter,
+but it is possible to change its magnification by pressing "m" and "M"
+(Shift + "m") buttons in the view, just like for Gauss Points presentation.
+
+\image html point_marker_dlg3.png
+
+<br>
+
+\image html point_sprite_marker.png "Presentation with Point Sprite marker"
+
+- Custom point markers
+
+It is also possible to load a point marker shape from an external file.
+This file should provide a description of the point texture as a set
+of lines; each line is represented as a sequence of "0" and "1" symbols,
+where "1" symbol means an opaque pixel and "0" symbol means a
+transparent pixel. The width of the texture corresponds to the length
+of the longest line in the file, expanded to the nearest byte-aligned
+value. The height of the texture is equal to the number of non-empty
+lines in the file. Note that missing symbols are replaced by "0".
+
+Here is a texture file sample:
+
+<pre>
+00111100
+00111100
+11111111
+11111111
+11111111
+11111111
+00111100
+00111100
+</pre>
+
+\image html point_marker_dlg2.png
+
+<br>
+
+\image html custom_point_marker.png "Presentation with custom point markers"
+
+<b>See Also</b> a sample script of using
+\ref tui_point_marker_page "Point Marker" functionality via TUI.
+
+*/
+
--- /dev/null
+/*!
+
+\page postpro_preferences_page Post-Pro Preferences
+
+In the Post-Pro module you can set preferences, default settings,
+which can be used in later sessions with this module.
+
+<h2>General Preferences</h2>
+
+\image html ppref0.png
+
+<ul>
+<li><b>Input fields precision</b></li>
+<ul>
+<li><b>Visual data precision</b> - allows to adjust precision of scalar data displayed as text, data values round-up, various visualization options.</li>
+<li><b>Length precision</b> - allows to adjust input precision of coordinates and dimensions.</li>
+<li><b>Angular precision</b> - allows to adjust input precision of angles.</li>
+<li><b>Length tolerance precision</b> - allows to adjust input precision of tolerance of coordinates and dimensions.</li>
+<li><b>Parametric precision</b> - allows to adjust input precision of parametric values.</li>
+<li><b>Memory size precision</b> - allows to adjust input precision of memory size.</li>
+</ul>
+</ul>
+
+<h2>MED import Preferences</h2>
+
+\image html ppref1.png
+
+<ul>
+<li><b>MED files import</b></li>
+<ul>
+<li><b>Use Build Progress</b> - when this option is checked you can choose
+all other import MED options at the moment of loading of each file
+using <b>Build Progress</b> menu, otherwise the loading will be done
+according to the <b>Preferences</b> without addressing to the
+user.</li>
+<li><b>Full MED Loading</b> - when this option is checked, the MED file is
+fully loaded in the study, and no additional access to the MED file is
+needed during the session. Reversibly, when unchecked, the MED file is
+loaded on demand. This is the default behaviour in SALOME and
+recommended for big files to optimize memory usage.</li>
+<li><b>Build at once</b> - when this option is checked, you can't
+perform any operations until the MED file is fully loaded and
+processed.</li>
+<li><b>Build fields</b> - when this option is checked, the fields are
+built automatically at loading.</li>
+<li><b>Build min/max</b> - when this option is checked, minimum and
+maximum values of the time stamps are found at loading.</li>
+<li><b>Build groups</b> - when this option is checked, the groups and
+families are built automatically at loading.</li>
+<li><b>Close dialog at finish</b> - when this option is checked, the
+dialog box is closed after loading of the selected MED file. When
+unchecked, it allows loading other MED files.</li>
+</ul>
+</ul>
+
+<br><h2>Scalar Bar Preferences</h2>
+
+\image html pref31.png
+
+<ul>
+<li><b>Scalar Range</b></li>
+<ul>
+<li><b>Scalar Mode</b> - this feature allows refining the value to be
+inspected:</li>
+<ul>
+<li><b>Modulus:</b> value of a scalar or modulus of a vector.</li>
+<li><b>Component N:</b> Nth component of a vector, a tensor or a matrix.</li>
+</ul>
+<li><b>Logarithmic Scaling</b> - this checkbox toggles logarithmic
+scaling.</li>
+<li><b>Ranges to Use</b> - you can use either Field Range or Imposed
+Range.</li>
+<li><b>Gauss Metric</b> - gives the choice among Average, Minimum and Maximum.
+</ul>
+<li><b>Min and Max for Imposed Range</b> - in this menu you can set
+the limits for your Imposed Range, if you have chosen to use it.</li>
+<li><b>Font</b> - in this menu you can set type, face and color for
+the font of <b>Title</b> and <b>Labels</b>.</li>
+<li><b>Colors & Labels</b> - in this menu you can set the <b>number of
+colors</b> and the <b>number of labels</b> in the Scalar bar.</li>
+<li><b>Orientation</b> - here you can choose between vertical and horizontal
+orientation of the Scalar Bar.</li>
+<li><b>Scalar bars default position</b></li>
+<ul>
+<li><b>Arrange Scalar Bars</b> - this option prevents superposition of
+scalar bars during visualisation of several fields in the same
+window. If checked, a separate scalar bar is displayed for each
+presentation.</li>
+</ul>
+<li><b>Origin & Size Vertical & Horizontal</b> - allows to define
+placement and lookout of Scalar Bars and their labels.</li>
+<ul>
+<li><b>X:</b> abscissa of the point of origin (from the left
+side)</li>
+<li><b>Y:</b> ordinate of the origin of the bar (from the bottom)</li>
+</ul>
+
+</ul>
+
+<br><h2>Cut Lines Preferences</h2>
+
+\image html ppref2.png
+
+<ul>
+<li><b>CutLine Preferences</b></li>
+<ul>
+<li><b>Show preview</b> check box allows to edit the parameters of the
+presentation and simultaneously observe the preview of this
+presentation in the viewer.</li>
+<li><b>Invert all curves</b> check box allows to invert the resulting
+curves.</li>
+<li><b>Use absolute length</b> check box allows to use absolute length
+for curves.</li>
+<li><b>Generate Data Table:</b> If this check box is marked, <b>Post
+Pro</b> will automatically generate a data table on the basis of your
+Cut Lines presentation. This table will be created in the structure of
+the study.</li>
+<li><b>Generate Curves:</b> If this check box is marked, <b>Post Pro</b> will
+automatically generate curve lines on the basis of values taken from
+the generated data table. These curves will be created in the
+structure of the study and can be visualized in a XY plot.</li>
+</ul>
+</ul>
+
+<br><h2>Stream Lines Preferences</h2>
+
+\image html pref32.png
+
+<ul>
+<li><b>Stream Lines Preferences</b></li>
+<ul>
+<li><b>Used points</b> - allows to define a default percentage
+of points used for building the Stream Lines presentation.</li>
+</ul>
+</ul>
+
+<br><h2>Sweep and Animation Preferences</h2>
+
+\image html ppref3.png
+
+
+<ul>
+<li><b>3D Cache</b> - allow to define the mode of usage
+and the size of the 3D Cache, which enables to save in RAM and quickly
+restore the states of field animation (\b Sliding functionality).</li>
+<ul>
+<li><b>Memory Mode</b> - allows to define the mode of usage
+of the 3D Cache: <b>Minimal</b> actually disables the Cache,
+<b>Limited</b> Cache size depends on the current system
+configuration.</li>
+<li><b>Memory Limit</b> - allows to define the maximum size of the 3D
+Cache</li>
+</ul>
+
+<li><b>Animation preferences</b></li>
+<ul>
+<li><b>Speed</b> - allows to define the speed of the animation.</li>
+<li><b>Cycled animation</b> - allows to start a cycled animation of the presentation.</li>
+<li><b>Use proportional timing</b> - allows to render the animation with proportional periods of time between every frame (not depending on the time stamps).</li>
+<li><b>Clean memory at each frame</b> - this option allows to optimize the performance of the operation.</li>
+<li><b>Dump mode</b> - this option allows to choose a mode of dumping
+the animation process. Three modes are available:
+<ul>
+<li><b>No dump</b> - disables dumping.</li>
+<li><b>Save pictures to directory</b> - dumps the animation
+to set of pictures corresponding to each timestamp.</li>
+<li><b>Save animation to AVI file</b> - generates a movie that
+reproduces the animation process.</li>
+</ul></li>
+<li><b>Time stamp frequency</b> - this option is available if
+<b>Save animation to AVI file</b> mode is turned on. It provides a
+possibility to capture only timestamps with indices divisable by the
+specified frequency, that allows to generate less voluminous films.</li>
+</ul>
+
+<li><b>Sweeping preferences</b></li>
+<ul>
+<li><b>Mode of the Sweeping</b> - allows to choose between Linear,
+Cosinusoidal and sinusoidal sweeping.</li>
+<li><b>Time step</b> - in this menu you can set the time of
+representation of one step.</li>
+<li><b>Number of cycles</b> - in this menu you can define the number
+of times this animation will be repeated.</li>
+<li><b>Number of steps</b> - in this menu you can define the number of
+steps, which will compose the whole animation.</li>
+<li><b>Parameter varies</b> - allows to choose the range for the
+parameter: from 0 to Pi or from Pi to -Pi.</li>
+</ul>
+</ul>
+
+<br><h2>Representation Preferences</h2>
+
+\image html pref33.png
+
+<ul>
+<li><b>Representation properties</b> - these checkboxes allow to
+choose the default representation type for each field presentation.</li>
+<ul>
+<li><b>Floating Point Precision</b> - allows defining the number
+of digits displayed after the decimal point.</li>
+<li><b>Representation of the 2D quadratic elements</b> - allows
+selecting lines or arcs for representation of quadratic elements.</li>
+<li><b>Maximum Angle</b> - maximum deviation angle used by the
+application to build arcs. </li>
+<li><b>Edge Color</b> - allows selecting the color for representation
+of edges. </li>
+<li><b>Type of marker</b> - allows to choose a shape of point markers.</li>
+<li><b>Scale of marker</b> - allows to choose a scale of point markers.</li>
+<li><b>Use Shading</b> - when this option is checked, the objects will
+be displayed with shading.</li>
+<li><b>Display only on creation</b> - when this option is checked, all
+previously created presentations will be automatically removed from
+the viewer when a new presentation is created and displayed. You can
+restore the previously created presentations using the Object
+Browser.</li>
+<li><b>Automatic Fit All</b> - when this option is checked, the center
+of the view is automatically chosen to represent all displayed objects
+in the visible area.</li>
+</ul>
+</ul>
+
+<br><h2>Tables</h2>
+
+\image html pref35.png
+
+<ul>
+<li><b>Enable editing</b></li> - allows to edit contents of the tables
+(in particular, to sort table data by clicking on the column header).
+<li><b>Sort policy</b></li> - specify how the empty cells will be processed
+during the sort procedure. The following options are available:
+</li>
+<ul>
+<li><b>Empty cells are considered as lowest values</b></li>
+<li><b>Empty cells are considered as highest values</b></li>
+<li><b>Empty cells are always first</b></li>
+<li><b>Empty cells are always last</b></li>
+<li><b>Empty cells are ignored</b> (means that positions of the empty cells
+will not change after sorting)</li>
+</ul>
+</ul>
+
+<br><h2>Feature Edges</h2>
+
+\image html featureedgesprops.png
+
+These properties define which contours should be highlighted with
+<b>Feature Edges</b> functionality.
+<ul>
+<li><b>Feature edges angle</b> - allows to define at which minimum
+angle between two faces a wire is considered an edge </li>
+<li><b>Show feature edges</b> - allows to display feature edges.</li>
+<li><b>Show boundary edges</b> - allows to display boundary edges.</li>
+<li><b>Show manifold edges</b> - allows to display manifold edges. </li>
+<li><b>Show non-manifold edges</b> - allows to display non-manifold edges.</li>
+</ul>
+
+
+<br><h2>Gauss Points Preferences</h2>
+
+\image html pref34.png
+
+<ul>
+<li><b>Primitive</b> - this menu allows user to choose the graphic
+primitive to use to present the results at Gauss points in the
+viewer.</li>
+<ul>
+<li><b>Primitive type</b> - provides choice between <b>Point
+sprites</b>, <b>Open GL points</b> and <b>Geometrical Spheres</b>.</li>
+<li><b>Maximum Size (Clamp)</b> - defines the maximum size of sprite
+points ranging from 1 to 512. By default the value is set to 256
+pixels.</li>
+<li><b>Main Texture</b> - path to the <b>Main Texture</b> (16x16
+pixels) which defines the shape of the point sprite used for
+rendering.</li>
+<li><b>Alpha Channel Texture (16*16)</b> - path to the <b>Alpha
+Channel Texture</b> which defines the texture of the point
+sprite.</li>
+<li><b>Alpha Channel Threshold</b> - defines the level of transparency
+ranging from 0 to 1.</li>
+<li><b>Geometrical Sphere Resolution</b> - defines the number of faces
+of <b>Geometry Spheres</b>.</li>
+<li><b>Notify when number of faces exceeds</b> - limitation of the
+number of faces; the user will be warned if it exceeds the given
+value.</li>
+</ul>
+</ul>
+
+<ul>
+<li><b>Size</b> - in this menu you can define:</li>
+<ul>
+<li><b>Range value for min and max size</b> - these two parameters
+will be respectively multiplied by a reference length (average size of
+cells of the mesh) to define the range for minimum and maximum size of
+a point during rendering (at magnification = 100%). Default values
+are:</li>
+<ul>
+<li><b>Rainbow</b> scale: <b>min</b> = <b>10%</b>, <b>max</b> =
+<b>33%</b></li>
+<ul>
+<li>Min size is associated to the smallest real value (including
+negative values).</li>
+<li>Max size is associated to the largest real value.</li>
+</ul>
+<li><b>Bicolor</b> scale: <b>min</b> = <b>0</b> (not editable),
+<b>max</b> = <b>33%</b></li>
+<ul>
+<li>Null size is associated to the 0 scalar value.</li>
+<li>Max size is associated to the largest absolute value.</li>
+</ul>
+</ul>
+Both values are dynamically updated by the system according to the
+selected scalar bar. In the case of a Bicolor scale, the minimum value
+is set to 0 in the dialog and the control is disabled.
+<li><b>Magnification (%)</b> corresponds to the change of size of
+results at Gauss point primitives in 2D space. Acceptable values range
+from 0 to N; 100% means no magnification, 50% means half of its size,
+200% mean twice its size and so forth. By default this value is set to
+100%.</li>
+<li><b>+/- Ratio</b> corresponds to the number by which the
+magnification will be respectively multiplied or divided at edition,
+ranging from 0.01 to 10. By default this value is set to 2.</li>
+</ul>
+</ul>
+
+<ul>
+<li><b>Geometry</b></li>
+<ul>
+<li><b>Size of points (%)</b> defines a value that will be multiplied
+by a reference length (representative of the average size of cells of
+the mesh) to define the size of points during rendering (at
+magnification = 100%). Default values 10%.</li>
+<li><b>Color</b> - allows to select the color of points used for
+presentations. Click on the colored line to access to the <b>Select Color</b> dialog box.</li>
+</ul>
+</ul>
+
+<ul>
+<li><b>Gauss Points Scalar Bar</b></li>
+<ul>
+ <li><b>Active Bar</b> - this option allows to choose <b>Local</b> or
+ <b>Global</b> Bar as active.</li>
+ <li><b>Display Global Bar</b> - this option allows to visualize or to
+ hide the Global Bar.</li>
+ <li><b>Scalar Bar Mode</b> - this option allows to choose between
+ <b>Bicolor</b> and <b>Rainbow</b> Scalar Bar Mode.</li>
+ <li><b>Spacing</b> - allows to define Spacing from 0.01 to 1.</li>
+</ul>
+</ul>
+
+<ul>
+<li><b>Spacemouse</b></li>
+<ul>
+<li><b>Decrease Gauss Points Magnification </b> - divides the current
+magnification by magnification ratio. </li>
+<li><b>Increase Gauss Points Magnification </b> - multiplies the
+current magnification by magnification ratio. </li>
+</ul>
+</ul>
+
+<br><br><b>Inside<b> and </b>Outside Cursor Preferences</b> allow to set
+<b>Primitives</b>, <b>Size</b> and <b>Magnification</b> for the
+respective zones.
+
+<br><h2>Picking Preferences</h2>
+
+\image html pref37.png
+
+<ul>
+<li><b>Cursor</b> - allows to adjust the Size of the cursor used for
+Picking (ranging from 0.1 to 1), the Height of the pyramids (ranging
+from 0 to 10) and the Selection cursor color.</li>
+<li><b>Tolerance</b> - defines at which distance of the cursor from
+the point it becomes selected (ranges from 0.001 to 10).</li>
+<li><b>Information window</b> - allows to define the
+<b>Transparency</b> (from 0% = opaque to 100% = transparent) and
+<b>Position</b> of the window, which can be:</li>
+<li><ul>
+ <li><b>Centred below the point</b>, or</li>
+ <li>located at <b>Top-left corner of the 3D view</b></li>
+</ul></li>
+<li><b>Movement of the Camera</b> can also be define by the user.</li>
+<li><ul>
+ <li><b>Zoom at first selected point</b> - This value is used to define
+ the focal distance at the first selected point (at the end of the
+ movement of the camera). This value is a ratio that will be multiplied
+ by the current zoom value.</li>
+ <li><b>Number of steps between two positions</b> - defines the
+ smoothness of camera movement at selection by the number of
+ iterations. If set to 1 the camera is zoomed and centered at the point
+ momentarily. Greater numbers mean very slow camera movement.</li>
+</ul></li>
+<li><b>Display parent mesh element</b> - allows to visualize or hide
+the patent mesh element of the selected gauss point.</li>
+</ul>
+
+*/
<br><br>
This presentation will be displayed in the viewer.
-*/
\ No newline at end of file
+<br><b>See Also</b> a sample TUI Script of
+\ref tui_submesh_page "Submesh presentation" creation.
+
+*/
--- /dev/null
+python_examples_page
+
+/*!
+
+\page python_examples_page Examples of Python scripts
+
+By the links below you can find sample scripts for operations
+provided by Post-Pro module.
+
+<ul>
+ <li>\subpage tui_import_export_page</li>
+ <li>\subpage tui_creating_3d_prs_page</li>
+ <ul>
+ <li>\ref tui_submesh_page</li>
+ <li>\ref tui_scalar_map_page</li>
+ <li>\ref tui_iso_surf_page</li>
+ <li>\ref tui_cut_planes_page</li>
+ <li>\ref tui_cut_lines_page</li>
+ <li>\ref tui_cut_segment_page</li>
+ <li>\ref tui_def_shape_page</li>
+ <li>\ref tui_def_shape_and_scalar_map_page</li>
+ <li>\ref tui_vectors_page</li>
+ <li>\ref tui_stream_lines_page</li>
+ <li>\ref tui_plot_3d_page</li>
+ <li>\ref tui_gauss_points_page</li>
+ </ul>
+ <li>\subpage tui_datatable_page</li>
+ <ul>
+ <li>\ref tui_table_import_page</li>
+ <li>\ref tui_table_3d_page</li>
+ <li>\ref tui_table_curves_page</li>
+ </ul>
+ <li>\subpage tui_manage_3d_prs_page</li>
+ <ul>
+ <li>\ref tui_view_3d_page</li>
+ <li>\ref tui_animation_page</li>
+ <li>\ref tui_evolution_page</li>
+ <li>\ref tui_point_marker_page</li>
+ </ul>
+</ul>
+
+*/
\ No newline at end of file
inactive).</li>
<li><b>Logarithmic scaling</b> check box: You can apply logarithmic
scaling to the color scale of the presentation.</li>
+<li><b>Gauss Metric</b> field: This field allows to choose what kind
+of value will be extracted from gauss points data. (Note: This field
+is shown only for two presentation types - <b>Scalar Map</b>
+and <b>Deformed Shape and Scalar Map</b>, and it is active only when
+the result is based on multiple gauss points).</li>
<li><b>Use field range:</b> if this check box is selected, all cells
of the field presentation will be colored according the values applied
to these cells.</li>
\image html scalar_map_on_cells.png "Scalar map on Cell Mesh"
+<b>See Also</b> a sample TUI Script of
+\ref tui_scalar_map_page "Scalar Map presentation" creation.
+
*/
\image html scalar_map_on_cells.png "Example of Scalar Map presentation"
-*/
\ No newline at end of file
+<b>See Also</b> a sample TUI Script of
+\ref tui_def_shape_and_scalar_map_page "Deformed Shape and Scalar Map presentation" creation.
+
+*/
\image html slider2.png
\b Properties tab allows setting memory management properties.
-<ul>
-<li> \b Minimal radio button commands the application to use a minimum
-amount of memory</li>
-<li> \b Limited radio button allows to set the upper limit for the
-amount of used memory.</li>
-<li> \b Used and \b Free fields allow to set target values for used
-and free memory.</li>
-<li> \b Speed scroll allows to set the speed of the presentation.</li>
-<ul>
+- \b Minimal radio button commands the application to use a minimum
+ amount of memory
+- \b Limited radio button allows to set the upper limit for the amount
+ of used memory
+- \b Used and \b Free fields allow to set target values for used and
+ free memory.
+- \b Speed scroll allows to set the speed of the presentation.
-*/
\ No newline at end of file
+*/
After you have finished with setting these parameters, click \b
OK. Your presentation with scalar bar will be immediately displayed in
-the viewer:
+the viewer.
-*/
\ No newline at end of file
+<br><b>See Also</b> a sample TUI Script of
+\ref tui_stream_lines_page "Stream Lines presentation" creation.
+
+*/
<em>To sweep a field presentation:</em>
-\ref creating_field_presentations_page "Create a field presentation".
+\ref field_presentations_page "Create a field presentation".
In the Main menu select <b>View -> Windows -> Sweep</b>. The following
dialog will appear.
Default parameters for \b Sweep can be set in the Main menu in <b>File
-> Preferences -> Post-Pro -> Sweep, Animation</b> tab
-*/
\ No newline at end of file
+*/
<em>To create a Table 3D presentation:</em>
\par
-– Right-click on an XLS table in the
+– Right-click on an table object in the
Object browser and from the context menu choose <b>Show</b>, or <b>Show only</b>
\image html table.png
</ul>
It is also possible to choose \b Wireframe or \b Shading \b Representation type, change
-such properties as \b Opacity and <b> Line Width </b> and <b> Translate </b> the presentation using the context menu.
+such properties as \b Transparency and <b> Line Width </b> and <b> Translate </b> the presentation using the context menu.
+<br><b>See Also</b> a sample TUI Script of
+\ref tui_table_3d_page "Table 3D presentation creation".
-
-*/
\ No newline at end of file
+*/
<b>DataTable object</b> is a way to represent a two-dimensional data array
(data arranged in rows and columns) in Salome. Each column groups values expressed in certain measurement \b units.
-All \b columns and <b>rows</b> have </b>titles</b>. Tables can be \b
+All \b columns and <b>rows</b> have <b>titles</b>. Tables can be \b
rarefied, which means that some cells may be empty, without any
values.
GUI Help), or \subpage importing_exporting_tables_page "imported"
from properly defined ACSII files.
+\anchor creating_tables_from_cut_lines
+
\note Alternatively, it is possible to create a table from
the scalar values applied to the cells forming a \ref cut_lines_page "Cut Lines"
-presentation. Simply right-click on the presentation in the Object
-Browser or in the viewer and select <b>Create Table</b> from the pop-up menu.
+or a \ref cut_segment_page "Cut Segment" presentation. Simply right-click on the
+presentation in the Object Browser or in the viewer and select <b>Create Table</b>
+from the pop-up menu.
Tables are not displayed automatically. To view the imported table,
right-click on it in the Object Brower and select <b>Show Table</b>
\image html viewtable.png
+When the <b>Enable editing</b> option is checked, the table contents are editable.
+\note At the current moment this mode only allows to sort table data.
+The sorting is performed by clicking on the header of the column, by which the data
+is sorted.
+
+<b>Sort policy</b> option allows to specify how the empty cells will be processed
+during the sort procedure. The following options are available:
+<ul>
+<li><b>Empty cells are considered as lowest values</b></li>
+<li><b>Empty cells are considered as highest values</b></li>
+<li><b>Empty cells are always first</b></li>
+<li><b>Empty cells are always last</b></li>
+<li><b>Empty cells are ignored</b> (this means that the positions of empty cells
+will not change after the sorting)</li>
+</ul>
+
+<b>Adjust Cells</b> button allows to adjust the size of table cells according
+to their contents.
+
It is also possible to create
\subpage table_3d_page "Table 3D presentation" basing on the table
data and display it in the VTK viewer.
-*/
\ No newline at end of file
+*/
--- /dev/null
+/*!
+
+\page tui_animation_page Animation
+
+Example of <b>Successive Animation</b>:
+
+\code
+import os
+from time import sleep
+
+import salome
+
+import VISU
+from visu_gui import *
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Import a MED file
+medFile = os.path.join(datadir,"MedFiles","TimeStamps.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create a 3D view
+myViewManager = myVisu.GetViewManager()
+myView = myViewManager.Create3DView()
+myView.SetTitle("Animation view")
+
+# Create an animation instance
+fieldName = "vitesse"
+
+myAnimation = myVisu.CreateAnimation(myView);
+
+# Set the successive animation mode
+myAnimation.setAnimationMode(VISU.Animation.SUCCESSIVE)
+
+# Set the animation properties:
+
+# Add a field with timestamps, on which the animation will be performed
+fieldName = "vitesse, m/s"
+fieldSO = salome.myStudy.FindObject(fieldName)
+myAnimation.addField(fieldSO)
+
+# Set the presentation type for the first field
+myAnimation.setPresentationType(0, VISU.TDEFORMEDSHAPEANDSCALARMAP)
+
+# Generate presentations
+myAnimation.generatePresentations(0)
+
+# Create the pattern of a Deformed Shape and Scalar Map presentation
+meshName = "dom"
+fieldName = "vitesse"
+fieldEntity = VISU.NODE
+timestampId = 1
+myDefShapeScalarMap = myVisu.DeformedShapeAndScalarMapOnField(myResult, meshName, fieldEntity, fieldName, timestampId)
+myDefShapeScalarMap.SetScale(0.75)
+
+# Apply the pattern properties to all generated presentations
+myAnimation.ApplyProperties(0, myDefShapeScalarMap)
+
+# Generate frames
+myAnimation.generateFrames()
+
+# Publish the animation object in the study
+myAnimation.publishInStudy()
+
+# Set the speed
+myAnimation.setSpeed(80)
+
+# Save the animation after changing the speed
+myAnimation.saveAnimation()
+
+# Fit All
+myView.FitAll()
+
+# Start the animation
+myAnimation.startAnimation()
+
+# Rewind to the first frame
+sleep(10)
+myAnimation.firstFrame()
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+\endcode
+
+<br>Example of <b>Parallel Animation</b>:
+
+\code
+import os
+from time import sleep
+
+import salome
+
+import VISU
+from visu_gui import *
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Import a MED file
+medFile = os.path.join(datadir,"MedFiles","TimeStamps.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create a 3D view
+myViewManager = myVisu.GetViewManager()
+myView = myViewManager.Create3DView()
+myView.SetTitle("Animation view")
+
+# Create an animation instance
+fieldName = "vitesse"
+
+myAnimation = myVisu.CreateAnimation(myView);
+
+# Set the successive animation mode
+myAnimation.setAnimationMode(VISU.Animation.PARALLEL)
+
+# Set animation properties:
+
+# Add two fields with timestamps, on which the animation will be performed
+fieldName1 = "vitesse, m/s"
+fieldSO1 = salome.myStudy.FindObject(fieldName1)
+fieldName2 = "temperature, K"
+fieldSO2 = salome.myStudy.FindObject(fieldName2)
+
+myAnimation.addField(fieldSO1)
+myAnimation.addField(fieldSO2)
+
+# Set the presentation type for the first field
+myAnimation.setPresentationType(0, VISU.TVECTORS)
+
+# Set the presentation type for the second field
+myAnimation.setPresentationType(1, VISU.TSCALARMAP)
+
+# Generate presentations for all fields
+nbFileds = myAnimation.getNbFields()
+for i in range(0, nbFileds):
+ myAnimation.generatePresentations(i)
+
+# Create the pattern of Vectors presentation
+meshName = "dom"
+fieldName = "vitesse"
+fieldEntity = VISU.NODE
+timestampId = 1
+myVectors = myVisu.VectorsOnField(myResult, meshName, fieldEntity, fieldName, timestampId)
+myVectors.SetScale(1)
+myVectors.ShowColored(True)
+
+# Apply the vectors pattern properties to all presentations generated for 'vitesse' field
+myAnimation.ApplyProperties(0, myVectors)
+
+# Generate frames
+myAnimation.generateFrames()
+
+# Publish the animation object in the study
+myAnimation.publishInStudy()
+
+# Set the speed
+myAnimation.setSpeed(95)
+
+# Fit All
+myView.FitAll()
+
+# Start the animation
+myAnimation.startAnimation()
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+\endcode
+
+<br>Please, see \ref VISU.Animation "Animation interface reference documentation"
+for more details.
+
+*/
--- /dev/null
+/*!
+
+\page tui_creating_3d_prs_page Creating 3D presentations
+
+<ul>
+<li>\subpage tui_submesh_page</li>
+<li>\subpage tui_scalar_map_page</li>
+<li>\subpage tui_iso_surf_page</li>
+<li>\subpage tui_cut_planes_page</li>
+<li>\subpage tui_cut_lines_page</li>
+<li>\subpage tui_cut_segment_page</li>
+<li>\subpage tui_def_shape_page</li>
+<li>\subpage tui_def_shape_and_scalar_map_page</li>
+<li>\subpage tui_vectors_page</li>
+<li>\subpage tui_stream_lines_page</li>
+<li>\subpage tui_plot_3d_page</li>
+<li>\subpage tui_gauss_points_page</li>
+</ul>
+
+*/
\ No newline at end of file
--- /dev/null
+/*!
+
+\page tui_cut_lines_page Cut Lines
+
+Create <b>Cut Lines</b> presentation on a field of the imported MED file:
+
+\code
+import os
+
+import salome
+
+import VISU
+import visu_gui
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import a MED file
+medFile = os.path.join(datadir,"MedFiles","fra.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create cut lines for the first timestamp of 'VITESSE' field
+meshName = 'LE VOLUME'
+fieldEntity = VISU.NODE
+fieldName = 'VITESSE'
+myCutLines = myVisu.CutLinesOnField(myResult, meshName, fieldEntity, fieldName, 1)
+
+# Set the orientation of the base plane (parallel to ZX)
+myCutLines.SetOrientation(VISU.CutPlanes.ZX, 0, 0)
+
+# Set the orientation of the cutting planes (parallel to ZX)
+myCutLines.SetOrientation2(VISU.CutPlanes.XY, 0, 0)
+
+# Set the number of lines
+myCutLines.SetNbLines(12)
+
+# Set the displacement of the base plane
+myCutLines.SetDisplacement(0)
+
+# Set a custom position for the first line
+newPos = (myCutLines.GetLinePosition(1) - myCutLines.GetLinePosition(0))/2
+myCutLines.SetLinePosition(0, newPos)
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+
+# Display the newly created cut lines
+myViewManager = myVisu.GetViewManager()
+myView = myViewManager.Create3DView()
+
+myView.DisplayOnly(myCutLines)
+myView.FitAll()
+\endcode
+
+<br>Please, see \ref VISU.CutLines "CutLines interface reference documentation"
+for more details.
+
+*/
--- /dev/null
+/*!
+
+\page tui_cut_planes_page Cut Planes
+
+Create <b>Cut Planes</b> presentation on a field of the imported MED file:
+
+\code
+import os
+
+import salome
+
+import VISU
+import visu_gui
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import a MED file
+medFile = os.path.join(datadir,"MedFiles","fra.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create cut planes for the first timestamp of 'VITESSE' field
+meshName = 'LE VOLUME'
+fieldEntity = VISU.NODE
+fieldName = 'VITESSE'
+myCutPlanes = myVisu.CutPlanesOnField(myResult, meshName, fieldEntity, fieldName, 1)
+
+# Set the number of planes
+myCutPlanes.SetNbPlanes(15)
+
+# Set the planes orientation (parallel to XY), set rotation around Y to 0.5 radian
+myCutPlanes.SetOrientation(VISU.CutPlanes.XY, 0, 0.5)
+
+# Set the scale
+myCutPlanes.UseDeformation(True)
+myCutPlanes.SetVectorialField(fieldEntity, fieldName)
+myCutPlanes.SetScale(0.05)
+
+# Set the displacement
+myCutPlanes.SetDisplacement(0.1)
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+
+# Display the newly created cut planes
+myViewManager = myVisu.GetViewManager()
+myView = myViewManager.Create3DView()
+
+myView.DisplayOnly(myCutPlanes)
+myView.FitAll()
+\endcode
+
+<br>Please, see \ref VISU.CutPlanes "CutPlanes interface reference documentation"
+for more details.
+
+*/
--- /dev/null
+/*!
+
+\page tui_cut_segment_page Cut Segment
+
+Create <b>Cut Segment</b> presentation on a field of the imported MED file:
+
+\code
+import os
+
+import salome
+
+import VISU
+import visu_gui
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import a MED file
+medFile = os.path.join(datadir,"MedFiles","fra.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create a cut segment for the first timestamp of 'VITESSE' field
+meshName = 'LE VOLUME'
+fieldEntity = VISU.NODE
+fieldName = 'VITESSE'
+myCutSegment = myVisu.CutSegmentOnField(myResult, meshName, fieldEntity, fieldName, 1)
+
+# Set the first point of the segment
+myCutSegment.SetPoint1(0, 0, 0)
+
+# Set the second point of the segment
+myCutSegment.SetPoint2(0.41, 0.0685, 1.082)
+
+# Invert the resulting curve
+myCutSegment.SetAllCurvesInverted(True)
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+
+# Display the newly created cut segment
+myViewManager = myVisu.GetViewManager()
+myView = myViewManager.Create3DView()
+
+myView.DisplayOnly(myCutSegment)
+myView.FitAll()
+\endcode
+
+<br>Please, see \ref VISU.CutSegment "CutSegment interface reference documentation"
+for more details.
+
+*/
--- /dev/null
+/*!
+
+\page tui_datatable_page DataTable
+
+<ul>
+<li>\subpage tui_table_import_page</li>
+<li>\subpage tui_table_3d_page</li>
+<li>\subpage tui_table_curves_page</li>
+</ul>
+
+*/
\ No newline at end of file
--- /dev/null
+/*!
+
+\page tui_def_shape_page Deformed Shape
+
+Create <b>Deformed Shape</b> presentation on a field of the imported MED file:
+
+\code
+import os
+
+import salome
+
+import VISU
+import visu_gui
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import a MED file
+medFile = os.path.join(datadir,"MedFiles","fra.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create a deformed shape for the first timestamp of 'VITESSE' field
+meshName = 'LE VOLUME'
+fieldEntity = VISU.NODE
+fieldName = 'VITESSE'
+myDefShape = myVisu.DeformedShapeOnField(myResult, meshName, fieldEntity, fieldName, 1)
+
+# Set the scale factor
+myDefShape.SetScale(0.25)
+
+# Set magnitude coloring
+myDefShape.ShowColored(True)
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+
+# Display the newly created deformed shape
+myViewManager = myVisu.GetViewManager()
+myView = myViewManager.Create3DView()
+
+myView.DisplayOnly(myDefShape)
+myView.FitAll()
+\endcode
+
+<br>Please, see \ref VISU.DeformedShape "DeformedShape interface reference documentation"
+for more details.
+
+*/
--- /dev/null
+/*!
+
+\page tui_def_shape_and_scalar_map_page Deformed Shape and Scalar Map
+
+Create <b>Deformed Shape and Scalar Map</b> presentation on the field of the imported MED file:
+
+\code
+import os
+
+import salome
+
+import VISU
+import visu_gui
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import a MED file
+medFile = os.path.join(datadir,"MedFiles","fra.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create a deformed shape and a scalar map for the first timestamp of 'VITESSE' field
+meshName = 'LE VOLUME'
+fieldEntity = VISU.NODE
+fieldName = 'VITESSE'
+myDefShapeScalarMap = myVisu.DeformedShapeAndScalarMapOnField(myResult, meshName, fieldEntity, fieldName, 1)
+
+# Set the scale
+myDefShapeScalarMap.SetScale(0.25)
+
+# Set 'TAUX_DE_VIDE' as a scalar field, use the first timestamp
+fieldName = 'TAUX_DE_VIDE'
+myDefShapeScalarMap.SetScalarField(VISU.NODE, fieldName, 1)
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+
+# Display the newly created presentation
+myViewManager = myVisu.GetViewManager()
+myView = myViewManager.Create3DView()
+
+myView.DisplayOnly(myDefShapeScalarMap)
+myView.FitAll()
+\endcode
+
+<br>Please, see \ref VISU.DeformedShapeAndScalarMap
+"DeformedShapeAndScalarMap interface reference documentation"
+for more details.
+
+*/
--- /dev/null
+/*!
+
+\page tui_evolution_page Evolution on Point
+
+Example of <b>Evolution on Point</b> presentation:
+
+\code
+import os
+
+import salome
+
+import VISU
+from visu_gui import *
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Import a MED file
+medFile = os.path.join(datadir,"MedFiles","TimeStamps.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create a 2D viewer for the evolution graph:
+myViewManager = myVisu.GetViewManager();
+myView = myViewManager.CreateXYPlot();
+myView.SetTitle("The viewer for Evolution")
+
+# Create an evolution instance, using the newly created view
+myEvolution = myVisu.CreateEvolution(myView);
+
+# Get 'vitesse' field object
+aSObj = myStudy.FindObjectIOR(myResult.GetID())
+aSObj = aSObj.FindSubObject(1)[1] # 'dom' mesh
+aSObj = aSObj.FindSubObject(3)[1] # Fields
+vitesseSO = aSObj.FindSubObject(2)[1] # 'vitesse' field
+myEvolution.setField(vitesseSO)
+
+# Set "x" as a component
+myEvolution.setComponentId(1)
+
+# Set a point via identifier
+myEvolution.setPointId(500)
+
+# Show the Evolution
+myEvolution.showEvolution()
+myView.FitAll()
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+\endcode
+
+<br>Please, see \ref VISU.Evolution "Evolution interface reference documentation"
+for more details.
+
+*/
--- /dev/null
+/*!
+
+\page tui_gauss_points_page Gauss Points
+
+Create <b>Gauss Points</b> presentations on a field of the imported MED file:
+
+\code
+import os
+from time import sleep
+
+import salome
+import SALOMEDS
+
+import VISU
+import visu_gui
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import the file
+medFile = os.path.join(datadir,"MedFiles","pointe.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create gauss points for the first timestamp of 'fieldcelldoublevector' field
+meshName = 'maa1'
+fieldEntity = VISU.CELL
+fieldName = 'fieldcelldoublevector'
+
+# Create a Gauss Points presentation of the first type: <b>Results at Gauss Points</b>
+myGaussPoints1 = myVisu.GaussPointsOnField(myResult, meshName, fieldEntity, fieldName, 1)
+
+# Set range values (5-50%):
+myGaussPoints1.SetMinSize(0.05)
+myGaussPoints1.SetMaxSize(0.5)
+
+# Set OpenGL Points as a primitive type
+myGaussPoints1.SetPrimitiveType(VISU.GaussPoints.POINT)
+
+# Set the maximum size of points
+myGaussPoints1.SetClamp(32)
+
+# Create a Gauss Points presentation of the second type: <b>Gauss Points on Geometry</b>
+myGaussPoints2 = myVisu.GaussPointsOnField(myResult, meshName, fieldEntity, fieldName, 1)
+myGaussPoints2.SetIsColored(False)
+
+# Set magnification to 200%
+myGaussPoints2.SetMagnification(2)
+
+# Set magnification ratio
+myGaussPoints2.SetMagnificationIncrement(4)
+
+# Set the size of points
+myGaussPoints2.SetGeomSize(0.25)
+
+# Set the color of points
+myGaussPoints2.SetColor(SALOMEDS.Color(255, 90, 255))
+
+# Create a Gauss Points presentation of the third type: <b>Gauss Points on Deformed Shape</b>
+myGaussPoints3 = myVisu.GaussPointsOnField(myResult, meshName, fieldEntity, fieldName, 1)
+
+# Apply the deformation
+myGaussPoints3.SetIsDeformed(True)
+myGaussPoints3.SetScaleFactor(0.4)
+
+# Set a geometrical sphere as the primitive type
+myGaussPoints3.SetPrimitiveType(VISU.GaussPoints.SPHERE)
+
+# Set sphere resolution
+myGaussPoints3.SetResolution(5)
+
+# Update object browser
+salome.sg.updateObjBrowser(1)
+
+# Display the newly created presentations one by one
+myViewManager = myVisu.GetViewManager()
+myView = myViewManager.Create3DView()
+
+prsList = [myGaussPoints1, myGaussPoints2, myGaussPoints3]
+for prs in prsList:
+ myView.DisplayOnly(prs)
+ myView.FitAll()
+ sleep(5)
+\endcode
+
+<br>Please, see \ref VISU.GaussPoints "GaussPoints interface reference documentation"
+for more details.
+
+*/
--- /dev/null
+/*!
+
+\page tui_import_export_page Import/Export MED
+
+Import data from a MED file:
+
+\code
+import os
+
+import salome
+
+import visu_gui
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# The path to the file
+medFile = os.path.join(datadir,"MedFiles","fra.med")
+
+# Import the file
+myResult = myVisu.ImportFile(medFile)
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+\endcode
+
+<br>Export data to a MED file:
+
+\code
+import os
+
+import salome
+
+import visu_gui
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# The path to the file
+medFile = os.path.join(datadir,"MedFiles","fra.med")
+
+# Import the file
+myResult = myVisu.ImportFile(medFile)
+
+# Export the file
+newFileName = os.path.join(datadir,"MedFiles","fra_copy.med")
+myResult.ExportMED(newFileName)
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+\endcode
+
+*/
--- /dev/null
+/*!
+
+\page tui_iso_surf_page Iso Surfaces
+
+Create <b>Iso Surfaces</b> presentation on a field of the imported MED file:
+
+\code
+import os
+
+import salome
+
+import VISU
+import visu_gui
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import a MED file
+medFile = os.path.join(datadir,"MedFiles","fra.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create iso surfaces for the first timestamp of 'VITESSE' field
+meshName = 'LE VOLUME'
+fieldEntity = VISU.NODE
+fieldName = 'VITESSE'
+myIsoSurfaces = myVisu.IsoSurfacesOnField(myResult, meshName, fieldEntity, fieldName, 1)
+
+# Set the number of surfaces
+myIsoSurfaces.SetNbSurfaces(12)
+
+# Show two value labels per surface
+myIsoSurfaces.ShowLabels(True, 2)
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+
+# Display the newly created iso surfaces
+myViewManager = myVisu.GetViewManager()
+myView = myViewManager.Create3DView()
+
+myView.DisplayOnly(myIsoSurfaces)
+myView.FitAll()
+\endcode
+
+<br>Please, see \ref VISU.IsoSurfaces "IsoSurfaces interface reference documentation"
+for more details.
+
+*/
--- /dev/null
+/*!
+
+\page tui_manage_3d_prs_page Managing 3D Presentations
+
+<ul>
+<li>\subpage tui_view_3d_page</li>
+<li>\subpage tui_animation_page</li>
+<li>\subpage tui_evolution_page</li>
+<li>\subpage tui_point_marker_page</li>
+</ul>
+
+*/
\ No newline at end of file
--- /dev/null
+/*!
+
+\page tui_plot_3d_page Plot 3D
+
+Create <b>Plot 3D</b> presentation on a field of the imported MED file:
+
+\code
+import os
+
+import salome
+
+import VISU
+import visu_gui
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import a MED file
+medFile = os.path.join(datadir,"MedFiles","fra.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create a 3d plot for the first timestamp of 'VITESSE' field
+meshName = 'LE VOLUME'
+fieldEntity = VISU.NODE
+fieldName = 'VITESSE'
+myPlot3D = myVisu.Plot3DOnField(myResult, meshName, fieldEntity, fieldName, 1)
+
+# Set the cut plane orientation
+myPlot3D.SetOrientation(VISU.Plot3D.ZX, 0, 0)
+
+# Set the relative position of the plane
+myPlot3D.SetPlanePosition(0.8, True)
+
+# Set the scale factor
+myPlot3D.SetScaleFactor(0.25)
+
+# Set the contour presentation type
+myPlot3D.SetContourPrs(True)
+
+# Set the number of contours
+myPlot3D.SetNbOfContours(100)
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+
+# Display the newly created plot 3d presentation
+myViewManager = myVisu.GetViewManager()
+myView = myViewManager.Create3DView()
+
+myView.DisplayOnly(myPlot3D)
+myView.FitAll()
+\endcode
+
+<br>Please, see \ref VISU.Plot3D "Plot3D interface reference documentation"
+for more details.
+
+*/
--- /dev/null
+/*!
+
+\page tui_point_marker_page Point Marker
+
+Example of using <b>Point Markers</b>:
+
+\code
+import os
+import time
+import VISU
+from visu_gui import *
+
+data_dir = os.getenv("DATA_DIR")
+sleep_delay = 2
+
+myViewManager = myVisu.GetViewManager();
+
+myView = myViewManager.Create3DView()
+myView.SetTitle("The viewer for Point Marker Example")
+print "myViewManager.Create3DView()"
+
+medFile = "fra.med"
+medFile = os.path.join(datadir,"MedFiles","fra.med")
+myResult = myVisu.ImportFile(medFile)
+
+aMeshName ="LE VOLUME"
+anEntity = VISU.NODE
+aFieldName = "VITESSE";
+aTimeStampId = 1
+
+aScalarMap = myVisu.ScalarMapOnField(myResult,aMeshName,anEntity,aFieldName,aTimeStampId)
+myView.Display(aScalarMap);
+myView.FitAll();
+
+print "Set the representation type to Point"
+myView.SetPresentationType(aScalarMap, VISU.POINT)
+
+print "Set a standard marker"
+aScalarMap.SetMarkerStd(VISU.MT_PLUS, VISU.MS_25)
+myView.Update()
+time.sleep(sleep_delay)
+
+print "Set a custom marker"
+custom_texture = myVisu.LoadTexture(os.path.join(data_dir, "Textures", "texture1.dat"))
+aScalarMap.SetMarkerTexture(custom_texture)
+myView.Update()
+
+\endcode
+
+<br>Please, see \ref VISU.Prs3d "Prs3d interface reference documentation"
+for more details.
+*/
--- /dev/null
+/*!
+
+\page tui_scalar_map_page Scalar Map
+
+Create <b>Scalar Map</b> presentation on a field of the imported MED file:
+
+\code
+import os
+
+import salome
+
+import VISU
+import visu_gui
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import a MED file
+medFile = os.path.join(datadir,"MedFiles","pointe.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create a scalar map for the first timestamp of 'fieldcelldoublevector' field
+meshName = 'maa1'
+fieldEntity = VISU.CELL
+fieldName = 'fieldcelldoublevector'
+myScalarMap = myVisu.ScalarMapOnField(myResult, meshName, fieldEntity, fieldName, 1)
+
+# Set the logarithmic scaling
+myScalarMap.SetScaling(VISU.LOGARITHMIC)
+
+# Set scalar range to [2, 5]
+myScalarMap.SetRange(2, 5)
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+
+# Display the newly created scalar map
+myViewManager = myVisu.GetViewManager()
+myView = myViewManager.Create3DView()
+
+myView.DisplayOnly(myScalarMap)
+myView.FitAll()
+\endcode
+
+<br>Please, see \ref VISU.ScalarMap "ScalarMap interface reference documentation"
+for more details.
+
+*/
--- /dev/null
+/*!
+
+\page tui_stream_lines_page Stream Lines
+
+Create <b> Stream Lines</b> presentation on a field of the imported MED file:
+
+\code
+import os
+
+import salome
+
+import VISU
+import visu_gui
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import a MED file
+medFile = os.path.join(datadir,"MedFiles","fra.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create stream lines for the first timestamp of 'VITESSE' field
+meshName = 'LE VOLUME'
+fieldEntity = VISU.NODE
+fieldName = 'VITESSE'
+myStreamLines = myVisu.StreamLinesOnField(myResult, meshName, fieldEntity, fieldName, 1)
+
+# Set stream lines parameters
+integrationStep = 0.003
+propagationTime = 1.5
+stepLength = 0.015
+# Mesh on nodes
+prs3D = myVisu.MeshOnEntity(myResult, meshName, VISU.NODE)
+pointsPercents = 0.05
+direction = VISU.StreamLines.FORWARD
+
+myStreamLines.SetParams(integrationStep, propagationTime, stepLength, prs3D, pointsPercents, direction)
+
+# Set magnitude coloring
+myStreamLines.ShowColored(True)
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+
+# Display the newly created stream lines
+myViewManager = myVisu.GetViewManager()
+myView = myViewManager.Create3DView()
+
+myView.DisplayOnly(myStreamLines)
+myView.FitAll()
+\endcode
+
+<br>Please, see \ref VISU.StreamLines "StreamLines interface reference documentation"
+for more details.
+
+*/
--- /dev/null
+/*!
+
+\page tui_submesh_page Submesh presentation
+
+Display various submeshes of the imported MED file:
+
+\code
+import os
+from time import sleep
+
+import salome
+import SALOMEDS
+
+import VISU
+import visu_gui
+
+# The directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import a MED file
+medFile = os.path.join(datadir,"MedFiles","pointe.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create submesh presentations
+meshName = 'maa1'
+cellEntity = VISU.CELL
+nodeEntity = VISU.NODE
+
+mySubMeshes = []
+
+# Create submesh on nodes
+myOnNodes = myVisu.MeshOnEntity(myResult, meshName, nodeEntity)
+mySubMeshes.append(myOnNodes)
+
+# Create submesh on a family (one cell)
+familyName = 'FAMILLE_ELEMENT_1'
+myOnFamily = myVisu.FamilyMeshOnEntity(myResult, meshName, cellEntity, familyName)
+mySubMeshes.append(myOnFamily)
+
+# Create submesh on a group (several cells)
+groupName = 'groupe1'
+myOnGroup = myVisu.GroupMesh(myResult, meshName, groupName)
+mySubMeshes.append(myOnGroup)
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+
+# Display newly created presentations one by one
+myViewManager = myVisu.GetViewManager()
+myView = myViewManager.Create3DView()
+
+for submesh in mySubMeshes:
+ myView.DisplayOnly(submesh)
+ myView.FitAll()
+ sleep(5)
+\endcode
+
+<br>Please, see \ref VISU.Mesh "Mesh interface reference documentation"
+for more details.
+
+*/
--- /dev/null
+/*!
+
+\page tui_table_3d_page Table 3D presentation
+
+Create and display a Table 3D presentation:
+
+\code
+import os
+
+import salome
+
+import visu_gui
+
+# The directory containing data table files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import tables from file
+tableFile = os.path.join(datadir,"Tables","table_test.xls")
+myTablesSO = myVisu.ImportTables(tableFile, False)
+
+# Create a table presentation
+table = None
+anIsFound, aTableSO = myTablesSO.FindSubObject(1)
+if anIsFound:
+ anID = aTableSO.GetID()
+ table = myVisu.CreateTable(anID)
+ # Set 'Contour' presentation type
+ table.SetContourPrs(1)
+ # Set number od contours
+ table.SetNbOfContours(1024)
+ # Set scale factor
+ table.SetScaleFactor(0.2)
+
+# Show the table presentation
+if (table is not None):
+ # Display just created tabel presentation
+ myViewManager = myVisu.GetViewManager()
+ myView = myViewManager.Create3DView()
+
+ myView.DisplayOnly(table)
+ myView.FitAll()
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+\endcode
+
+<br>Please, see \ref VISU.Table "Table interface reference documentation"
+for more details.
+
+*/
--- /dev/null
+/*!
+
+\page tui_table_curves_page Curves
+
+Create and display curves using the imported table:
+
+\code
+import os
+from time import sleep
+
+import salome
+
+import VISU
+import visu_gui
+
+# The directory containing data table files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import tables from file
+tableFile = os.path.join(datadir,"Tables","table_test.xls")
+myTablesSO = myVisu.ImportTables(tableFile, False)
+
+# Get the table
+anIsFound, myTableSO = myTablesSO.FindSubObject(1)
+anID = myTableSO.GetID()
+myTable = myVisu.CreateTable(anID)
+
+# Create a table view
+myViewManager = myVisu.GetViewManager()
+myTableView = myViewManager.CreateTableView(myTable)
+myTableView.SetTitle('My Curves')
+
+# Create a container for a set of curves
+myContainer = myVisu.CreateContainer()
+
+# Create curves
+aNbCurves = myTable.GetNbRows()
+aCurve = None
+for i in range(1, aNbCurves):
+ aCurve = myVisu.CreateCurve( myTable, 1, i )
+ myContainer.AddCurve(aCurve)
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+
+# Create a Plot 2D view
+myView = myViewManager.CreateXYPlot();
+myView.SetTitle("The viewer for My Curves")
+
+# Display all curves (i.e. container)
+myView.Display(myContainer)
+sleep(5)
+
+# Set the curves displaying mode
+myView.SetCurveType(VISU.XYPlot.SPLINE)
+# Set the marker size
+myView.SetMarkerSize(15)
+
+# Change the display parameters of the last created curve
+# Set the marker type
+aCurve.SetMarker(VISU.Curve.CIRCLE)
+# Set the line type and width
+aCurve.SetLine(VISU.Curve.SOLIDLINE, 4)
+
+# Display only the last created curve
+myView.DisplayOnly(aCurve)
+\endcode
+
+<br>Please, see \ref VISU.Curve "Curve interface reference documentation" and
+\ref VISU.XYPlot "XYPlot interface reference documentation" for more details.
+
+*/
--- /dev/null
+/*!
+
+\page tui_table_import_page Import/Export table
+
+Import tables from file:
+
+\code
+import os
+
+import salome
+
+import visu_gui
+
+# The directory containing data table files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import tables from file
+tableFile = os.path.join(datadir,"Tables","tables_test.xls")
+myTablesSO = myVisu.ImportTables(tableFile, False)
+
+# Print table names
+print "\nNames of the imported tables:"
+iter = salome.myStudy.NewChildIterator(myTablesSO)
+while iter.More():
+ aTableSO = iter.Value()
+ if aTableSO:
+ aTable = aTableSO.GetObject()
+ print "\n", aTable.GetTitle()
+ iter.Next()
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+\endcode
+
+<br>Export table to the file:
+
+\code
+import os
+
+import salome
+
+import visu_gui
+
+# The directory containing data table files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import tables from file
+tableFile = os.path.join(datadir,"Tables","tables_test.xls")
+myTablesSO = myVisu.ImportTables(tableFile, False)
+
+# Export the first imported table to a new file
+expTableFile = os.path.join(datadir,"Tables","sinus_table.txt")
+
+sinusTableSO = salome.myStudy.FindObject("sinus")
+myVisu.ExportTableToFile(sinusTableSO, expTableFile)
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+\endcode
+
+*/
--- /dev/null
+/*!
+
+\page tui_vectors_page Vectors
+
+Create Vectors on the field of the imported MED file:
+
+\code
+import os
+
+import salome
+
+import VISU
+import visu_gui
+
+# Directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Get VISU engine
+myVisu = visu_gui.myVisu
+
+# Import MED file
+medFile = os.path.join(datadir,"MedFiles","fra.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create vectors for the first timestamp of 'VITESSE' field
+meshName = 'LE VOLUME'
+fieldEntity = VISU.NODE
+fieldName = 'VITESSE'
+myVectors = myVisu.VectorsOnField(myResult, meshName, fieldEntity, fieldName, 1)
+
+# Set scale factor
+myVectors.SetScale(0.1)
+
+# Set magnitude coloring
+myVectors.ShowColored(True)
+
+# Set line width
+myVectors.SetLineWidth(2)
+
+# Set the type of representation of the vector head (arrow)
+myVectors.SetGlyphType(VISU.Vectors.ARROW)
+
+# Set the position of the vector head (center)
+myVectors.SetGlyphPos(VISU.Vectors.CENTER)
+
+# Update object browser
+salome.sg.updateObjBrowser(1)
+
+# Display just created vectors
+myViewManager = myVisu.GetViewManager()
+myView = myViewManager.Create3DView()
+
+myView.DisplayOnly(myVectors)
+myView.FitAll()
+\endcode
+
+<br>Please, see \ref VISU.Vectors "Vectors interface reference documentation"
+for more details.
+
+*/
\ No newline at end of file
--- /dev/null
+/*!
+
+\page tui_view_3d_page Viewing 3D presentations
+
+Examples of using 3D viewer functionaly from Python:
+
+\code
+import os
+from time import sleep
+
+import salome
+
+import VISU
+from visu_gui import *
+
+# Set the delay
+delay = 4
+
+# Set the directory containing MED files
+datadir = os.getenv("DATA_DIR")
+
+# Create a temporary 3D view
+print "Create a temporary 3D view..."
+myViewManager = myVisu.GetViewManager()
+myTempView = myViewManager.Create3DView()
+myTempView.SetTitle("The window will be soon destroyed!")
+sleep(delay)
+
+# Destroy the view
+print "Destroy the view..."
+myViewManager.Destroy(myTempView)
+sleep(delay)
+
+# Import a MED file
+medFile = os.path.join(datadir,"MedFiles","fra.med")
+myResult = myVisu.ImportFile(medFile)
+
+# Create a scalar map
+meshName = 'LE VOLUME'
+fieldEntity = VISU.NODE
+fieldName = 'VITESSE'
+timestampId = 1
+myScalarMap = myVisu.ScalarMapOnField(myResult, meshName, fieldEntity, fieldName, timestampId)
+
+# Create a new 3D view
+print "Create a new 3D view..."
+myView = myViewManager.Create3DView()
+
+# Set the background
+print "Set a blue background..."
+bgColor = SALOMEDS.Color(0.0, 0.3, 1.0)
+myView.SetBackground(bgColor)
+myView.Update()
+sleep(delay)
+
+# Display the newly created scalar map
+print "Display the scalar map..."
+myView.Display(myScalarMap)
+sleep(delay)
+
+# Fit all
+print "Fit all..."
+myView.FitAll()
+sleep(delay)
+
+# Set the point of sight of the camera
+print "Set the point of sight of the camera..."
+myView.SetFocalPoint([1,5,10])
+myView.Update()
+sleep(delay)
+
+# Fit all
+print "Fit all..."
+myView.FitAll()
+sleep(delay)
+
+# Change the scalar map range
+print "Change the scalar map range..."
+myScalarMap.SetRange(0.2, 0.9)
+sleep(delay)
+
+# Update the view
+print "Update the view..."
+myView.Update()
+sleep(delay)
+
+# Scale the view
+print "Scale the view..."
+myView.ScaleView(VISU.View3D.YAxis,10.0)
+myView.ScaleView(VISU.View3D.XAxis,3.0)
+myView.Update()
+sleep(delay)
+
+# Set the camera position in 3D space
+print "Set the the camera position in 3D space..."
+myView.SetPointOfView([0.01, 0.05, 0.03])
+myView.Update()
+sleep(delay)
+
+# Fit all
+print "Fit all..."
+myView.FitAll()
+sleep(delay)
+
+# Store view parameters
+stateName = "State1"
+myView.SaveViewParams(stateName)
+
+# Remove scale
+print "Remove scale..."
+myView.RemoveScale()
+sleep(delay)
+
+# Change the background
+print "Set a dark background..."
+bgColor = SALOMEDS.Color(0.0, 0.1, 0.2)
+myView.SetBackground(bgColor)
+sleep(delay)
+
+# Update the view
+print "Update the view..."
+myView.Update()
+sleep(delay)
+
+# Set the top view
+print "Set the top view..."
+myView.SetView(VISU.View3D.TOP)
+sleep(delay)
+
+# Zooming out
+print "Zooming out..."
+aScale = myView.GetParallelScale()
+for i in range(0,50) :
+ aScale = aScale + 0.05
+ myView.SetParallelScale(aScale)
+ myView.Update()
+
+sleep(delay)
+
+# Zooming in
+print "Zooming in..."
+for i in range(0,75) :
+ aScale = aScale - 0.05
+ myView.SetParallelScale(aScale)
+ myView.Update()
+
+sleep(delay)
+
+# Set the vertical line of the camera in 3D space
+print "Set the vertical line of the camera in 3D space..."
+aViewUp = myView.GetViewUp()
+for i in range(0,40) :
+ aViewUp[0] = aViewUp[0] + 0.1
+ myView.SetViewUp(aViewUp)
+ myView.Update()
+
+sleep(delay)
+
+# Rotating Y
+print "Rotating Y..."
+aPoint = myView.GetPointOfView()
+for i in range(0,150) :
+ aPoint[1] = aPoint[1] + 1
+ myView.SetPointOfView(aPoint)
+ myView.Update()
+
+sleep(delay)
+
+# Restore view parameters
+print "Restore view parameters..."
+myView.RestoreViewParams(stateName)
+sleep(delay)
+
+# Change presentation parameters:
+
+# Make the scalar map shrinked
+print "Make the scalar map shrinked..."
+myView.SetShrinked(myScalarMap, True)
+sleep(delay)
+
+# Set the presentation type
+print "Set the presentation type to SURFACEFRAME..."
+myView.SetPresentationType(myScalarMap, VISU.SURFACEFRAME)
+sleep(delay)
+
+print "Set the presentation type to FEATURE_EDGES..."
+myView.SetPresentationType(myScalarMap, VISU.FEATURE_EDGES)
+sleep(delay)
+
+# Update the object browser
+salome.sg.updateObjBrowser(1)
+\endcode
+
+<br>Please, see \ref VISU.View3D "View3D interface reference documentation"
+for more details.
+
+*/
+++ /dev/null
-/*!
-
-\page values_labeling_page Values labeling
-
-<br><h2>Displaying value labels</h2>
-
-In VISU you can display values applied to the cells or nodes of 3D presentation intended for visualization of calculation data.
-
-<em>To display labels for values:</em>
-<ol>
-<li>Display your presentation in 3d viewer</li>
-<li>Right-click on the presentation in the 3D viewer and from the associated pop-up menu choose <b>Values labeling</b>.</li>
-</ol>
-
-It will looks as follow:
-
-\image html values_labeling.png
-
-<br><h2>Parameters of values labeling</h2>
-
-You have ability to change parameters of values labeling such as font and color. Default parameters can be specified using "Preferences" dialog box. Also you can change parameters for each presentation.
-
-<em>To change parameters of the presentation:</em>
-<ol>
-<li>Display your presentation in 3d viewer</li>
-<li>Right-click on the presentation in the 3D viewer and from the associated pop-up menu choose <b>Labeling parameters</b>.</li>
-<li>Use "Parameters of values labeling" dialog box for the operation</li>
-</ol>
-
-It will looks as follows:
-
-\image html labeling_parameters.png
-
-*/
After you have finished with setting these parameters, click \b
OK. Your presentation with scalar bar will be immediately displayed in
-the viewer:
+the viewer.
+
+<br><b>See Also</b> a sample TUI Script of
+\ref tui_vectors_page "Vectors creation" operation.
*/
\page viewing_3d_presentations_page Viewing 3D presentations
-\n Each newly created presentation is displayed in the <b>VTK 3D
+Each newly created presentation is displayed in the <b>VTK 3D
Viewer</b>. <b>VTK 3D Viewer</b> is described in details in the
documentation on GUI module.
-\n To display an existing presentation, right-click on it in the
+
+To display an existing presentation, right-click on it in the
Object Browser and select \b Show.
\image html viewing3.png
visualization and NOT all properties can be set for a certain 3D
presentation.
-<ul>
-<li><b>Hide all</b> - allows to hide all objects from the
-viewer.</li>
-<li><b>Edit</b> - allows to return to the menu, where the presentation
-has been created and change its parameters.</li>
-<li><b>Filter by Scalars</b> - allows showing only the cells with
-values that fit into the defined <b>Scalar Range</b>.
-
-\image html viewing2.png
-
-In this menu, check in <b>Filter by scalar range</b> box and input
-the minimum and the maximum values for the <b>Scalar Range</b></li>
-
-\image html viewing4.png
-
-<li><b>Rename</b> - allows to rename the presentation.</li>
-<li><b>Copy</b> - allows to create a copy of the presentation in the
-same subfolder (time stamp) in the Object Browser.</li>
-
-<li><b>Hide</b> - allows to hide the selected presentation from the
-viewer.</li>
-<li>If selected in the Object Browser, <b>Hide</b> is replaced by
-<b>Show</b>, which allows to display the selected presentation in the
-viewer.</li>
-
-<li><b>Show Only</b> - allows to display only the selected
-presentation, hiding all other from the viewer.</li>
-<li><b>Representation</b> - allows to switch among the available
-representation types.
-
-\image html viewing10.png
-
-</ul>
+- <b>Hide all</b> - allows to hide all objects from the
+viewer.
-\image html viewing5.png "Points"
+- <b>Edit</b> - allows to return to the menu, where the presentation
+has been created and change its parameters.
-\image html viewing6.png "Surface"
+- \anchor filter_by_scalars_anchor <b>Filter by Scalars</b> - allows
+showing only the cells with values that fit into the defined
+<b>Scalar Range</b>.
-\image html viewing7.png "Wireframe"
+\image html viewing2.png
-\image html viewing8.png "Insideframe - displays the wires lying within the object"
+In the dialog box, check in <b>Filter by scalar range</b> box and input
+the minimum and the maximum values for the <b>Scalar Range</b>.
-\image html viewing9.png "Surfaceframe - displays wires and cells lying on the object surface"
+\image html viewing4.png
-\image html viewing11.png "Feature edges - shows the contour of the object"
+- \anchor rename_anchor <b>Rename</b> - allows to rename the presentation.
+- <b>Copy</b> - allows to create a copy of the presentation in the
+same subfolder (time stamp) in the Object Browser.
-\image html viewing12.png "Shrink"
+- <b>Values Labeling</b> allows to display values applied to the
+cells or nodes of a 3D presentation.
-<b>Shading on</b> - colors the object in a realistic
-way, revealing its geometry, for example, by applying shadows to the inside regions; used together with \b Surface.
+\image html values_labeling.png
-<b>Shading off</b> - colors the object basing only on scalar values. </li>
+\anchor labeling_parameters_anchor
-\anchor width_opacity_anchor
-<ul>
-<li>\b Properties</li>
+- <b>Labeling Parameters</b> allows to change such labeling parameters as font and color.
-\image html viewing13.png
-<ul>
-<li>\b Opacity - allows to set the value of opacity of the
-presentation between 0 (transparent) and 100 (opaque).</li>
-<li><b>Line Width</b> - allows to set the width of lines representing
-edges of the presentation between 1 (thin) and 100 (thick).</li>
-</ul>
-<li>\ref translate_presentation_page "Translate Presentation" - allows
-to translate the presentation along coordinate axes.</li>
-<li>\ref clipping_page "Clipping Planes" - allows to create
-cross-section views of presentations.</li>
-<li>\ref sweeping_page "Sweep" - allows to display pseudo-animation of
-the presentation.</li>
+\image html labeling_parameters.png
-<li><b>Dump view</b> - exports an object from the viewer in bmp, png,
-jpg or jpeg image format.</li>
-<li><b>Change Background</b> - allows to change the properties of the
-background.</li>
-<li><b>View Operations</b> checkbox - shows or hides the VTK viewer
+- <b>Hide</b> - allows to hide the selected presentation from the
+viewer.
+- If selected in the Object Browser, <b>Hide</b> is replaced by
+<b>Show</b>, which allows to display the selected presentation in the
+viewer.
+- <b>Show Only</b> - allows to display only the selected
+presentation, hiding all other from the viewer.
+
+- <b>Hide Scalar Bar</b>/<b>Show Scalar Bar</b> - allows to show/hide the scalar bar
+attached to the 3d presentation.
+
+- <b>Representation</b> - allows to switch among the available
+representation types.\n\n\image html viewing10.png
+ - <b>Points</b> \image html viewing5.png
+ - <b>Surface</b> \image html viewing6.png
+ - <b>Wireframe</b> \image html viewing7.png
+ - <b>Insideframe</b> - displays the wires lying within the object \image html viewing8.png
+ - <b>Surfaceframe</b> - displays wires and cells lying on the object surface \image html viewing9.png
+ - <b>Feature edges</b> - shows the contour of the object \image html viewing11.png
+ - <b>Shrink</b> \image html viewing12.png
+ - <b>Shading on</b> - colors the object in a realistic way,
+ revealing its geometry, for example, by applying shadows to the
+ inside regions; used together with \b Surface.
+ - <b>Shading off</b> - colors the object basing only on scalar values.
+
+- <b>2D Quadratic</b> - allows to choose how the quadratic elements
+are visualized: as straight lines or as arcs of circle.
+
+\image html quadratic.png
+
+- \b Properties
+ - \b Transparency - allows to set the value of transparency of the
+ presentation between 0 (opaque) and 100 (transparent).
+ \note For a \ref gauss_points_presentations_page "Gauss Points"
+ presentation, displayed using <b>Point Sprites</b> or <b>OpenGL
+ Points</b> \ref primitive_types_page "primitives", this property
+ only allows switching between transparent and opaque modes. The
+ textures are drawn in the opaque mode if the transparency is equal to
+ 0% and in the transparent mode if the transparency is > 0%
+ (note that they become invisible when the transparency is equal to
+ 100%).\n\n \image html viewing13.png
+ - <b>Line Width</b> - allows to set the width of lines representing
+ edges of the presentation between 1 (thin) and 100 (thick).\n\n
+ \image html line_width.png
+ - <b>Shrink Factor</b> - allows to set the shrink factor of the
+ presentation to be used in \b Shrink mode. Possible values range
+ between 20 and 100, the default value is 80.\n\n \image html
+ shrink_factor.png
+ - <b>Edge Color</b> - allows to set the color of lines representing
+ the edges of the presentation displayed in SurfaceFrame mode.
+ - \ref point_marker_page "Point Marker" - allows to change the
+ representation of points.
+
+- \ref translate_presentation_page "Translate Presentation" - allows
+to translate the presentation along coordinate axes.
+- \ref clipping_page "Clipping Planes" - allows to create
+cross-section views of presentations.
+- \ref sweeping_page "Sweep" - allows to display pseudo-animation of
+the presentation.
+
+- <b>Dump view</b> - exports an object from the viewer in bmp, png,
+jpg or jpeg image format.
+- <b>Change Background</b> - allows to change the properties of the
+background.
+
+- <b>View Operations</b> checkbox - shows or hides the VTK viewer
toolbar. The information about the VTK viewer functionalities is
-available in the documentation on the GUI module.</li>
-<li><b>Recording operations</b> checkbox - shows or hides buttons used
-for \ref recording_page "Recording" </li>
+available in the documentation on the GUI module.
+- <b>Recording operations</b> checkbox - shows or hides buttons used
+for \ref recording_page "Recording".
-<li>The following menu items are added when the presentation is
-selected in the Object Browser</li>.
-<ul>
-<li> \b Delete - removes the presentation from the study.</li>
-<li> \b Refresh - updates the presentation in the VTK viewer </li>
-<li> \b Find - activates <b> Find Tool</b> described in the documentation
-on GUI module. </li>
+The following menu items are added when the presentation is
+selected in the Object Browser.
-</ul>
-</ul>
+- \b Delete - removes the presentation from the study.
+- \b Refresh - updates the presentation in the VTK viewer.
+- \b Find - activates <b> Find Tool</b> described in the documentation
+ on GUI module.
When you create several presentations of the same object, you may wish
to see them simultaneously, which might be impossible, because they
In \b Manual mode you set the coordinates for each presentation
separately.
-<br>
Displaying several presentations at the same time may cause
superposition of their scalar bars. To avoid this, check <b>Arrange
Scalar Bars</b> radio button in the <b>Preferences -> Post-Pro ->
Scalar Bar</b>. A separate scalar bar will be displayed for each
presentation.
-\n Alternatively you may wish to merge the scalar bars to have a
+
+Alternatively you may wish to merge the scalar bars to have a
common scalar bar for all presentations. To do this, select several
presentations or fields in the object browser, right-click and from
the pop-up menu select <b>Merge Scalar Range</b>.
-\n To restore separate bars and scales for each module select <b>Use
+
+To restore separate bars and scales for each module select <b>Use
Field Range</b> from the same menu.
+<br><b>See Also</b> sample scripts of
+\ref tui_view_3d_page "Viewing 3D presentations" via TUI.
+
*/
-H1 {
- text-align: center;
+/* The standard CSS for doxygen */
+
+body, table, div, p, dl {
+ font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
+ font-size: 12px;
+}
+
+/* @group Heading Levels */
+
+h1 {
+ font-size: 150%;
+}
+
+h2 {
+ font-size: 120%;
+}
+
+h3 {
+ font-size: 100%;
+}
+
+dt {
+ font-weight: bold;
+}
+
+div.multicol {
+ -moz-column-gap: 1em;
+ -webkit-column-gap: 1em;
+ -moz-column-count: 3;
+ -webkit-column-count: 3;
+}
+
+p.startli, p.startdd, p.starttd {
+ margin-top: 2px;
+}
+
+p.endli {
+ margin-bottom: 0px;
+}
+
+p.enddd {
+ margin-bottom: 4px;
+}
+
+p.endtd {
+ margin-bottom: 2px;
+}
+
+/* @end */
+
+caption {
+ font-weight: bold;
+}
+
+span.legend {
+ font-size: 70%;
+ text-align: center;
+}
+
+h3.version {
+ font-size: 90%;
+ text-align: center;
+}
+
+div.qindex, div.navtab{
+ background-color: #EBEFF6;
+ border: 1px solid #A3B4D7;
+ text-align: center;
+ margin: 2px;
+ padding: 2px;
+}
+
+div.qindex, div.navpath {
+ width: 100%;
+ line-height: 140%;
+}
+
+div.navtab {
+ margin-right: 15px;
+}
+
+/* @group Link Styling */
+
+a {
+ color: #3D578C;
+ font-weight: normal;
+ text-decoration: none;
+}
+
+.contents a:visited {
+ color: #4665A2;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+a.qindex {
+ font-weight: bold;
+}
+
+a.qindexHL {
+ font-weight: bold;
+ background-color: #9CAFD4;
+ color: #ffffff;
+ border: 1px double #869DCA;
+}
+
+.contents a.qindexHL:visited {
+ color: #ffffff;
+}
+
+a.el {
+ font-weight: bold;
+}
+
+a.elRef {
+}
+
+a.code {
+ color: #4665A2;
+}
+
+a.codeRef {
+ color: #4665A2;
+}
+
+/* @end */
+
+dl.el {
+ margin-left: -1cm;
+}
+
+.fragment {
+ font-family: monospace, fixed;
+ font-size: 105%;
+}
+
+pre.fragment {
+ border: 1px solid #C4CFE5;
+ background-color: #FBFCFD;
+ padding: 4px 6px;
+ margin: 4px 8px 4px 2px;
+ overflow: auto;
+ word-wrap: break-word;
+ font-size: 9pt;
+ line-height: 125%;
+}
+
+div.ah {
+ background-color: black;
+ font-weight: bold;
+ color: #ffffff;
+ margin-bottom: 3px;
+ margin-top: 3px;
+ padding: 0.2em;
+ border: solid thin #333;
+ border-radius: 0.5em;
+ -webkit-border-radius: .5em;
+ -moz-border-radius: .5em;
+ box-shadow: 2px 2px 3px #999;
+ -webkit-box-shadow: 2px 2px 3px #999;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
+ background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
+}
+
+div.groupHeader {
+ margin-left: 16px;
+ margin-top: 12px;
+ font-weight: bold;
+}
+
+div.version {
+ border:1px solid #0000FF;
+ color: #CCCCCC;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 9pt;
+ text-align: center;
+ width:100px;
+ -moz-border-radius: 8px;
+ margin: 5px;
+}
+
+div.footer1 {
+ background-color: #DFE5F1;
+ border: 1px solid #AAAAAA;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ padding: 10px;
+ margin-top: 15px;
+}
+
+
+div.groupText {
+ margin-left: 16px;
+ font-style: italic;
+}
+
+body {
+ background: white;
+ color: black;
+ margin: 0;
+}
+
+div.contents {
+ margin-top: 10px;
+ margin-left: 10px;
+ margin-right: 10px;
+}
+
+td.indexkey {
+ background-color: #EBEFF6;
+ font-weight: bold;
+ border: 1px solid #C4CFE5;
+ margin: 2px 0px 2px 0;
+ padding: 2px 10px;
+}
+
+td.indexvalue {
+ background-color: #EBEFF6;
+ border: 1px solid #C4CFE5;
+ padding: 2px 10px;
+ margin: 2px 0px;
+}
+
+tr.memlist {
+ background-color: #EEF1F7;
+}
+
+p.formulaDsp {
+ text-align: center;
+}
+
+img.formulaDsp {
+
+}
+
+img.formulaInl {
+ vertical-align: middle;
+}
+
+div.center {
+ text-align: center;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ padding: 0px;
+}
+
+div.center img {
+ border: 0px;
+}
+
+address.footer {
+ text-align: right;
+ padding-right: 12px;
+}
+
+img.footer {
+ border: 0px;
+ vertical-align: middle;
+}
+
+/* @group Code Colorization */
+
+span.keyword {
+ color: #008000
+}
+
+span.keywordtype {
+ color: #604020
+}
+
+span.keywordflow {
+ color: #e08000
+}
+
+span.comment {
+ color: #800000
+}
+
+span.preprocessor {
+ color: #806020
+}
+
+span.stringliteral {
+ color: #002080
+}
+
+span.charliteral {
+ color: #008080
+}
+
+span.vhdldigit {
+ color: #ff00ff
+}
+
+span.vhdlchar {
+ color: #000000
+}
+
+span.vhdlkeyword {
+ color: #700070
+}
+
+span.vhdllogic {
+ color: #ff0000
+}
+
+/* @end */
+
+/*
+.search {
+ color: #003399;
+ font-weight: bold;
+}
+
+form.search {
+ margin-bottom: 0px;
+ margin-top: 0px;
+}
+
+input.search {
+ font-size: 75%;
+ color: #000080;
+ font-weight: normal;
+ background-color: #e8eef2;
+}
+*/
+
+td.tiny {
+ font-size: 75%;
+}
+
+.dirtab {
+ padding: 4px;
+ border-collapse: collapse;
+ border: 1px solid #A3B4D7;
+}
+
+th.dirtab {
+ background: #EBEFF6;
+ font-weight: bold;
+}
+
+hr {
+ height: 0px;
+ border: none;
+ border-top: 1px solid #4A6AAA;
+}
+
+hr.footer {
+ height: 1px;
+}
+
+/* @group Member Descriptions */
+
+table.memberdecls {
+ border-spacing: 0px;
+ padding: 0px;
+}
+
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+ background-color: #F9FAFC;
+ border: none;
+ margin: 4px;
+ padding: 1px 0 0 8px;
+}
+
+.mdescLeft, .mdescRight {
+ padding: 0px 8px 4px 8px;
+ color: #555;
+}
+
+.memItemLeft, .memItemRight, .memTemplParams {
+ border-top: 1px solid #C4CFE5;
+}
+
+.memItemLeft, .memTemplItemLeft {
+ white-space: nowrap;
+}
+
+.memTemplParams {
+ color: #4665A2;
+ white-space: nowrap;
+}
+
+/* @end */
+
+/* @group Member Details */
+
+/* Styles for detailed member documentation */
+
+.memtemplate {
+ font-size: 80%;
+ color: #4665A2;
+ font-weight: normal;
+ margin-left: 9px;
+}
+
+.memnav {
+ background-color: #EBEFF6;
+ border: 1px solid #A3B4D7;
+ text-align: center;
+ margin: 2px;
+ margin-right: 15px;
+ padding: 2px;
+}
+
+.memitem {
+ padding: 0;
+ margin-bottom: 10px;
+}
+
+.memname {
+ white-space: nowrap;
+ font-weight: bold;
+ margin-left: 6px;
+}
+
+.memproto {
+ border-top: 1px solid #A8B8D9;
+ border-left: 1px solid #A8B8D9;
+ border-right: 1px solid #A8B8D9;
+ padding: 6px 0px 6px 0px;
+ color: #253555;
+ font-weight: bold;
+ text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+ /* opera specific markup */
+ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ border-top-right-radius: 8px;
+ border-top-left-radius: 8px;
+ /* firefox specific markup */
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+ -moz-border-radius-topright: 8px;
+ -moz-border-radius-topleft: 8px;
+ /* webkit specific markup */
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -webkit-border-top-right-radius: 8px;
+ -webkit-border-top-left-radius: 8px;
+ background-image:url('nav_f.png');
+ background-repeat:repeat-x;
+ background-color: #E2E8F2;
+
+}
+
+.memdoc {
+ border-bottom: 1px solid #A8B8D9;
+ border-left: 1px solid #A8B8D9;
+ border-right: 1px solid #A8B8D9;
+ padding: 2px 5px;
+ background-color: #FBFCFD;
+ border-top-width: 0;
+ /* opera specific markup */
+ border-bottom-left-radius: 8px;
+ border-bottom-right-radius: 8px;
+ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ /* firefox specific markup */
+ -moz-border-radius-bottomleft: 8px;
+ -moz-border-radius-bottomright: 8px;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+ background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7);
+ /* webkit specific markup */
+ -webkit-border-bottom-left-radius: 8px;
+ -webkit-border-bottom-right-radius: 8px;
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7));
+}
+
+.paramkey {
+ text-align: right;
+}
+
+.paramtype {
+ white-space: nowrap;
}
-CAPTION {
- font-weight: bold
+.paramname {
+ color: #602020;
+ white-space: nowrap;
}
+.paramname em {
+ font-style: normal;
+}
+
+.params, .retval, .exception, .tparams {
+ border-spacing: 6px 2px;
+}
+
+.params .paramname, .retval .paramname {
+ font-weight: bold;
+ vertical-align: top;
+}
+
+.params .paramtype {
+ font-style: italic;
+ vertical-align: top;
+}
+
+.params .paramdir {
+ font-family: "courier new",courier,monospace;
+ vertical-align: top;
+}
+
+
+
-/* Link in the top navbar */
-A.qindex {}
+/* @end */
-A.qindexRef {}
+/* @group Directory (tree) */
-/* Link to any cross-referenced Doxygen element */
-A.el {
- text-decoration: none;
- font-weight: bold
+/* for the tree view */
+
+.ftvtree {
+ font-family: sans-serif;
+ margin: 0px;
+}
+
+/* these are for tree view when used as main index */
+
+.directory {
+ font-size: 9pt;
+ font-weight: bold;
+ margin: 5px;
}
-A.elRef {
- font-weight: bold
+.directory h3 {
+ margin: 0px;
+ margin-top: 1em;
+ font-size: 11pt;
}
-/* Link to any cross-referenced Doxygen element inside a code section
- (ex: header)
+/*
+The following two styles can be used to replace the root node title
+with an image of your choice. Simply uncomment the next two styles,
+specify the name of your image and be sure to set 'height' to the
+proper pixel height of your image.
+*/
+
+/*
+.directory h3.swap {
+ height: 61px;
+ background-repeat: no-repeat;
+ background-image: url("yourimage.gif");
+}
+.directory h3.swap span {
+ display: none;
+}
*/
-A.code {
- text-decoration: none;
- font-weight: normal;
- color: #4444ee
+
+.directory > h3 {
+ margin-top: 0;
+}
+
+.directory p {
+ margin: 0px;
+ white-space: nowrap;
+}
+
+.directory div {
+ display: none;
+ margin: 0px;
+}
+
+.directory img {
+ vertical-align: -30%;
+}
+
+/* these are for tree view when not used as main index */
+
+.directory-alt {
+ font-size: 100%;
+ font-weight: bold;
+}
+
+.directory-alt h3 {
+ margin: 0px;
+ margin-top: 1em;
+ font-size: 11pt;
+}
+
+.directory-alt > h3 {
+ margin-top: 0;
+}
+
+.directory-alt p {
+ margin: 0px;
+ white-space: nowrap;
+}
+
+.directory-alt div {
+ display: none;
+ margin: 0px;
+}
+
+.directory-alt img {
+ vertical-align: -30%;
+}
+
+/* @end */
+
+div.dynheader {
+ margin-top: 8px;
+}
+
+address {
+ font-style: normal;
+ color: #2A3D61;
+}
+
+table.doxtable {
+ border-collapse:collapse;
+}
+
+table.doxtable td, table.doxtable th {
+ border: 1px solid #2D4068;
+ padding: 3px 7px 2px;
+}
+
+table.doxtable th {
+ background-color: #374F7F;
+ color: #FFFFFF;
+ font-size: 110%;
+ padding-bottom: 4px;
+ padding-top: 5px;
+ text-align:left;
+}
+
+.tabsearch {
+ top: 0px;
+ left: 10px;
+ height: 36px;
+ background-image: url('tab_b.png');
+ z-index: 101;
+ overflow: hidden;
+ font-size: 13px;
+}
+
+.navpath ul
+{
+ font-size: 11px;
+ background-image:url('tab_b.png');
+ background-repeat:repeat-x;
+ height:30px;
+ line-height:30px;
+ color:#8AA0CC;
+ border:solid 1px #C2CDE4;
+ overflow:hidden;
+ margin:0px;
+ padding:0px;
+}
+
+.navpath li
+{
+ list-style-type:none;
+ float:left;
+ padding-left:10px;
+ padding-right:15px;
+ background-image:url('bc_s.png');
+ background-repeat:no-repeat;
+ background-position:right;
+ color:#364D7C;
+}
+
+.navpath li.navelem a
+{
+ height:32px;
+ display:block;
+ text-decoration: none;
+ outline: none;
+}
+
+.navpath li.navelem a:hover
+{
+ color:#6884BD;
+}
+
+.navpath li.footer
+{
+ list-style-type:none;
+ float:right;
+ padding-left:10px;
+ padding-right:15px;
+ background-image:none;
+ background-repeat:no-repeat;
+ background-position:right;
+ color:#364D7C;
+ font-size: 8pt;
+}
+
+
+div.summary
+{
+ float: right;
+ font-size: 8pt;
+ padding-right: 5px;
+ width: 50%;
+ text-align: right;
+}
+
+div.summary a
+{
+ white-space: nowrap;
+}
+
+div.ingroups
+{
+ font-size: 8pt;
+ padding-left: 5px;
+ width: 50%;
+ text-align: left;
+}
+
+div.ingroups a
+{
+ white-space: nowrap;
+}
+
+div.header
+{
+ background-image:url('nav_h.png');
+ background-repeat:repeat-x;
+ background-color: #F9FAFC;
+ margin: 0px;
+ border-bottom: 1px solid #C4CFE5;
+}
+
+div.headertitle
+{
+ padding: 5px 5px 5px 10px;
+}
+
+.title {
+ font-size: 150%;
+ font-weight: bold;
+ margin: 10px 2px;
+}
+
+dl
+{
+ padding: 0 0 0 10px;
+}
+
+dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug
+{
+ border-left:4px solid;
+ padding: 0 0 0 6px;
+}
+
+dl.note
+{
+ border-color: #D0D000;
+}
+
+dl.warning, dl.attention
+{
+ border-color: #FF0000;
+}
+
+dl.pre, dl.post, dl.invariant
+{
+ border-color: #00D000;
+}
+
+dl.deprecated
+{
+ border-color: #505050;
}
-A.codeRef {
- font-weight: normal;
- color: #4444ee
+dl.todo
+{
+ border-color: #00C0E0;
}
-A:hover {
- text-decoration: none;
- background-color: lightblue
+dl.test
+{
+ border-color: #3030E0;
}
-DL.el {
- margin-left: -1cm
+dl.bug
+{
+ border-color: #C08050;
}
-/* A code fragment (ex: header) */
-DIV.fragment {
- width: 100%;
- border: none;
- background-color: #CCCCCC
+#projectlogo
+{
+ text-align: center;
+ vertical-align: bottom;
+ border-collapse: separate;
+}
+
+#projectlogo img
+{
+ border: 0px none;
+}
+
+#projectname
+{
+ background-color: #175783;
+ border: 1px solid;
+ height: 80px;
+ background-repeat: no-repeat;
+/* font: 300% arial,sans-serif;*/
+ margin: 0px;
+ padding: 0px;
+}
+
+#projectbrief
+{
+ font: 120% arial,sans-serif;
+ margin: 0px;
+ padding: 0px;
}
-/* In the alpha list (coumpound index), style of an alphabetical index letter */
-DIV.ah {
- background-color: #CCCCCC;
- font-weight: bold;
- color: #ffffff;
- margin-bottom: 3px;
- margin-top: 3px
+#projectnumber
+{
+ font: 50% arial,sans-serif;
+ margin: 0px;
+ padding: 0px;
}
-/* Method name (+ type) */
-TD.md {
- background-color: lightblue;
- font-weight: bold;
+#titlearea
+{
+ background: url("head.png");
+ background-color: #175783;
+ border: 1px solid;
+ height: 80px;
+ background-repeat: no-repeat;
+ padding: 0px;
+ margin: 0px;
+ width: 100%;
+ border-bottom: 1px solid #5373B4;
}
-/* Method parameter (some of them) */
-TD.mdname1 {
- background-color: lightblue;
- font-weight: bold; color: #602020;
-}
-
-/* Method parameter (some of them) */
-TD.mdname {
- background-color: lightblue;
- font-weight: bold;
- color: #602020;
- width: 600px;
-}
-
-/* Separator between methods group (usually empty, seems not supported by IE) */
-DIV.groupHeader {
- margin-left: 16px;
- margin-top: 12px;
- margin-bottom: 6px;
- font-weight: bold
-}
-
-DIV.groupText {
- margin-left: 16px;
- font-style: italic;
- font-size: smaller
-}
-
-BODY {
- background: #FFFFFF;
-}
-
-/*div.div-page {
- background-color: #FFFFFF;
- margin-left: 1em;
- margin-right: 1em;
- margin-top: 1em;
- margin-bottom: 0.1em;
-
- padding-left: 1em;
- padding-right: 1em;
- padding-top: 0.5em;
- padding-bottom: 0.5em;
-
- border: 2px solid #0D299A;
- border-width: 2px;
- border-color: #0D299A;
-}*/
-
-div.tabs {
- text-align: justify;
- margin-left : 2px;
- margin-right : 2px;
- margin-top : 2px;
- margin-bottom : 2px
- font-weight: bold;
- color: #FFFFFF;
-}
-
-DIV.div-footer {
- margin-left: 1em;
- margin-right: 1em;
- margin-bottom: 0.2em;
- text-align: right;
- font-size: 9pt;
-}
-
-/* In File List, Coumpound List, etc, 1st column of the index */
-TD.indexkey {
- background-color: #CCCCCC;
- font-weight: bold;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px
-}
-
-/* In File List, Coumpound List, etc, 2nd column of the index */
-TD.indexvalue {
- background-color: #CCCCCC;
- font-style: italic;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px
-}
-
-span.keyword { color: #008000 }
-span.keywordtype { color: #604020 }
-span.keywordflow { color: #e08000 }
-span.comment { color: #800000 }
-span.preprocessor { color: #806020 }
-span.stringliteral { color: #002080 }
-span.charliteral { color: #008080 }
- <hr style="width: 100%; height: 2px;">
- <div style="text-align: center;">
- Copyright © 2003-2009 CEA, EDF
- <br>
- </div>
+ <li class="footer"></li>
+ </ul>
+ </div>
+ <div class="footer1">
+ <div style="text-align: center;">
+ Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE<br>
+ Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS<br>
+ </div>
+ </div>
</body>
</html>
+
\ No newline at end of file
+++ /dev/null
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>$title</title>
- <link href="doxygen.css" rel="stylesheet" type="text/css">
-</head>
-<hr>
-<center>
-SALOME documentation central
-</center>
-<hr>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<title>$title</title>
+<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
+$treeview
+$search
+$mathjax
+<script type="text/javascript">
+$(document).ready(initResizable);
+</script>
+<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body onload='searchBox.OnSelectItem(0);'>
+<div id="top"><!-- do not remove this div! -->
+<div id="titlearea"><div align="right"><div class="version">Version: @VERSION@</div></div></div>
+
+</div>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<title>$title</title>
+<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
+$treeview
+$search
+$mathjax
+<script type="text/javascript">
+$(document).ready(initResizable);
+</script>
+<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body onload='searchBox.OnSelectItem(0);'>
+<div id="top"><!-- do not remove this div! -->
+<div id="titlearea"><div align="right"><div class="version">Version: @VERSION@</div></div></div>
+<div align="bottom-left"><a href=../index.html>Home</a></div>
+
+</div>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vasily Rusyaev (Open Cascade NN)
# Module : doc
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-EXTRA_DIST += images static
+EXTRA_DIST += images static/doxygen.css static/footer.html
+
+tuidocdir = $(docdir)/tui/VISU
+tuidoc_DATA = images/head.png images/visuscreen.png
+
dev_docs: doxyfile
echo "Running doxygen in directory: "`pwd`; \
fi;
uninstall-local:
- rm -rf $(DESTDIR)$(docdir)/tui/VISU
+ @test -d $(DESTDIR)$(tuidocdir) && chmod -R +w $(DESTDIR)$(tuidocdir) ; \
+ for filen in `find $(DESTDIR)$(tuidocdir) -mindepth 1 -maxdepth 1` dummy ; do \
+ case $${filen} in \
+ dummy ) ;; \
+ $(DESTDIR)$(tuidocdir)/docutils ) ;; \
+ $(DESTDIR)$(tuidocdir)/head.png ) ;; \
+ $(DESTDIR)$(tuidocdir)/visuscreen.png ) ;; \
+ * ) echo "removing $${filen}" && rm -rf $${filen} ;; \
+ esac ; \
+ done
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-# Doxyfile 1.4.6
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "Post-Pro Module Programming Guide v.@VERSION@"
+PROJECT_NAME = "SALOME Post-Pro Developer"
PROJECT_NUMBER =
OUTPUT_DIRECTORY = VISU
CREATE_SUBDIRS = NO
INPUT = @top_srcdir@/src \
@top_srcdir@/bin \
@top_srcdir@/idl \
- @top_builddir@/bin
-FILE_PATTERNS = *.idl *.hxx *.cxx *.h *.c *.hh *.cc @DOXYGEN_PYTHON_EXTENSION@
+ @top_builddir@/bin \
+ @srcdir@/input
+FILE_PATTERNS = *.idl *.hxx *.cxx *.h *.c *.hh *.cc @DOXYGEN_PYTHON_EXTENSION@ *.doc
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
GENERATE_HTML = YES
HTML_OUTPUT = .
HTML_FILE_EXTENSION = .html
-HTML_HEADER = @srcdir@/static/myheader.html
+HTML_HEADER = @builddir@/static/header.html
HTML_FOOTER = @srcdir@/static/footer.html
HTML_STYLESHEET = @srcdir@/static/doxygen.css
HTML_ALIGN_MEMBERS = YES
CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
-DOT_IMAGE_FORMAT = jpg
+DOT_IMAGE_FORMAT = png
+DOT_FONTNAME = Arial
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
--- /dev/null
+/*! \mainpage
+
+\image html visuscreen.png
+
+To browse the \b SALOME Post-Pro module Developer Documentation, follow the links below or use navigation menu at the top of the page:
+<ul>
+<li> <a href="namespaces.html">Packages</a> - list of TUI packages and scripts.</li>
+<li> <a href="annotated.html">Data Structures</a> - list of all data structures and classes with brief descriptions.</li>
+<li> <a href="files.html">Files</a> - list of all files with brief descriptions.</li>
+</ul>
+
+*/
\ No newline at end of file
-H1 {
- text-align: center;
+/* The standard CSS for doxygen */
+
+body, table, div, p, dl {
+ font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
+ font-size: 12px;
+}
+
+/* @group Heading Levels */
+
+h1 {
+ font-size: 150%;
+}
+
+h2 {
+ font-size: 120%;
+}
+
+h3 {
+ font-size: 100%;
+}
+
+dt {
+ font-weight: bold;
+}
+
+div.multicol {
+ -moz-column-gap: 1em;
+ -webkit-column-gap: 1em;
+ -moz-column-count: 3;
+ -webkit-column-count: 3;
+}
+
+p.startli, p.startdd, p.starttd {
+ margin-top: 2px;
+}
+
+p.endli {
+ margin-bottom: 0px;
+}
+
+p.enddd {
+ margin-bottom: 4px;
+}
+
+p.endtd {
+ margin-bottom: 2px;
+}
+
+/* @end */
+
+caption {
+ font-weight: bold;
+}
+
+span.legend {
+ font-size: 70%;
+ text-align: center;
+}
+
+h3.version {
+ font-size: 90%;
+ text-align: center;
+}
+
+div.qindex, div.navtab{
+ background-color: #EBEFF6;
+ border: 1px solid #A3B4D7;
+ text-align: center;
+ margin: 2px;
+ padding: 2px;
+}
+
+div.qindex, div.navpath {
+ width: 100%;
+ line-height: 140%;
+}
+
+div.navtab {
+ margin-right: 15px;
+}
+
+/* @group Link Styling */
+
+a {
+ color: #3D578C;
+ font-weight: normal;
+ text-decoration: none;
+}
+
+.contents a:visited {
+ color: #4665A2;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+a.qindex {
+ font-weight: bold;
+}
+
+a.qindexHL {
+ font-weight: bold;
+ background-color: #9CAFD4;
+ color: #ffffff;
+ border: 1px double #869DCA;
+}
+
+.contents a.qindexHL:visited {
+ color: #ffffff;
+}
+
+a.el {
+ font-weight: bold;
+}
+
+a.elRef {
+}
+
+a.code {
+ color: #4665A2;
+}
+
+a.codeRef {
+ color: #4665A2;
+}
+
+/* @end */
+
+dl.el {
+ margin-left: -1cm;
+}
+
+.fragment {
+ font-family: monospace, fixed;
+ font-size: 105%;
+}
+
+pre.fragment {
+ border: 1px solid #C4CFE5;
+ background-color: #FBFCFD;
+ padding: 4px 6px;
+ margin: 4px 8px 4px 2px;
+ overflow: auto;
+ word-wrap: break-word;
+ font-size: 9pt;
+ line-height: 125%;
+}
+
+div.ah {
+ background-color: black;
+ font-weight: bold;
+ color: #ffffff;
+ margin-bottom: 3px;
+ margin-top: 3px;
+ padding: 0.2em;
+ border: solid thin #333;
+ border-radius: 0.5em;
+ -webkit-border-radius: .5em;
+ -moz-border-radius: .5em;
+ box-shadow: 2px 2px 3px #999;
+ -webkit-box-shadow: 2px 2px 3px #999;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
+ background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
+}
+
+div.groupHeader {
+ margin-left: 16px;
+ margin-top: 12px;
+ font-weight: bold;
+}
+
+div.version {
+ border:1px solid #0000FF;
+ color: #CCCCCC;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 9pt;
+ text-align: center;
+ width:100px;
+ -moz-border-radius: 8px;
+ margin: 5px;
+}
+
+div.footer1 {
+ background-color: #DFE5F1;
+ border: 1px solid #AAAAAA;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ padding: 10px;
+ margin-top: 15px;
+}
+
+
+div.groupText {
+ margin-left: 16px;
+ font-style: italic;
+}
+
+body {
+ background: white;
+ color: black;
+ margin: 0;
+}
+
+div.contents {
+ margin-top: 10px;
+ margin-left: 10px;
+ margin-right: 10px;
+}
+
+td.indexkey {
+ background-color: #EBEFF6;
+ font-weight: bold;
+ border: 1px solid #C4CFE5;
+ margin: 2px 0px 2px 0;
+ padding: 2px 10px;
+}
+
+td.indexvalue {
+ background-color: #EBEFF6;
+ border: 1px solid #C4CFE5;
+ padding: 2px 10px;
+ margin: 2px 0px;
+}
+
+tr.memlist {
+ background-color: #EEF1F7;
+}
+
+p.formulaDsp {
+ text-align: center;
+}
+
+img.formulaDsp {
+
+}
+
+img.formulaInl {
+ vertical-align: middle;
+}
+
+div.center {
+ text-align: center;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ padding: 0px;
+}
+
+div.center img {
+ border: 0px;
+}
+
+address.footer {
+ text-align: right;
+ padding-right: 12px;
+}
+
+img.footer {
+ border: 0px;
+ vertical-align: middle;
+}
+
+/* @group Code Colorization */
+
+span.keyword {
+ color: #008000
+}
+
+span.keywordtype {
+ color: #604020
+}
+
+span.keywordflow {
+ color: #e08000
+}
+
+span.comment {
+ color: #800000
+}
+
+span.preprocessor {
+ color: #806020
+}
+
+span.stringliteral {
+ color: #002080
+}
+
+span.charliteral {
+ color: #008080
+}
+
+span.vhdldigit {
+ color: #ff00ff
+}
+
+span.vhdlchar {
+ color: #000000
+}
+
+span.vhdlkeyword {
+ color: #700070
+}
+
+span.vhdllogic {
+ color: #ff0000
+}
+
+/* @end */
+
+/*
+.search {
+ color: #003399;
+ font-weight: bold;
+}
+
+form.search {
+ margin-bottom: 0px;
+ margin-top: 0px;
+}
+
+input.search {
+ font-size: 75%;
+ color: #000080;
+ font-weight: normal;
+ background-color: #e8eef2;
+}
+*/
+
+td.tiny {
+ font-size: 75%;
+}
+
+.dirtab {
+ padding: 4px;
+ border-collapse: collapse;
+ border: 1px solid #A3B4D7;
+}
+
+th.dirtab {
+ background: #EBEFF6;
+ font-weight: bold;
+}
+
+hr {
+ height: 0px;
+ border: none;
+ border-top: 1px solid #4A6AAA;
+}
+
+hr.footer {
+ height: 1px;
+}
+
+/* @group Member Descriptions */
+
+table.memberdecls {
+ border-spacing: 0px;
+ padding: 0px;
+}
+
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+ background-color: #F9FAFC;
+ border: none;
+ margin: 4px;
+ padding: 1px 0 0 8px;
+}
+
+.mdescLeft, .mdescRight {
+ padding: 0px 8px 4px 8px;
+ color: #555;
+}
+
+.memItemLeft, .memItemRight, .memTemplParams {
+ border-top: 1px solid #C4CFE5;
+}
+
+.memItemLeft, .memTemplItemLeft {
+ white-space: nowrap;
+}
+
+.memTemplParams {
+ color: #4665A2;
+ white-space: nowrap;
+}
+
+/* @end */
+
+/* @group Member Details */
+
+/* Styles for detailed member documentation */
+
+.memtemplate {
+ font-size: 80%;
+ color: #4665A2;
+ font-weight: normal;
+ margin-left: 9px;
+}
+
+.memnav {
+ background-color: #EBEFF6;
+ border: 1px solid #A3B4D7;
+ text-align: center;
+ margin: 2px;
+ margin-right: 15px;
+ padding: 2px;
+}
+
+.memitem {
+ padding: 0;
+ margin-bottom: 10px;
+}
+
+.memname {
+ white-space: nowrap;
+ font-weight: bold;
+ margin-left: 6px;
+}
+
+.memproto {
+ border-top: 1px solid #A8B8D9;
+ border-left: 1px solid #A8B8D9;
+ border-right: 1px solid #A8B8D9;
+ padding: 6px 0px 6px 0px;
+ color: #253555;
+ font-weight: bold;
+ text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+ /* opera specific markup */
+ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ border-top-right-radius: 8px;
+ border-top-left-radius: 8px;
+ /* firefox specific markup */
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+ -moz-border-radius-topright: 8px;
+ -moz-border-radius-topleft: 8px;
+ /* webkit specific markup */
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -webkit-border-top-right-radius: 8px;
+ -webkit-border-top-left-radius: 8px;
+ background-image:url('nav_f.png');
+ background-repeat:repeat-x;
+ background-color: #E2E8F2;
+
+}
+
+.memdoc {
+ border-bottom: 1px solid #A8B8D9;
+ border-left: 1px solid #A8B8D9;
+ border-right: 1px solid #A8B8D9;
+ padding: 2px 5px;
+ background-color: #FBFCFD;
+ border-top-width: 0;
+ /* opera specific markup */
+ border-bottom-left-radius: 8px;
+ border-bottom-right-radius: 8px;
+ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ /* firefox specific markup */
+ -moz-border-radius-bottomleft: 8px;
+ -moz-border-radius-bottomright: 8px;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+ background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7);
+ /* webkit specific markup */
+ -webkit-border-bottom-left-radius: 8px;
+ -webkit-border-bottom-right-radius: 8px;
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7));
+}
+
+.paramkey {
+ text-align: right;
+}
+
+.paramtype {
+ white-space: nowrap;
}
-CAPTION {
- font-weight: bold
+.paramname {
+ color: #602020;
+ white-space: nowrap;
}
+.paramname em {
+ font-style: normal;
+}
+
+.params, .retval, .exception, .tparams {
+ border-spacing: 6px 2px;
+}
+
+.params .paramname, .retval .paramname {
+ font-weight: bold;
+ vertical-align: top;
+}
+
+.params .paramtype {
+ font-style: italic;
+ vertical-align: top;
+}
+
+.params .paramdir {
+ font-family: "courier new",courier,monospace;
+ vertical-align: top;
+}
+
+
+
-/* Link in the top navbar */
-A.qindex {}
+/* @end */
-A.qindexRef {}
+/* @group Directory (tree) */
-/* Link to any cross-referenced Doxygen element */
-A.el {
- text-decoration: none;
- font-weight: bold
+/* for the tree view */
+
+.ftvtree {
+ font-family: sans-serif;
+ margin: 0px;
+}
+
+/* these are for tree view when used as main index */
+
+.directory {
+ font-size: 9pt;
+ font-weight: bold;
+ margin: 5px;
}
-A.elRef {
- font-weight: bold
+.directory h3 {
+ margin: 0px;
+ margin-top: 1em;
+ font-size: 11pt;
}
-/* Link to any cross-referenced Doxygen element inside a code section
- (ex: header)
+/*
+The following two styles can be used to replace the root node title
+with an image of your choice. Simply uncomment the next two styles,
+specify the name of your image and be sure to set 'height' to the
+proper pixel height of your image.
+*/
+
+/*
+.directory h3.swap {
+ height: 61px;
+ background-repeat: no-repeat;
+ background-image: url("yourimage.gif");
+}
+.directory h3.swap span {
+ display: none;
+}
*/
-A.code {
- text-decoration: none;
- font-weight: normal;
- color: #4444ee
+
+.directory > h3 {
+ margin-top: 0;
+}
+
+.directory p {
+ margin: 0px;
+ white-space: nowrap;
+}
+
+.directory div {
+ display: none;
+ margin: 0px;
+}
+
+.directory img {
+ vertical-align: -30%;
+}
+
+/* these are for tree view when not used as main index */
+
+.directory-alt {
+ font-size: 100%;
+ font-weight: bold;
+}
+
+.directory-alt h3 {
+ margin: 0px;
+ margin-top: 1em;
+ font-size: 11pt;
+}
+
+.directory-alt > h3 {
+ margin-top: 0;
+}
+
+.directory-alt p {
+ margin: 0px;
+ white-space: nowrap;
+}
+
+.directory-alt div {
+ display: none;
+ margin: 0px;
+}
+
+.directory-alt img {
+ vertical-align: -30%;
+}
+
+/* @end */
+
+div.dynheader {
+ margin-top: 8px;
+}
+
+address {
+ font-style: normal;
+ color: #2A3D61;
+}
+
+table.doxtable {
+ border-collapse:collapse;
+}
+
+table.doxtable td, table.doxtable th {
+ border: 1px solid #2D4068;
+ padding: 3px 7px 2px;
+}
+
+table.doxtable th {
+ background-color: #374F7F;
+ color: #FFFFFF;
+ font-size: 110%;
+ padding-bottom: 4px;
+ padding-top: 5px;
+ text-align:left;
+}
+
+.tabsearch {
+ top: 0px;
+ left: 10px;
+ height: 36px;
+ background-image: url('tab_b.png');
+ z-index: 101;
+ overflow: hidden;
+ font-size: 13px;
+}
+
+.navpath ul
+{
+ font-size: 11px;
+ background-image:url('tab_b.png');
+ background-repeat:repeat-x;
+ height:30px;
+ line-height:30px;
+ color:#8AA0CC;
+ border:solid 1px #C2CDE4;
+ overflow:hidden;
+ margin:0px;
+ padding:0px;
+}
+
+.navpath li
+{
+ list-style-type:none;
+ float:left;
+ padding-left:10px;
+ padding-right:15px;
+ background-image:url('bc_s.png');
+ background-repeat:no-repeat;
+ background-position:right;
+ color:#364D7C;
+}
+
+.navpath li.navelem a
+{
+ height:32px;
+ display:block;
+ text-decoration: none;
+ outline: none;
+}
+
+.navpath li.navelem a:hover
+{
+ color:#6884BD;
+}
+
+.navpath li.footer
+{
+ list-style-type:none;
+ float:right;
+ padding-left:10px;
+ padding-right:15px;
+ background-image:none;
+ background-repeat:no-repeat;
+ background-position:right;
+ color:#364D7C;
+ font-size: 8pt;
+}
+
+
+div.summary
+{
+ float: right;
+ font-size: 8pt;
+ padding-right: 5px;
+ width: 50%;
+ text-align: right;
+}
+
+div.summary a
+{
+ white-space: nowrap;
+}
+
+div.ingroups
+{
+ font-size: 8pt;
+ padding-left: 5px;
+ width: 50%;
+ text-align: left;
+}
+
+div.ingroups a
+{
+ white-space: nowrap;
+}
+
+div.header
+{
+ background-image:url('nav_h.png');
+ background-repeat:repeat-x;
+ background-color: #F9FAFC;
+ margin: 0px;
+ border-bottom: 1px solid #C4CFE5;
+}
+
+div.headertitle
+{
+ padding: 5px 5px 5px 10px;
+}
+
+.title {
+ font-size: 150%;
+ font-weight: bold;
+ margin: 10px 2px;
+}
+
+dl
+{
+ padding: 0 0 0 10px;
+}
+
+dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug
+{
+ border-left:4px solid;
+ padding: 0 0 0 6px;
+}
+
+dl.note
+{
+ border-color: #D0D000;
+}
+
+dl.warning, dl.attention
+{
+ border-color: #FF0000;
+}
+
+dl.pre, dl.post, dl.invariant
+{
+ border-color: #00D000;
+}
+
+dl.deprecated
+{
+ border-color: #505050;
}
-A.codeRef {
- font-weight: normal;
- color: #4444ee
+dl.todo
+{
+ border-color: #00C0E0;
}
-A:hover {
- text-decoration: none;
- background-color: lightblue
+dl.test
+{
+ border-color: #3030E0;
}
-DL.el {
- margin-left: -1cm
+dl.bug
+{
+ border-color: #C08050;
}
-/* A code fragment (ex: header) */
-DIV.fragment {
- width: 100%;
- border: none;
- background-color: #CCCCCC
+#projectlogo
+{
+ text-align: center;
+ vertical-align: bottom;
+ border-collapse: separate;
+}
+
+#projectlogo img
+{
+ border: 0px none;
+}
+
+#projectname
+{
+ background-color: #175783;
+ border: 1px solid;
+ height: 80px;
+ background-repeat: no-repeat;
+/* font: 300% arial,sans-serif;*/
+ margin: 0px;
+ padding: 0px;
+}
+
+#projectbrief
+{
+ font: 120% arial,sans-serif;
+ margin: 0px;
+ padding: 0px;
}
-/* In the alpha list (coumpound index), style of an alphabetical index letter */
-DIV.ah {
- background-color: #CCCCCC;
- font-weight: bold;
- color: #ffffff;
- margin-bottom: 3px;
- margin-top: 3px
+#projectnumber
+{
+ font: 50% arial,sans-serif;
+ margin: 0px;
+ padding: 0px;
}
-/* Method name (+ type) */
-TD.md {
- background-color: lightblue;
- font-weight: bold;
+#titlearea
+{
+ background: url("head.png");
+ background-color: #175783;
+ border: 1px solid;
+ height: 80px;
+ background-repeat: no-repeat;
+ padding: 0px;
+ margin: 0px;
+ width: 100%;
+ border-bottom: 1px solid #5373B4;
}
-/* Method parameter (some of them) */
-TD.mdname1 {
- background-color: lightblue;
- font-weight: bold; color: #602020;
-}
-
-/* Method parameter (some of them) */
-TD.mdname {
- background-color: lightblue;
- font-weight: bold;
- color: #602020;
- width: 600px;
-}
-
-/* Separator between methods group (usually empty, seems not supported by IE) */
-DIV.groupHeader {
- margin-left: 16px;
- margin-top: 12px;
- margin-bottom: 6px;
- font-weight: bold
-}
-
-DIV.groupText {
- margin-left: 16px;
- font-style: italic;
- font-size: smaller
-}
-
-BODY {
- background: #FFFFFF;
-}
-
-/*div.div-page {
- background-color: #FFFFFF;
- margin-left: 1em;
- margin-right: 1em;
- margin-top: 1em;
- margin-bottom: 0.1em;
-
- padding-left: 1em;
- padding-right: 1em;
- padding-top: 0.5em;
- padding-bottom: 0.5em;
-
- border: 2px solid #0D299A;
- border-width: 2px;
- border-color: #0D299A;
-}*/
-
-div.tabs {
- text-align: justify;
- margin-left : 2px;
- margin-right : 2px;
- margin-top : 2px;
- margin-bottom : 2px
- font-weight: bold;
- color: #FFFFFF;
-}
-
-DIV.div-footer {
- margin-left: 1em;
- margin-right: 1em;
- margin-bottom: 0.2em;
- text-align: right;
- font-size: 9pt;
-}
-
-/* In File List, Coumpound List, etc, 1st column of the index */
-TD.indexkey {
- background-color: #CCCCCC;
- font-weight: bold;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px
-}
-
-/* In File List, Coumpound List, etc, 2nd column of the index */
-TD.indexvalue {
- background-color: #CCCCCC;
- font-style: italic;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px
-}
-
-span.keyword { color: #008000 }
-span.keywordtype { color: #604020 }
-span.keywordflow { color: #e08000 }
-span.comment { color: #800000 }
-span.preprocessor { color: #806020 }
-span.stringliteral { color: #002080 }
-span.charliteral { color: #008080 }
-</DIV>
-<DIV class="div-footer">
-Generated on $datetime for $projectname by <A href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></A> $doxygenversion</DIV>
-</BODY>
-</HTML>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+</head>
+<body>
+<div class="footer1">
+<!--hr style="width: 100%; height: 2px;"-->
+<div style="text-align: center;">
+Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE<br>
+Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS<br>
+</div>
+</div>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<title>$title</title>
+<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
+$treeview
+$search
+$mathjax
+<script type="text/javascript">
+$(document).ready(initResizable);
+</script>
+<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body onload='searchBox.OnSelectItem(0);'>
+<div id="top"><!-- do not remove this div! -->
+<div id="titlearea"><div align="right"><div class="version">Version: @VERSION@</div></div></div>
+
+</div>
+++ /dev/null
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (WinNT; I) [Netscape]">
- <title>Main Page</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head>
-<body>
-
-</body>
-</html>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# This Makefile is responsible of generating the client and server
# implementation of IDL interfaces for both C++ and python usage.
# The building process of the C++ files is in charge of each source
BASEIDL_FILES = VISU_Gen.idl
+BASEIDL_FILES_PY=$(BASEIDL_FILES:%.idl=%_idl.py)
+
# This variable defines the files to be installed
dist_salomeidl_DATA = $(BASEIDL_FILES)
nodist_salomeinclude_HEADERS = $(BASEIDL_FILES:%.idl=%.hh)
libSalomeIDLVISU_la_CPPFLAGS = \
- -I$(top_builddir)/salome_adm/unix \
-I$(top_builddir)/idl \
@CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @KERNEL_CXXFLAGS@ @MED_CXXFLAGS@
libSalomeIDLVISU_la_LDFLAGS = -no-undefined -version-info=0:0:0
OMNIORB_IDL = @OMNIORB_IDL@
OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome
-IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome -I$(top_builddir)/salome_adm/unix
+IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome
IDLPYFLAGS = @IDLPYFLAGS@ -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome
# potential problem on parallel make on the following - multiple outputs
$(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
done
-# uninstall-local removes too much, but it works in distcheck
+# we want to remove only staff generated for IDL files and nothing more
uninstall-local:
- rm -rf $(DESTDIR)$(salomepythondir)/*
+ @for modulen in VISU ; do \
+ test -d $(DESTDIR)$(salomepythondir)/$${modulen} && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen} ; \
+ test -d $(DESTDIR)$(salomepythondir)/$${modulen}__POA && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}__POA" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen}__POA ; \
+ done ; \
+ for filen in $(BASEIDL_FILES_PY) ; do \
+ echo "Removing $(DESTDIR)$(salomepythondir)/$${filen}" && rm -f $(DESTDIR)$(salomepythondir)/$${filen}* ; \
+ done
mostlyclean-local: clean-idls
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VISU_Gen.idl
// Author : Alexey Petrov
-//
+
/*! \file VISU_Gen.idl This file conatins a set of interfaces of the %VISU module.
* This module provides various forms of data visualization in %SALOME application.
* These forms include data tables, XY plots, 3d representations
* of the scaling, which can be applied on different presentations.
*/
enum Scaling{ LINEAR, /*!< Linear type of scaling. */
- LOGARITHMIC /*!< Logarithmic type of scaling. */
- };
+ LOGARITHMIC /*!< Logarithmic type of scaling. */
+ };
+
+ /*!
+ * This enumeration contains a set of elements defining
+ * what kind of value will be extracted from gauss points data.
+ */
+ enum GaussMetric {
+ AVERAGE, /*!< Average value (default). */
+ MINIMUM, /*!< Minimum value. */
+ MAXIMUM /*!< Maximum value. */
+ };
/*!
* This enumeration contains a set of elements defining the
NODE, /*!< Node corresponds to a geometrical point. */
EDGE, /*!< Edge corresponds to a geometrical line connecting two points. */
FACE, /*!< Face corresponds to a geometrical plane bounded by several lines. */
- CELL, /*!< Cell is a volumic element of a mesh */
+ CELL, /*!< Cell is a volumic element of a mesh */
NONE /*!< Indicates undefined entity value */
};
+ /*!
+ * Marker type (used for point rendering)
+ */
+ enum MarkerType {
+ MT_NONE,
+ MT_POINT,
+ MT_PLUS,
+ MT_STAR,
+ MT_O,
+ MT_X,
+ MT_O_POINT,
+ MT_O_PLUS,
+ MT_O_STAR,
+ MT_O_X,
+ MT_USER,
+ MT_POINT_SPRITE /*!< VISU specific */
+ };
+
+ /*!
+ * Marker scale (used for point rendering)
+ */
+ enum MarkerScale {
+ MS_NONE,
+ MS_10,
+ MS_15,
+ MS_20,
+ MS_25,
+ MS_30,
+ MS_35,
+ MS_40,
+ MS_45,
+ MS_50,
+ MS_55,
+ MS_60,
+ MS_65,
+ MS_70
+ };
+
+ /*!
+ * Tables' sort order
+ */
+ enum SortOrder {
+ AscendingOrder, /*!< The table items are sorted ascending */
+ DescendingOrder /*!< The table items are sorted descending */
+ };
+
+ /*!
+ * Tables' sort policy (specifies how empty cells are taken into account when sorting)
+ */
+ enum SortPolicy {
+ EmptyLowest, /*!< Empty cells are considered as lowest values */
+ EmptyHighest, /*!< Empty cells are considered as highest values */
+ EmptyFirst, /*!< Empty cells are always first */
+ EmptyLast, /*!< Empty cells are always last */
+ EmptyIgnore /*!< Empty cells are ignored (stay at initial positions) */
+ };
+
/*!
* This enumeration contains a set of elements defining the type of the %VISU object.
* This enumeration is used for navigation between a set of %VISU interfaces.
TPOINTMAP3D, /*!< 3D presentation for table object */
TCUTPLANES, /*!< Cut planes 3D presentation object */
TCUTLINES, /*!< Cut lines 3D presentation object */
+ TCUTSEGMENT, /*!< Cut segment 3D presentation object */
TVECTORS, /*!< Vectors 3D presentation object */
TSTREAMLINES, /*!< Streamlines 3D presentation object */
TVISUGEN, /*!< %VISU generator used for performing operations with different %VISU objects */
TFIELD, /*!< Field represents the results of calculations (it can be scalar or vector values), grouped together under one physical concept. */
TTIMESTAMP, /*!<Time stamp represents a subfield: the results of calculations are taken in one definite moment. */
TANIMATION, /*!< Represents Animation object. */
+ TEVOLUTION, /*!< Represents Evolution object. */
TCOLOREDPRS3DHOLDER, /*!< Colored 3D presentation holder */
TCOLOREDPRS3DCACHE, /*!< Colored 3D presentation cache */
TPART, /*!< MULTIPR: part of a mesh */
boolean isAuto;
string name;
};
-
+
interface Base {
/*!
* Returns ID of the object.
* which the curve is constructed on the graphics.
*/
enum MarkerType { NONE,
- CIRCLE,
- RECTANGLE,
- DIAMOND,
- DTRIANGLE,
- UTRIANGLE,
- LTRIANGLE,
- RTRIANGLE,
- CROSS,
- XCROSS
+ CIRCLE,
+ RECTANGLE,
+ DIAMOND,
+ DTRIANGLE,
+ UTRIANGLE,
+ LTRIANGLE,
+ RTRIANGLE,
+ CROSS,
+ XCROSS
};
/*!
* \return Long value corresponding to the width of the curve line.
*/
long GetLineWidth();
+
+ /*! Sets scaling coefficient of the curve.
+ * \param coef Double value defining the scale.
+ */
+ void SetScale(in double theCoef);
+
+ /*! Gets the scale coefficient of the curve lines.
+ */
+ double GetScale();
+
+ /*! Sets scaling coefficient of the curve to 1.0.
+ */
+ void RemoveScale();
+
+ /*!
+ * Switches on/off displaying of the deviation labels
+ * on the curve.
+ * \param flag is used to switch on/off the deviation
+ * labels on the curve.
+ */
+ void ShowDeviation(in boolean flag);
};
//-------------------------------------------------------
*
* This is a root class for all 3D presentations, which can be displayed in %VISU module.
*/
- interface Prs3d : PrsObject, SALOME::GenericObj
+ interface Prs3d : PrsObject, SALOME::GenericObj
{
/*!
* Move the 3D presentation according to the given offset parameters
*/
void GetOffset(out float theDx, out float theDy, out float theDz);
+ /*!
+ * Set standard point marker for the object
+ * \param theType standard marker type
+ * \param theScale standard marker scale
+ */
+ void SetMarkerStd(in MarkerType theType, in MarkerScale theScale);
+
+ /*!
+ * Set custom point marker for the object. The texture can be added
+ * by LoadTexture() function
+ * \param theTextureId texture ID
+ */
+ void SetMarkerTexture(in long theTextureId);
+
+ /*!
+ * Get type of the point marker assigned to the object
+ * \return current marker type (MT_NONE if no marker is set)
+ */
+ MarkerType GetMarkerType();
+
+ /*!
+ * Get scale of the point marker assigned to the object
+ * \return current marker scale (MS_NONE if no marker is set)
+ */
+ MarkerScale GetMarkerScale();
+
+ /*!
+ * Get texture idenifier of the point marker assigned to the object
+ * \return marker texture ID (0 if no marker set)
+ */
+ long GetMarkerTexture();
+
/*!
* Gets memory size actually used by the presentation (Mb).
*/
* type of presentation of the mesh.
*/
enum PresentationType{ POINT,
- WIREFRAME,
- SHADED,
- INSIDEFRAME,
- SURFACEFRAME,
- FEATURE_EDGES,
- SHRINK
+ WIREFRAME,
+ SHADED,
+ INSIDEFRAME,
+ SURFACEFRAME,
+ FEATURE_EDGES,
+ SHRINK
+ };
+
+ /*!
+ * This enumeration contains a set of elements defining the
+ * type of presentation of the 2D quadratic mesh elements.
+ */
+ enum Quadratic2DPresentationType{
+ LINES,
+ ARCS
};
/*! \brief Interface of the mesh.
*/
PresentationType GetPresentationType();
+
+ /*!
+ * Sets the type of representation of a 2D quadratic mesh elements.
+ * \param theType The type of representation of 2D quadratic mesh elements.
+ * This parameter is taken from
+ * <VAR>Quadratic2DPresentationType</VAR> enumeration.
+ */
+ void SetQuadratic2DPresentationType(in Quadratic2DPresentationType theType);
+
+ /*!
+ * Gets the type of representation of the 2D quadratic mesh elements.
+ * \return The type of representation of the 2D quadratic mesh elements.
+ */
+ Quadratic2DPresentationType GetQuadratic2DPresentationType();
+
/*!
* Switches shrink mode of presentation
* Note: SetPresentationType(SHRINK) is same as SetShrink(True)
/*!
* Gets the min boundary of the scalar bar from source data.
*/
- double GetSourceMin();
+ double GetSourceMin();
/*!
* Gets the max boundary of the scalar bar from source data.
*/
long GetScalarMode();
- /*!
+ /*!
* Set the visibility of a distribution curve.
* \param theIs is used to switch on/off the visibility of a distribution curve.
*/
* \param theGroupName - group name
*/
void AddMeshOnGroup(in string theGroupName);
-
+
/*!
* PrsMerger method:
* Remove all groups.(The scalar map will be placed on all mesh).
* Apply input parameters to last visited presentation in the cache.
*/
boolean Apply(in ColoredPrs3d thePrs3d,
- in BasicInput theInput,
- in View3D theView3D);
+ in BasicInput theInput,
+ in View3D theView3D);
/*!
* Gets the last visited presentation in the cache.
*/
VISUType GetPrsType();
- /*! Defines timestamp representation.
+ /*! Defines timestamp representation.
*/
struct TimeStampInfo
{
long myNumber;
};
- /*! Defines representation range of timestamps.
+ /*! Defines representation range of timestamps.
*/
typedef sequence<TimeStampInfo> TimeStampsRange;
/*! Creates %ColoredPrs3dHolder.*/
ColoredPrs3dHolder CreateHolder(in VISUType theType,
- in ColoredPrs3dHolder::BasicInput theInput);
+ in ColoredPrs3dHolder::BasicInput theInput);
/*! Gets a memory which is required to create a holder. */
EnlargeType GetRequiredMemory(in VISUType theType,
- in ColoredPrs3dHolder::BasicInput theInput,
- out float theRequiredMemory);
+ in ColoredPrs3dHolder::BasicInput theInput,
+ out float theRequiredMemory);
};
* bar is displayed along with each colored field presentation and serves for
* consulting the correspondance between colors and data values.
*/
-
+
interface ScaledPrs3d {
/*!
* Sets the type of scaling of the values reflected by the scalar bar.
*/
void SetBarVisible(in boolean theVisible);
+ /*!
+ * Sets the gauss metric for the presentation.
+ * \param theGaussMetric The value of this parameter is taken from the <VAR>GaussMetric</VAR> enumeration.
+ */
+ void SetGaussMetric(in GaussMetric theGaussMetric);
+
+ /*!
+ * Gets the gauss metric of the presentation.
+ */
+ GaussMetric GetGaussMetric();
+
+ /*!
+ * Sets the color of mesh links.
+ * \param theColor The color of the links. This parameter is taken from <VAR>Color</VAR> enumeration.
+ */
+ void SetLinkColor(in SALOMEDS::Color theColor);
+
+ /*!
+ * Gets the color of mesh links.
+ */
+ SALOMEDS::Color GetLinkColor();
};
//-------------------------------------------------------
* Presentation parameters of the Gauss Points presentation.
*/
//-------------------------------------------------------
- interface GaussPoints : ColoredPrs3d
+ interface GaussPoints : ColoredPrs3d
{
//! Set flag indicating which scalar bar is active.
void SetIsActiveLocalScalarBar(in boolean theFlag);
//! Get value of the distance between global and local scalar bars.
double GetSpacing();
- /*!
+ /*!
+ * Returns visibility state of scalar bar
+ */
+ boolean IsBarVisible();
+
+ /*!
+ * Sets visibility state of scalar bar
+ */
+ void SetBarVisible(in boolean theVisible);
+
+ /*!
* Set the Multicolored mode.
* \param theIsColored is used to switch between Results and Geometry modes.
* Multiple colors are using when the presentation is
/*!
* This enumeration contains a set of elements defining the type of representation of the vector head.
*/
- enum PrimitiveType {
+ enum PrimitiveType {
SPRITE,
POINT,
SPHERE
//! Defines how many faces of can be drawn in the Geometrical Sphere primitive mode
long GetFaceLimit();
+
+
};
*
* Presentation parameters of the deformed shape presentation.
*/
- interface DeformedShape : MonoColorPrs
+ interface DeformedShape : MonoColorPrs
{
/*!
* Sets the scale of the presentatable object.
* \param theFieldName - the name of vectorial field
*/
void SetVectorialField(in Entity theEntity,
- in string theFieldName);
+ in string theFieldName);
/*!
* Get vectorial entity
* Get scalar field name
*/
string GetVectorialFieldName();
-
+
};
//-------------------------------------------------------
* Presentation parameters of the scalar map on deformed shape presentation.
*/
interface DeformedShapeAndScalarMap : ScalarMap {
-
+
/*!
* Sets the scale of the presentatable object.
* \param theScale Double value defining the scale of this presentable object.
* \param theTimeStampNumber - the timestamp number for the scalar field
*/
void SetScalarField(in Entity theEntity,
- in string theFieldName,
- in long theTimeStampNumber);
+ in string theFieldName,
+ in long theTimeStampNumber);
/*!
* the type of orientation in 3D space of the cutting plane.
*/
enum Orientation { XY, /*!< The object is located in the plane formed by X and Y axis. */
- YZ, /*!< The object is located in the plane formed by Y and Z axis. */
- ZX }; /*!< The object is located in the plane formed by Z and X axis. */
+ YZ, /*!< The object is located in the plane formed by Y and Z axis. */
+ ZX }; /*!< The object is located in the plane formed by Z and X axis. */
/*!
* Sets the orientation in 3D space of cutting plane for the presentation.
* \param theIsRelative Define, whether the input position is relative.
*/
void SetPlanePosition (in double thePlanePosition,
- in boolean theIsRelative);
+ in boolean theIsRelative);
/*!
* Gets the position of the cutting plane
* \return Long value corresponding to the number of columns of the table
*/
long GetNbColumns();
+
+ /*!
+ * Sorts the specified row of the table.
+ * \param theRow Index of the row to sort
+ * \param theSortOrder Sort order (see <VAR>SortOrder</VAR> enumeration)
+ * \param theSortPolicy Sort policy (see <VAR>SortPolicy</VAR> enumeration)
+ */
+ void SortRow(in long theRow, in SortOrder theSortOrder, in SortPolicy theSortPolicy);
+
+ /*!
+ * Sorts the specified column of the table.
+ * \param theRow Index of the column to sort
+ * \param theSortOrder Sort order (see <VAR>SortOrder</VAR> enumeration)
+ * \param theSortPolicy Sort policy (see <VAR>SortPolicy</VAR> enumeration)
+ */
+ void SortColumn(in long theColumn, in SortOrder theSortOrder, in SortPolicy theSortPolicy);
+
+ /*!
+ * Sorts the table by the specified row.
+ * \param theRow Index of the row, by which the table has to be sort
+ * \param theSortOrder Sort order (see <VAR>SortOrder</VAR> enumeration)
+ * \param theSortPolicy Sort policy (see <VAR>SortPolicy</VAR> enumeration)
+ */
+ void SortByRow(in long theRow, in SortOrder theSortOrder, in SortPolicy theSortPolicy);
+
+ /*!
+ * Sorts the table by the specified column.
+ * \param theColumn Index of the column, by which the table has to be sort
+ * \param theSortOrder Sort order (see <VAR>SortOrder</VAR> enumeration)
+ * \param theSortPolicy Sort policy (see <VAR>SortPolicy</VAR> enumeration)
+ */
+ void SortByColumn(in long theColumn, in SortOrder theSortOrder, in SortPolicy theSortPolicy);
};
//-------------------------------------------------------
*/
enum Orientation {XY, /*!< The object is located in the plane formed by X and Y axis. */
YZ, /*!< The object is located in the plane formed by Y and Z axis. */
- ZX}; /*!< The object is located in the plane formed by Z and X axis. */
+ ZX}; /*!< The object is located in the plane formed by Z and X axis. */
/*!
* Sets the type of orientation in 3D space of cut planes presentation.
long GetNbPlanes();
};
+ //-------------------------------------------------------
+ /*! \brief Base interface for Cut Lines and Cut Segment tools
+ *
+ */
+ interface CutLinesBase : ScalarMap {
+ /*!
+ * Sets the number of cut lines.
+ * \param theNb The number of cut lines.
+ */
+ void SetNbLines(in long theNb);
+
+ /*!
+ * Gets the number of cut lines.
+ */
+ long GetNbLines();
+
+ /*! Invert all curves of corresponding table
+ * \param theInvert - Invert all curves, if value is TRUE, else not.
+ */
+ void SetAllCurvesInverted(in boolean theInvert);
+
+ /*! Checks the orientation of all curves
+ * \retval TRUE - if all curves are inverted, else FALSE
+ */
+ boolean IsAllCurvesInverted();
+
+ /*! Sets values which cutlines would be shown: aboslute or relative values
+ * \param theAbsLength - boolean value, TRUE or false.
+ */
+ void SetUseAbsoluteLength(in boolean theAbsLength);
+
+ /*! Checks values of cutlines: using aboslute or relative values
+ */
+ boolean IsUseAbsoluteLength();
+ };
+
//-------------------------------------------------------
/*! \brief Cut lines presentation.
*
* operation is a regular array of lines in space, belonging to the same plane
* and having the same orientation. They are located inside or on the mesh.
*/
- interface CutLines : ScalarMap {
+ interface CutLines : CutLinesBase {
/*!
* Sets the type of orientation in 3D space of the base plane of a cut lines presentation.
* \param theOrientation The orientation of the base plane in 3D space.
* \return True if this cutting plane has default position.
*/
boolean IsDefaultPosition(in long thePlaneNumber);
+ };
+ //-------------------------------------------------------
+ /*! \brief Cut segment presentation.
+ *
+ * Presentation parameters of a Cut segment presentation.
+ * Cut Segment is a simplified variant of Cut Lines presentation, which is used
+ * to display a single line instead of set of them. Axis of this line is defined
+ * by coordinates of two points in 3D space.
+ */
+ interface CutSegment : CutLinesBase {
/*!
- * Sets the number of cut lines.
- * \param theNb The number of cut lines.
+ * Sets coordinates of the first point of axis of the segment.
+ * \param theX X coordinate of the point
+ * \param theY Y coordinate of the point
+ * \param theZ Z coordinate of the point
*/
- void SetNbLines(in long theNb);
+ void SetPoint1(in double theX, in double theY, in double theZ);
/*!
- * Gets the number of cut lines.
- */
- long GetNbLines();
-
- /*! Invert all curves of corresponding table
- * \param theInvert - Invert all curves, if value is TRUE, else not.
+ * Gets coordinates of the first point of axis of the segment.
+ * \param theX X coordinate of the point
+ * \param theY Y coordinate of the point
+ * \param theZ Z coordinate of the point
*/
- void SetAllCurvesInverted(in boolean theInvert);
+ void GetPoint1(out double theX, out double theY, out double theZ);
- /*! Checks the orientation of all curves
- * \retval TRUE - if all curves are inverted, else FALSE
+ /*!
+ * Sets coordinates of the second point of axis of the segment.
+ * \param theX X coordinate of the point
+ * \param theY Y coordinate of the point
+ * \param theZ Z coordinate of the point
*/
- boolean IsAllCurvesInverted();
+ void SetPoint2(in double theX, in double theY, in double theZ);
- /*! Sets values which cutlines would be shown: aboslute or relative values
- * \param theAbsLength - boolean value, TRUE or false.
- */
- void SetUseAbsoluteLength(in boolean theAbsLength);
-
- /*! Checks values of cutlines: using aboslute or relative values
+ /*!
+ * Gets coordinates of the second point of axis of the segment.
+ * \param theX X coordinate of the point
+ * \param theY Y coordinate of the point
+ * \param theZ Z coordinate of the point
*/
- boolean IsUseAbsoluteLength();
+ void GetPoint2(out double theX, out double theY, out double theZ);
};
/*! \brief Interface of the stream lines representation
* for definition of direction of the stream lines.
*/
enum Direction{ FORWARD,
- BACKWARD,
- BOTH
+ BACKWARD,
+ BOTH
};
/*! Sets the parameters of the stream lines presentation.
* \return True if all parameters are properly set.
*/
boolean SetParams(in double theIntStep,
- in double thePropogationTime,
- in double theStepLength,
- in Prs3d thePrs3d,
- in double thePercents,
- in Direction theDirection);
+ in double thePropogationTime,
+ in double theStepLength,
+ in Prs3d thePrs3d,
+ in double thePercents,
+ in Direction theDirection);
/*! Gets the value of integration step of the stream lines presentation.
*/
* <BR><B>Time stamp</B> represents a subfield: the results
* of calculations are taken in one definite moment.
*/
- interface Animation : Base
+ interface Animation : Base
{
/*!
* This enumeration contains a set of available animation modes.
*/
enum AnimationMode{ PARALLEL, /*!< parallel mode of animation. */
- SUCCESSIVE /*!< succcessive mode of animation. */
+ SUCCESSIVE /*!< succcessive mode of animation. */
};
-
+
/*! Defines the field which will be used as a base for generation of the animation.
* \param theObject The %SObject corresponding to the field.
*/
*/
string setDumpFormat(in string theFormat);
+ /*! Set frequency of timestamps used to generate AVI file.
+ * \param theFrequency The frequency of timestamps to use.
+ */
+ void setTimeStampFrequency(in long theFrequency);
+
+ /*! Get frequency of timestamps used to generate AVI file.
+ * \return The frequency of timestamps to use.
+ */
+ long getTimeStampFrequency();
+
/*! Returns True, if the playback of the animation is cycling.
*/
boolean isCycling();
void restoreFromStudy(in SALOMEDS::SObject theSObj);
boolean isSavedInStudy();
-
+
/*!
* Sets the animation mode.
* \param theMode The value of this parameter is taken from the <VAR>AnimationMode</VAR> enumeration.
raises (SALOME::SALOME_Exception);
};
-
+
+ //-------------------------------------------------------
+ interface XYPlot;
+
+ //-------------------------------------------------------
+ /*! \brief Interface %Evolution
+ *
+ */
+ interface Evolution : Base
+ {
+ /*!
+ * Defines the field which will be used as a base for generation of the evolution.
+ * \param theObject The %SObject corresponding to the field.
+ */
+ boolean setField(in SALOMEDS::SObject theObject);
+
+ /*!
+ * Sets id of the point for which the evolution will be generated.
+ * \param thePointId id of the point.
+ */
+ void setPointId(in long thePointId);
+
+ /*!
+ * Sets id of the component for which the evolution will be generated.
+ * \param thePointId id of the component.
+ */
+ void setComponentId(in long theComponentId);
+
+ /*!
+ * Shows the evolution.
+ */
+ boolean showEvolution();
+
+ /*!
+ * Restores the evolution from study.
+ * \param theSObj the study object from which the evolution should be restored.
+ */
+ void restoreFromStudy(in SALOMEDS::SObject theSObj);
+ };
+
+
/*! \brief Interface %Result
*
* This interface serves for inner representation of data generated
* in other sources (MED object or file). This data is needed
* for further construction of graphical presentations.
*/
- interface Result : RemovableObject, SALOME::GenericObj
+ interface Result : RemovableObject, SALOME::GenericObj
{
/*! Reads all data from the corresponding sources. By default the data is loaded on demand.
*/
long GetNumberOfComponents(in EntityName theMeshName, in Entity theEntity, in EntityName theFieldName);
/*! Gets existing numbers of time stamps for the given mesh name, entity and name of field */
- TimeStampNumbers GetTimeStampNumbers(in EntityName theMeshName, in Entity theEntity, in EntityName theFieldName);
+ TimeStampNumbers GetTimeStampNumbers(in EntityName theMeshName, in Entity theEntity,
+ in EntityName theFieldName);
+
+ /*! Gets time values of time stamps for the given mesh name, entity and name of field */
+ double_array GetTimeStampValues(in EntityName theMeshName, in Entity theEntity, in EntityName theFieldName);
/*! Gets existing parts of multi resolution structure for the given mesh name */
EntityNames GetPartNames(in EntityName theMeshName);
/*! Gets current resolution of multi resolution structure for the given mesh and part names */
void SetResolution(in EntityName theMeshName, in EntityName thePartName, in Resolution theResolution);
-
+
/*! Gets information about imported MED file */
SALOME_MED::MedFileInfo GetMEDFileInfo();
* post-processing presentations from given %Result and %Table object reference,
* using the views provided by %ViewManager.
*/
- interface VISU_Gen : Engines::Component, SALOMEDS::Driver, Base
+ interface VISU_Gen : Engines::EngineComponent, SALOMEDS::Driver, Base
{
/*! Sets a definite study to be current.
*/
ViewManager GetViewManager();
/*!
- * Imports tables from a file and create TableAttribute in Sudy
+ * Imports tables from a file and create TableAttribute in Study
*/
- SALOMEDS::SObject ImportTables(in string theFileName);
+ SALOMEDS::SObject ImportTables(in string theFileName,
+ in boolean theFirstStrAsTitle);
/*!
* Export table to a file
* \param theNewName Name to be given to the study object.
*/
void RenameEntityInStudy(in Result theResult,
- in string theMeshName,
- in Entity theEntity,
- in string theNewName);
+ in string theMeshName,
+ in Entity theEntity,
+ in string theNewName);
void RenameFamilyInStudy(in Result theResult,
- in string theMeshName,
- in Entity theEntity,
- in string theSubMeshName,
- in string theNewName);
+ in string theMeshName,
+ in Entity theEntity,
+ in string theSubMeshName,
+ in string theNewName);
void RenameGroupInStudy(in Result theResult,
- in string theMeshName,
- in string theSubMeshName,
- in string theNewName);
+ in string theMeshName,
+ in string theSubMeshName,
+ in string theNewName);
/*!
* Creates a mesh on the basis of the data generated in other sources (MED object or file).
* \param theEntity Type of entity where the field is defined.
*/
Mesh FamilyMeshOnEntity(in Result theResult, in string theMeshName,
- in Entity theEntity, in string theFamilyName);
+ in Entity theEntity, in string theFamilyName);
/*!
* Creates a mesh on the basis of a group of families.
* \param theTimeStampNumber Number of iteration on the field
*/
ScalarMap ScalarMapOnField(in Result theResult, in string theMeshName,
- in Entity theEntity, in string theFieldName,
- in long theTimeStampNumber);
+ in Entity theEntity, in string theFieldName,
+ in long theTimeStampNumber);
/*!
* Creates a Gauss Points presentation.
* \param theTimeStampNumber Number of iteration on the field
*/
GaussPoints GaussPointsOnField(in Result theResult, in string theMeshName,
- in Entity theEntity, in string theFieldName,
- in long theTimeStampNumber);
+ in Entity theEntity, in string theFieldName,
+ in long theTimeStampNumber);
/*!
* Creates a deformed shape presentation.
* \param theTimeStampNumber Number of iteration on the field
*/
DeformedShape DeformedShapeOnField(in Result theResult, in string theMeshName,
- in Entity theEntity, in string theFieldName,
- in long theTimeStampNumber);
+ in Entity theEntity, in string theFieldName,
+ in long theTimeStampNumber);
/*!
* Creates a deformed shape presentation. This function is obsolete. Use DeformedShapeAndScalarMapOnField instead.
* \param theTimeStampNumber Number of iteration on the field
*/
DeformedShapeAndScalarMap ScalarMapOnDeformedShapeOnField(in Result theResult, in string theMeshName,
- in Entity theEntity, in string theFieldName,
- in long theTimeStampNumber);
+ in Entity theEntity, in string theFieldName,
+ in long theTimeStampNumber);
/*!
* Creates a deformed shape presentation.
* \param theTimeStampNumber Number of iteration on the field
*/
DeformedShapeAndScalarMap DeformedShapeAndScalarMapOnField(in Result theResult, in string theMeshName,
- in Entity theEntity, in string theFieldName,
- in long theTimeStampNumber);
+ in Entity theEntity, in string theFieldName,
+ in long theTimeStampNumber);
/*!
* Creates a vector presentation.
* \param theTimeStampNumber Number of iteration on the field
*/
Vectors VectorsOnField(in Result theResult, in string theMeshName,
- in Entity theEntity, in string theFieldName,
- in long theTimeStampNumber);
+ in Entity theEntity, in string theFieldName,
+ in long theTimeStampNumber);
/*!
* Creates an iso surface presentation.
* \param theTimeStampNumber Number of iteration on the field
*/
IsoSurfaces IsoSurfacesOnField(in Result theResult, in string theMeshName,
- in Entity theEntity, in string theFieldName,
- in long theTimeStampNumber);
+ in Entity theEntity, in string theFieldName,
+ in long theTimeStampNumber);
/*!
* Creates an stream lines presentation.
* \param theTimeStampNumber Number of iteration on the field
*/
StreamLines StreamLinesOnField(in Result theResult, in string theMeshName,
- in Entity theEntity, in string theFieldName,
- in long theTimeStampNumber);
+ in Entity theEntity, in string theFieldName,
+ in long theTimeStampNumber);
/*!
* Creates a presentation of cut planes.
* \param theTimeStampNumber Number of iteration on the field
*/
CutPlanes CutPlanesOnField(in Result theResult, in string theMeshName,
- in Entity theEntity, in string theFieldName,
- in long theTimeStampNumber);
+ in Entity theEntity, in string theFieldName,
+ in long theTimeStampNumber);
/*!
* Creates a presentation of cut lines.
* \param theTimeStampNumber Number of iteration on the field
*/
CutLines CutLinesOnField(in Result theResult, in string theMeshName,
- in Entity theEntity, in string theFieldName,
- in long theTimeStampNumber);
+ in Entity theEntity, in string theFieldName,
+ in long theTimeStampNumber);
+
+ /*!
+ * Creates a presentation of cut segment.
+ * \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 theTimeStampNumber Number of iteration on the field
+ */
+ CutSegment CutSegmentOnField(in Result theResult, in string theMeshName,
+ in Entity theEntity, in string theFieldName,
+ in long theTimeStampNumber);
/*!
* Creates a Plot3D presentation.
* \param theTimeStampNumber Number of iteration on the field
*/
Plot3D Plot3DOnField(in Result theResult, in string theMeshName,
- in Entity theEntity, in string theFieldName,
- in long theTimeStampNumber);
+ in Entity theEntity, in string theFieldName,
+ in long theTimeStampNumber);
/*!
* Creates a table presentation.
/*!
* Creates a curve on the basis of points, whose values are taken from the table.
* \param theTable Table containing the data for construction of curves.
- * \param HRow Index of the row in the table: abscissa of the point.
- * \param VRow Index of the row in the table: ordinate of the point.
+ * \param theHRow Index of the row in the table: abscissa of the point.
+ * \param theVRow Index of the row in the table: ordinate of the point.
*/
Curve CreateCurve(in Table theTable, in long theHRow, in long theVRow);
-
+
/*!
* Creates a curve on the basis of points, whose values are taken from the table.
- * Each point has also assigned value, that will be shown as tooltip in Plot2d
+ * Each point has also assigned value, that will be shown as tooltip in Plot2d
* \param theTable Table containing the data for construction of curves.
- * \param HRow Index of the row in the table: abscissa of the point.
- * \param VRow Index of the row in the table: ordinate of the point.
- * \param ZRow Index of the row in the table: assigned value (so-called as Z).
- */
+ * \param theHRow Index of the row in the table: abscissa of the point.
+ * \param theVRow Index of the row in the table: ordinate of the point.
+ * \param theZRow Index of the row in the table: assigned value (so-called as Z).
+ */
Curve CreateCurveWithZ( in Table theTable, in long theHRow, in long theVRow, in long theZRow );
+ /*!
+ * Creates a curve on the basis of points, whose values are taken from the table.
+ * Each point has also assigned value, that will be shown as tooltip in Plot2d.
+ * The curve can be displayed using right axis of Plot2d view.
+ * \param theTable Table containing the data for construction of curves.
+ * \param theHRow Index of the row in the table: abscissa of the point.
+ * \param theVRow Index of the row in the table: ordinate of the point.
+ * \param theZRow Index of the row in the table: assigned value (so-called as Z).
+ * \param theIsV2 Flag allowed to display the curve using right axis of Plot2d view.
+ */
+ Curve CreateCurveWithZExt( in Table theTable, in long theHRow, in long theVRow, in long theZRow,
+ in boolean theIsV2 );
+
/*!
* Creates a presentation form containing an array of references to the curves.
*/
*/
Animation CreateAnimation(in View3D theView3d);
+ /*! Creates an evolution in the XY plot.
+ * \param theXYPlot The XY plot, where the evolution will be rendered.
+ */
+ Evolution CreateEvolution(in XYPlot theXYPlot);
+
void DeleteResult(in Result theResult);
void DeletePrs3d(in Prs3d thePrs3d);
*/
ColoredPrs3dCache GetColoredPrs3dCache(in SALOMEDS::Study theStudy);
-
+
/* Clipping planes management */
- /*Create a clipping plane and return its ID (position in corresponded array)
+ /*Create a clipping plane and return its ID (position in corresponded array)
Id of clipping plane could be changed after deletion of other clipping plane
*/
- long CreateClippingPlane(in double X, in double Y, in double Z,
- in double dX, in double dY, in double dZ,
- in boolean auto, in string name);
-
- void EditClippingPlane(in long id, in double X, in double Y, in double Z,
- in double dX, in double dY, in double dZ,
- in boolean auto, in string name);
-
+ long CreateClippingPlane(in double X, in double Y, in double Z,
+ in double dX, in double dY, in double dZ,
+ in boolean auto, in string name);
+
+ void EditClippingPlane(in long id, in double X, in double Y, in double Z,
+ in double dX, in double dY, in double dZ,
+ in boolean auto, in string name);
+
/* Returns clipping plane by its Id */
ClippingPlane GetClippingPlane(in long id);
-
+
/* Deletes clipping plane by its Id */
boolean DeleteClippingPlane(in long id);
-
+
/* Applyes a clipping plane with Id to presentation thePrs */
boolean ApplyClippingPlane(in Prs3d thePrs, in long id);
/* Detaches a clipping plane with Id from presentation thePrs */
boolean DetachClippingPlane(in Prs3d thePrs, in long id);
-
-
+
+
/* Get number of clipping planes */
long GetClippingPlanesNb();
in string theMeshName,
in double_array theTStamps );
+ /*!
+ * Load texture from file
+ * \param theTextureFile texture file name
+ * \return unique texture identifier
+ */
+ long LoadTexture(in string theTextureFile);
};
/*! \brief %View interface
* the following types: 3d, Table, XY plot.
* %View interface is a base for all types of %view interfaces.
*/
- interface View: Base, SALOME::GenericObj
+ interface View: Base, SALOME::GenericObj
{
/*! \brief %ViewRepresentation enumeration
*
*/
string SetPresentationType(in ScalarMap thePrs, in PresentationType thePrsType);
+
+ /*! Set representation type of 2D quadratic elements
+ * of the given presentation in this view.
+ * \param thePrs Object to set a representation type of 2D quadratic elements.
+ * \param theType Representation type of 2D quadratic elements to be set to the given object.
+ * \return Empty string in case of success, error description in case of failure.
+ */
+ string SetQuadratic2DPresentationType(in ScalarMap thePrs,in Quadratic2DPresentationType theType);
+
+
+ /*! Get representation type of the 2D quadratic mesh elements of given presentation in this view.
+ * \param thePrs Object to get a representation type of 2D quadratic mesh elements.
+ * \return <VAR>Quadratic2DPresentationType</VAR> Representation type of 2D quadratic mesh elements
+ * in this view.
+ */
+ Quadratic2DPresentationType GetQuadratic2DPresentationType(in ScalarMap thePrs);
+
+
/*! Get shrink state of the given presentation in this view.
* \param thePrs Object to get a shrink state of.
* \return TRUE if \a thePrs is shrinked in this view, FALSE overwise.
/*! Set range of the 2D plot to XY axis of the 2D viewer.
*/
void FitRange(in double xMin, in double xMax,
- in double yMin, in double yMax);
+ in double yMin, in double yMax);
void GetFitRanges(out double xMin,out double xMax,
- out double yMin,out double yMax);
+ out double yMin,out double yMax);
};
//-------------------------------------------------------
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# $Header$
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
#
dist_salomeres_DATA = \
ModuleVisu.png \
-SalomeApp.xml \
sprite_alpha.bmp \
sprite_texture.bmp \
Vertex_Program_ARB.txt \
Visu_close.png \
VISU.config \
Visu_cutlines.png \
+Visu_cutsegment.png \
Visu_cutplanes.png \
Visu_deformed_anim.png \
Visu_deformed.png \
Visu_isosurfaces.png \
Visu_load_texture.png \
Visu_ok.png \
-Visu_PlaneSegmentation.png \
Visu_plot2d.png \
Visu_plot3d.png \
Visu_point_selection.png \
+Visu_point_sprite.png \
Visu_points.png \
-Visu_recording_pause.png \
-Visu_recording_play.png \
-Visu_recording_start.png \
Visu_recording_stop.png \
Visu_remove.png \
Visu_sameas.png \
Visu_selectionedge.png \
Visu_selectionpoint.png \
Visu_selectonly.png \
-Visu_SphereSegmentation.png \
Visu_streamlines.png \
Visu_surface.png \
Visu_tree_container.png \
Visu_tree_curve.png \
Visu_tree_cutlines_gr.png \
Visu_tree_cutlines.png \
+Visu_tree_cutsegment_gr.png \
+Visu_tree_cutsegment.png \
Visu_tree_cutplanes_gr.png \
Visu_tree_cutplanes.png \
Visu_tree_deformed_gr.png \
Visu_tree_vectors.png \
Visu_tree_visu.png \
Visu_vectors.png \
-Visu_vvtk_switch.png \
Visu_wireframe.png \
Visu_slider_more.png \
Visu_slider_avi.png \
Visu_planemanager.png
# VSR: little trick to avoid putting if VISUCatalog.xml to the distribution archive
-nodist_salomeres_SCRIPTS = VISUCatalog.xml
+nodist_salomeres_SCRIPTS = VISUCatalog.xml SalomeApp.xml
+++ /dev/null
-<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
-<document>
- <section name="VISU">
- <!-- Major module parameters -->
- <parameter name="name" value="Post-Pro"/>
- <parameter name="icon" value="ModuleVisu.png"/>
- <!-- Other module preferences -->
- <parameter name="display_only" value="false"/>
- <parameter name="show_preview" value="false"/>
- <parameter name="invert_all_curves" value="false"/>
- <parameter name="use_absolute_length" value="false"/>
- <parameter name="generate_data_table" value="true"/>
- <parameter name="generate_curves" value="true"/>
- <parameter name="use_build_progress" value="false"/>
- <parameter name="full_med_loading" value="false"/>
- <parameter name="mesh_represent" value="2"/>
- <parameter name="mesh_shrink" value="false"/>
- <parameter name="scalar_map_represent" value="2"/>
- <parameter name="scalar_map_shrink" value="false"/>
- <parameter name="iso_surfaces_represent" value="2"/>
- <parameter name="cut_planes_represent" value="2"/>
- <parameter name="cut_lines_represent" value="1"/>
- <parameter name="deformed_shape_represent" value="1"/>
- <parameter name="deformed_shape_shrink" value="false"/>
- <parameter name="vectors_represent" value="1"/>
- <parameter name="stream_lines_represent" value="1"/>
- <parameter name="plot3d_represent" value="2"/>
- <parameter name="scalar_def_represent" value="2"/>
- <parameter name="scalar_def_shrink" value="false"/>
- <parameter name="floating_point_precision" value="6"/>
- <parameter name="represent_shading" value="false"/>
- <parameter name="feature_edges_angle" value="30.0"/>
- <parameter name="show_feature_edges" value="true"/>
- <parameter name="show_boundary_edges" value="false"/>
- <parameter name="show_manifold_edges" value="false"/>
- <parameter name="show_non_manifold_edges" value="false"/>
- <parameter name="feature_edges_coloring" value="false"/>
- <parameter name="scalar_bar_horizontal_height" value="0.08"/>
- <parameter name="scalar_bar_horizontal_width" value="0.8" />
- <parameter name="scalar_bar_horizontal_x" value="0.1"/>
- <parameter name="scalar_bar_horizontal_y" value="0.01"/>
- <parameter name="scalar_bar_horizontal_title_size" value="0"/>
- <parameter name="scalar_bar_horizontal_label_size" value="0"/>
- <parameter name="scalar_bar_horizontal_bar_height" value="0"/>
- <parameter name="scalar_bar_horizontal_bar_width" value="0"/>
- <parameter name="scalar_bar_label_color" value="255, 255, 255"/>
- <parameter name="scalar_bar_label_font" value="Arial,Bold,Italic,Shadow,12"/>
- <parameter name="scalar_bar_label_precision" value="3" />
- <parameter name="scalar_bar_logarithmic" value="false"/>
- <!-- RKV : Begin -->
- <!-- Do filter by scalars or don't -->
- <parameter name="scalar_bar_filter_by_scalars" value="false"/>
- <!-- Show distribution curve or don't -->
- <parameter name="scalar_bar_show_distribution" value="false"/>
- <!-- RKV : End -->
- <parameter name="scalar_bar_mode" value="0" />
- <parameter name="scalar_bar_num_colors" value="64"/>
- <parameter name="scalar_bar_num_labels" value="5" />
- <parameter name="scalar_bar_orientation" value="0" />
- <parameter name="scalar_bar_title_color" value="255, 255, 255"/>
- <parameter name="scalar_bar_title_font" value="Arial,Bold,Italic,Shadow,12"/>
- <parameter name="scalar_bar_display_units" value="true"/>
- <parameter name="scalar_bar_vertical_height" value="0.8" />
- <parameter name="scalar_bar_vertical_width" value="0.08"/>
- <parameter name="scalar_bar_vertical_x" value="0.01"/>
- <parameter name="scalar_bar_vertical_y" value="0.1"/>
- <parameter name="scalar_bar_vertical_title_height" value="0"/>
- <parameter name="scalar_bar_vertical_title_width" value="0"/>
- <parameter name="scalar_bar_vertical_label_height" value="0"/>
- <parameter name="scalar_bar_vertical_label_width" value="0"/>
- <parameter name="scalar_bar_vertical_bar_height" value="0"/>
- <parameter name="scalar_bar_vertical_bar_width" value="0"/>
- <parameter name="scalar_range_max" value="0"/>
- <parameter name="scalar_range_min" value="0"/>
- <parameter name="scalar_range_type" value="0"/>
- <parameter name="scalar_bar_display_global" value="true"/>
- <parameter name="scalar_bar_active_local" value="0"/>
- <parameter name="scalar_bar_bicolor" value="1"/>
- <parameter name="scalar_bar_spacing" value="0.01"/>
- <parameter name="sweeping_number_cycles" value="1" />
- <parameter name="sweeping_number_steps" value="20" />
- <parameter name="sweeping_time_step" value="0.2" />
- <parameter name="speed" value="1"/>
- <parameter name="cycled_animation" value="false"/>
- <parameter name="use_proportional_timing" value="false"/>
- <parameter name="clean_memory_at_each_frame" value="false"/>
- <parameter name="mouse_behaviour" value="0" />
- <parameter name="speed_increment" value="10" />
- <parameter name="spacemouse_func1_btn" value="1" />
- <parameter name="spacemouse_func2_btn" value="2" />
- <parameter name="spacemouse_func3_btn" value="10" />
- <parameter name="spacemouse_func4_btn" value="11" />
- <parameter name="spacemouse_func5_btn" value="9" />
- <parameter name="camera_movement_steps" value="10" />
- <parameter name="point_sprite_results" value="true"/>
- <parameter name="point_sprite_primitive_type" value="0" />
- <parameter name="point_sprite_clamp" value="256"/>
- <parameter name="point_sprite_main_texture" value="${VISU_ROOT_DIR}/share/salome/resources/visu/sprite_texture.bmp" />
- <parameter name="point_sprite_alpha_texture" value="${VISU_ROOT_DIR}/share/salome/resources/visu/sprite_alpha.bmp" />
- <parameter name="point_sprite_alpha_threshold" value="0.5"/>
- <parameter name="point_sprite_min_size" value="10" />
- <parameter name="point_sprite_max_size" value="33" />
- <parameter name="point_sprite_magnification" value="100"/>
- <parameter name="point_sprite_increment" value="2" />
- <parameter name="point_sprite_size" value="15"/>
- <parameter name="point_sprite_color" value="0, 0, 255"/>
- <parameter name="geom_sphere_resolution" value="8"/>
- <parameter name="geom_sphere_face_limit" value="50000"/>
- <parameter name="inside_point_sprite_primitive_type" value="0" />
- <parameter name="inside_point_sprite_clamp" value="256"/>
- <parameter name="inside_point_sprite_main_texture" value="${VISU_ROOT_DIR}/share/salome/resources/visu/sprite_texture.bmp" />
- <parameter name="inside_point_sprite_alpha_texture" value="${VISU_ROOT_DIR}/share/salome/resources/visu/sprite_alpha.bmp" />
- <parameter name="inside_point_sprite_alpha_threshold" value="0.5"/>
- <parameter name="inside_point_sprite_min_size" value="10" />
- <parameter name="inside_point_sprite_max_size" value="33" />
- <parameter name="inside_point_sprite_magnification" value="100"/>
- <parameter name="inside_point_sprite_increment" value="2" />
- <parameter name="inside_geom_sphere_resolution" value="8" />
- <parameter name="inside_geom_sphere_face_limit" value="50000"/>
- <parameter name="outside_point_sprite_primitive_type" value="0" />
- <parameter name="outside_point_sprite_clamp" value="256"/>
- <parameter name="outside_point_sprite_main_texture" value="${VISU_ROOT_DIR}/share/salome/resources/visu/sprite_texture.bmp" />
- <parameter name="outside_point_sprite_alpha_texture" value="${VISU_ROOT_DIR}/share/salome/resources/visu/sprite_alpha.bmp" />
- <parameter name="outside_point_sprite_alpha_threshold" value="0.5"/>
- <parameter name="outside_point_sprite_size" value="25" />
- <parameter name="outside_point_sprite_uniform" value="true"/>
- <parameter name="outside_point_sprite_color" value="85, 0, 127"/>
- <parameter name="outside_geom_sphere_resolution" value="8" />
- <parameter name="outside_geom_sphere_face_limit" value="50000"/>
- <parameter name="picking_cursor_size" value="0.5"/>
- <parameter name="picking_pyramid_height" value="1.0"/>
- <parameter name="picking_selection_color" value="255, 255, 0"/>
- <parameter name="picking_point_tolerance" value="0.01"/>
- <parameter name="picking_info_window" value="true" />
- <parameter name="picking_transparency" value="50" />
- <parameter name="picking_position" value="1" />
- <parameter name="picking_camera_movement" value="true" />
- <parameter name="picking_zoom_factor" value="1.5"/>
- <parameter name="picking_step_number" value="10" />
- <parameter name="picking_display_parent_mesh" value="false" />
- <parameter name="build_at_once" value="false"/>
- <parameter name="build_fields" value="true" />
- <parameter name="build_min_max" value="true" />
- <parameter name="build_groups" value="true" />
- <parameter name="close_at_finish" value="true" />
- <parameter name="recorder_mode" value="1" />
- <parameter name="recorder_fps" value="17.3" />
- <parameter name="recorder_quality" value="100" />
- <parameter name="recorder_progressive" value="true" />
- <parameter name="cache_memory_mode" value="1" />
- <parameter name="cache_memory_limit" value="512" />
- <parameter name="values_labeling_color" value="255, 255, 255"/>
- <parameter name="values_labeling_font" value="Arial,Bold,Italic,Shadow,12"/>
- </section>
- <section name="resources">
- <!-- Module resources -->
- <parameter name="VISU" value="${VISU_ROOT_DIR}/share/salome/resources/visu"/>
- </section>
-</document>
--- /dev/null
+<!--
+ Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+
+ Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+ CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<document>
+ <section name="VISU">
+ <!-- Major module parameters -->
+ <parameter name="name" value="Post-Pro"/>
+ <parameter name="icon" value="ModuleVisu.png"/>
+ <parameter name="version" value="@VERSION@"/>
+ <!-- Other module preferences -->
+ <parameter name="display_only" value="false"/>
+ <parameter name="show_preview" value="false"/>
+ <parameter name="invert_all_curves" value="false"/>
+ <parameter name="use_absolute_length" value="false"/>
+ <parameter name="generate_data_table" value="true"/>
+ <parameter name="generate_curves" value="true"/>
+ <parameter name="use_build_progress" value="false"/>
+ <parameter name="full_med_loading" value="false"/>
+ <parameter name="mesh_represent" value="2"/>
+ <parameter name="mesh_shrink" value="false"/>
+ <parameter name="scalar_map_represent" value="2"/>
+ <parameter name="scalar_map_shrink" value="false"/>
+ <parameter name="shrink_factor" value="80"/>
+ <parameter name="iso_surfaces_represent" value="2"/>
+ <parameter name="cut_planes_represent" value="2"/>
+ <parameter name="cut_lines_represent" value="1"/>
+ <parameter name="cut_segment_represent" value="1"/>
+ <parameter name="deformed_shape_represent" value="1"/>
+ <parameter name="deformed_shape_shrink" value="false"/>
+ <parameter name="vectors_represent" value="1"/>
+ <parameter name="stream_lines_represent" value="1"/>
+ <parameter name="plot3d_represent" value="2"/>
+ <parameter name="scalar_def_represent" value="2"/>
+ <parameter name="scalar_def_shrink" value="false"/>
+ <!-- Input field precisions -->
+ <parameter name="length_precision" value="-3" />
+ <parameter name="angle_precision" value="-3" />
+ <parameter name="len_tol_precision" value="3" />
+ <parameter name="parametric_precision" value="-3" />
+ <parameter name="memory_precision" value="1" />
+ <parameter name="visual_data_precision" value="-6"/>
+
+ <parameter name="quadratic_mode" value="0" />
+ <parameter name="max_angle" value="2" />
+ <parameter name="elem0d_size" value="5" />
+ <parameter name="represent_shading" value="false"/>
+ <parameter name="feature_edges_angle" value="30.0"/>
+ <parameter name="show_feature_edges" value="true"/>
+ <parameter name="show_boundary_edges" value="false"/>
+ <parameter name="show_manifold_edges" value="false"/>
+ <parameter name="show_non_manifold_edges" value="false"/>
+ <parameter name="feature_edges_coloring" value="false"/>
+ <parameter name="edge_color" value="255, 255, 255"/>
+ <parameter name="type_of_marker" value="1"/>
+ <parameter name="marker_scale" value="9"/>
+ <parameter name="tables_enable_editing" value="false"/>
+ <parameter name="tables_sort_policy" value="3"/>
+ <parameter name="scalar_bar_horizontal_height" value="0.08"/>
+ <parameter name="scalar_bar_horizontal_width" value="0.8" />
+ <parameter name="scalar_bar_horizontal_x" value="0.1"/>
+ <parameter name="scalar_bar_horizontal_y" value="0.01"/>
+ <parameter name="scalar_bar_horizontal_title_size" value="0"/>
+ <parameter name="scalar_bar_horizontal_label_size" value="0"/>
+ <parameter name="scalar_bar_horizontal_bar_height" value="0"/>
+ <parameter name="scalar_bar_horizontal_bar_width" value="0"/>
+ <parameter name="scalar_bar_label_color" value="255, 255, 255"/>
+ <parameter name="scalar_bar_label_font" value="Arial,Bold,Italic,Shadow,12"/>
+ <parameter name="scalar_bar_label_precision" value="6" />
+ <parameter name="scalar_bar_logarithmic" value="false"/>
+ <!-- RKV : Begin -->
+ <!-- Do filter by scalars or don't -->
+ <parameter name="scalar_bar_filter_by_scalars" value="false"/>
+ <!-- Show distribution curve or don't -->
+ <parameter name="scalar_bar_show_distribution" value="false"/>
+ <!-- RKV : End -->
+ <parameter name="scalar_bar_mode" value="0" />
+ <parameter name="scalar_bar_num_colors" value="64"/>
+ <parameter name="scalar_bar_num_labels" value="5" />
+ <parameter name="scalar_bar_orientation" value="1" />
+ <parameter name="scalar_bar_title_color" value="255, 255, 255"/>
+ <parameter name="scalar_bar_title_font" value="Arial,Bold,Italic,Shadow,12"/>
+ <parameter name="scalar_bar_display_units" value="true"/>
+ <parameter name="scalar_bar_vertical_height" value="0.8" />
+ <parameter name="scalar_bar_vertical_width" value="0.08"/>
+ <parameter name="scalar_bar_vertical_x" value="0.01"/>
+ <parameter name="scalar_bar_vertical_y" value="0.1"/>
+ <parameter name="scalar_bar_vertical_title_size" value="0"/>
+ <parameter name="scalar_bar_vertical_label_size" value="0"/>
+ <parameter name="scalar_bar_vertical_bar_height" value="0"/>
+ <parameter name="scalar_bar_vertical_bar_width" value="0"/>
+ <parameter name="scalar_gauss_metric" value="0" />
+ <parameter name="scalar_range_max" value="0"/>
+ <parameter name="scalar_range_min" value="0"/>
+ <parameter name="scalar_range_type" value="0"/>
+ <parameter name="scalar_bar_display_global" value="true"/>
+ <parameter name="scalar_bar_active_local" value="0"/>
+ <parameter name="scalar_bar_bicolor" value="1"/>
+ <parameter name="scalar_bar_spacing" value="0.01"/>
+ <parameter name="stream_lines_used_points" value="0.01"/>
+ <parameter name="sweeping_number_cycles" value="1" />
+ <parameter name="sweeping_number_steps" value="20" />
+ <parameter name="sweeping_time_step" value="0.2" />
+ <parameter name="sweeping_modes" value="0" />
+ <parameter name="sweeping_is2PI" value="0" />
+ <parameter name="speed" value="1"/>
+ <parameter name="cycled_animation" value="false"/>
+ <parameter name="use_proportional_timing" value="false"/>
+ <parameter name="clean_memory_at_each_frame" value="false"/>
+ <parameter name="dump_mode" value="0"/>
+ <parameter name="time_stamp_frequency" value="1"/>
+ <parameter name="mouse_behaviour" value="0" />
+ <parameter name="speed_increment" value="10" />
+ <parameter name="spacemouse_func1_btn" value="1" />
+ <parameter name="spacemouse_func2_btn" value="2" />
+ <parameter name="spacemouse_func3_btn" value="10" />
+ <parameter name="spacemouse_func4_btn" value="11" />
+ <parameter name="spacemouse_func5_btn" value="9" />
+ <parameter name="camera_movement_steps" value="10" />
+ <parameter name="point_sprite_results" value="true"/>
+ <parameter name="point_sprite_primitive_type" value="0" />
+ <parameter name="point_sprite_clamp" value="256"/>
+ <parameter name="point_sprite_main_texture" value="%VISU_ROOT_DIR%/share/salome/resources/visu/sprite_texture.bmp" />
+ <parameter name="point_sprite_alpha_texture" value="%VISU_ROOT_DIR%/share/salome/resources/visu/sprite_alpha.bmp" />
+ <parameter name="point_sprite_alpha_threshold" value="0.5"/>
+ <parameter name="point_sprite_min_size" value="10" />
+ <parameter name="point_sprite_max_size" value="33" />
+ <parameter name="point_sprite_magnification" value="100"/>
+ <parameter name="point_sprite_increment" value="2" />
+ <parameter name="point_sprite_size" value="15"/>
+ <parameter name="point_sprite_color" value="0, 0, 255"/>
+ <parameter name="geom_sphere_resolution" value="8"/>
+ <parameter name="geom_sphere_face_limit" value="50000"/>
+ <parameter name="inside_point_sprite_primitive_type" value="0" />
+ <parameter name="inside_point_sprite_clamp" value="256"/>
+ <parameter name="inside_point_sprite_main_texture" value="%VISU_ROOT_DIR%/share/salome/resources/visu/sprite_texture.bmp" />
+ <parameter name="inside_point_sprite_alpha_texture" value="%VISU_ROOT_DIR%/share/salome/resources/visu/sprite_alpha.bmp" />
+ <parameter name="inside_point_sprite_alpha_threshold" value="0.5"/>
+ <parameter name="inside_point_sprite_min_size" value="10" />
+ <parameter name="inside_point_sprite_max_size" value="33" />
+ <parameter name="inside_point_sprite_magnification" value="100"/>
+ <parameter name="inside_point_sprite_increment" value="2" />
+ <parameter name="inside_geom_sphere_resolution" value="8" />
+ <parameter name="inside_geom_sphere_face_limit" value="50000"/>
+ <parameter name="outside_point_sprite_primitive_type" value="0" />
+ <parameter name="outside_point_sprite_clamp" value="256"/>
+ <parameter name="outside_point_sprite_main_texture" value="%VISU_ROOT_DIR%/share/salome/resources/visu/sprite_texture.bmp" />
+ <parameter name="outside_point_sprite_alpha_texture" value="%VISU_ROOT_DIR%/share/salome/resources/visu/sprite_alpha.bmp" />
+ <parameter name="outside_point_sprite_alpha_threshold" value="0.5"/>
+ <parameter name="outside_point_sprite_size" value="25" />
+ <parameter name="outside_point_sprite_uniform" value="true"/>
+ <parameter name="outside_point_sprite_color" value="85, 0, 127"/>
+ <parameter name="outside_geom_sphere_resolution" value="8" />
+ <parameter name="outside_geom_sphere_face_limit" value="50000"/>
+ <parameter name="picking_cursor_size" value="0.5"/>
+ <parameter name="picking_pyramid_height" value="1.0"/>
+ <parameter name="picking_selection_color" value="255, 255, 0"/>
+ <parameter name="picking_point_tolerance" value="0.01"/>
+ <parameter name="picking_info_window" value="true" />
+ <parameter name="picking_transparency" value="50" />
+ <parameter name="picking_position" value="1" />
+ <parameter name="picking_camera_movement" value="true" />
+ <parameter name="picking_zoom_factor" value="1.5"/>
+ <parameter name="picking_step_number" value="10" />
+ <parameter name="picking_display_parent_mesh" value="false" />
+ <parameter name="build_at_once" value="false"/>
+ <parameter name="build_fields" value="true" />
+ <parameter name="build_min_max" value="true" />
+ <parameter name="build_groups" value="true" />
+ <parameter name="close_at_finish" value="true" />
+ <parameter name="recorder_mode" value="1" />
+ <parameter name="recorder_fps" value="17.3" />
+ <parameter name="recorder_quality" value="100" />
+ <parameter name="recorder_progressive" value="true" />
+ <parameter name="cache_memory_mode" value="1" />
+ <parameter name="cache_memory_limit" value="512" />
+ <parameter name="values_labeling_color" value="255, 255, 255"/>
+ <parameter name="values_labeling_font" value="Arial,Bold,Italic,Shadow,12"/>
+ <parameter name="documentation" value="visu_help"/>
+ </section>
+ <section name="visu_help" >
+ <parameter name="sub_menu" value="%1 module"/>
+ <parameter name="User's Guide" value="%VISU_ROOT_DIR%/share/doc/salome/gui/VISU/index.html"/>
+ <parameter name="Developer's Guide" value="%VISU_ROOT_DIR%/share/doc/salome/tui/VISU/index.html"/>
+ </section>
+ <section name="resources">
+ <!-- Module resources -->
+ <parameter name="VISU" value="%VISU_ROOT_DIR%/share/salome/resources/visu"/>
+ </section>
+</document>
<?xml version='1.0' encoding='us-ascii' ?>
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
<?xml version='1.0' encoding='us-ascii'?>
<!DOCTYPE application PUBLIC "" "desktop.dtd">
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
<popup-item item-id="4014" pos-id="" label-id="Iso Surfaces" icon-id="Visu_isosurfaces.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="4015" pos-id="" label-id="Cut Planes" icon-id="Visu_cutplane.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="4018" pos-id="" label-id="Cut Lines" icon-id="Visu_cutlines.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="40181" pos-id="" label-id="Cut Segment" icon-id="Visu_cutsegment.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="4016" pos-id="" label-id="Stream Lines" icon-id="Visu_streamlines.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="4017" pos-id="" label-id="Plot 3D" icon-id="Visu_plot3d.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="4020" pos-id="" label-id="Scalar Map on Deformed Shape" icon-id="Visu_scalarmapondeformedshape.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4014" pos-id="" label-id="Iso Surfaces" icon-id="Visu_isosurfaces.png" tooltip-id="Iso Surfaces" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4015" pos-id="" label-id="Cut Planes" icon-id="Visu_cutplane.png" tooltip-id="Cut Planes" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4018" pos-id="" label-id="Cut Lines" icon-id="Visu_cutlines.png" tooltip-id="Cut Lines" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="40181" pos-id="" label-id="Cut Segment" icon-id="Visu_cutsegment.png" tooltip-id="Cut Segment" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4016" pos-id="" label-id="Stream Lines" icon-id="Visu_streamlines.png" tooltip-id="Stream Lines" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4017" pos-id="" label-id="Plot 3D" icon-id="Visu_plot3d.png" tooltip-id="Plot 3D" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4020" pos-id="" label-id="Scalar map on deformed shape" icon-id="Visu_scalarmapondeformedshape.png" tooltip-id="Scalar Map on Deformed Shape" accel-id="" toggle-id="" execute-action=""/>
<?xml version='1.0' encoding='us-ascii'?>
<!DOCTYPE application PUBLIC "" "desktop.dtd">
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
<popup-item item-id="4014" pos-id="" label-id="Iso Surfaces" icon-id="Visu_isosurfaces.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="4015" pos-id="" label-id="Cut Planes" icon-id="Visu_cutplane.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="4018" pos-id="" label-id="Cut Lines" icon-id="Visu_cutlines.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="40181" pos-id="" label-id="Cut Lines" icon-id="Visu_cutsegment.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="4016" pos-id="" label-id="Stream Lines" icon-id="Visu_streamlines.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="4017" pos-id="" label-id="Plot 3D" icon-id="Visu_plot3d.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="4020" pos-id="" label-id="Scalar Map on Deformed Shape" icon-id="Visu_scalarmapondeformedshape.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4014" pos-id="" label-id="Iso Surfaces" icon-id="Visu_isosurfaces.png" tooltip-id="Iso Surfaces" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4015" pos-id="" label-id="Cut Planes" icon-id="Visu_cutplane.png" tooltip-id="Cut Planes" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4018" pos-id="" label-id="Cut Lines" icon-id="Visu_cutlines.png" tooltip-id="Cut Lines" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="40181" pos-id="" label-id="Cut Segment" icon-id="Visu_cutsegment.png" tooltip-id="Cut Segment" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4016" pos-id="" label-id="Stream Lines" icon-id="Visu_streamlines.png" tooltip-id="Stream Lines" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4017" pos-id="" label-id="Plot 3D" icon-id="Visu_plot3d.png" tooltip-id="Plot 3D" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4020" pos-id="" label-id="Scalar map on deformed shape" icon-id="Visu_scalarmapondeformedshape.png" tooltip-id="Scalar Map on Deformed Shape" accel-id="" toggle-id="" execute-action=""/>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU OBJECT : interactive object for VISU entities implementation
# File : Makefile.am
# Module : VISU
@MED_CXXFLAGS@ \
@GUI_CXXFLAGS@ \
$(BOOST_CPPFLAGS) \
- -I$(top_builddir)/salome_adm/unix \
$(MED_CPPFLAGS)
libVisuConvertor_la_LDFLAGS= \
- $(MED2_LIBS) \
+ $(MED3_LIBS) \
+ $(BOOST_LIB_THREAD) \
+ $(BOOST_LIB_DATE_TIME) \
+ $(VTK_LIBS) \
$(QT_LIBS) \
+ $(KERNEL_LDFLAGS) -lSALOMEBasics \
$(CAS_KERNEL) \
$(CAS_MATH) \
- $(BOOST_LIBS) -lboost_thread@BOOST_LIBSUFFIX@ \
- $(MED_LDFLAGS) -lMEDWrapper \
- $(GUI_LDFLAGS) -lVTKViewer \
- $(VTK_LIBS)
+ $(MED_LDFLAGS) -lMEDWrapper -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase \
+ $(GUI_LDFLAGS) -lVTKViewer
# Executables targets
bin_PROGRAMS= VISUConvertor
dist_VISUConvertor_SOURCES= VISUConvertor.cxx
VISUConvertor_CPPFLAGS=$(libVisuConvertor_la_CPPFLAGS)
VISUConvertor_LDADD=$(libVisuConvertor_la_LDFLAGS) \
- -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase -lMEDWrapper -lmed_V2_1 -lVTKViewer -lsuit -lqtx libVisuConvertor.la
+ -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase -lMEDWrapper -lVTKViewer -lsuit -lqtx libVisuConvertor.la
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISUConvertor.cxx
// Author: Alexey PETROV
#include "VISU_Convertor_impl.hxx"
#include "VISU_TableReader.hxx"
-#include <fstream>
-#include <strstream>
-#include <memory>
+#include <fstream>
+#include <sstream>
+#include <memory>
#include <vtkCellType.h>
#include <vtkUnstructuredGrid.h>
//Import fields
aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
- const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
- const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
- const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- VISU::TFieldMap::const_reverse_iterator aFieldMapIter = aFieldMap.rbegin();
- for(; aFieldMapIter != aFieldMap.rend(); aFieldMapIter++){
- const string& aFieldName = aFieldMapIter->first;
- const VISU::PField& aField = aFieldMapIter->second;
- const VISU::TValField& aValField = aField->myValField;
- VISU::TValField::const_iterator aValFieldIter = aValField.begin();
- for(; aValFieldIter != aValField.end(); aValFieldIter++){
- int aTimeStamp = aValFieldIter->first;
-
- if(anEntity != VISU::NODE_ENTITY){
- VISU::PGaussPtsIDMapper aGaussMesh =
- aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
+ const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
+ const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+ const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ VISU::TFieldMap::const_reverse_iterator aFieldMapIter = aFieldMap.rbegin();
+ for(; aFieldMapIter != aFieldMap.rend(); aFieldMapIter++){
+ const string& aFieldName = aFieldMapIter->first;
+ const VISU::PField& aField = aFieldMapIter->second;
+ const VISU::TValField& aValField = aField->myValField;
+ VISU::TValField::const_iterator aValFieldIter = aValField.begin();
+ for(; aValFieldIter != aValField.end(); aValFieldIter++){
+ int aTimeStamp = aValFieldIter->first;
+
+ if(anEntity != VISU::NODE_ENTITY){
+ VISU::PGaussPtsIDMapper aGaussMesh =
+ aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
#ifdef _DEBUG_ID_MAPPING_
- vtkDataSet* aDataSet = aGaussMesh->GetOutput();
- aDataSet->Update();
- int aNbCells = aDataSet->GetNumberOfCells();
- MESSAGE("aNbCells = "<<aNbCells);
- for(int anCellId = 0; anCellId < aNbCells; anCellId++){
- VISU::TGaussPointID anObjID = aGaussMesh->GetObjID(anCellId);
- cout<<anObjID.first<<"; "<<anObjID.second<<"; "<<aGaussMesh->GetNodeVTKID(anObjID.first)<<endl;
- vtkFloatingPointType* aCoord = aGaussMesh->GetNodeCoord(anCellId);
- cout<<aCoord[0]<<"; "<<aCoord[1]<<"; "<<aCoord[2]<<endl;
- }
+ vtkDataSet* aDataSet = aGaussMesh->GetOutput();
+ aDataSet->Update();
+ int aNbCells = aDataSet->GetNumberOfCells();
+ MESSAGE("aNbCells = "<<aNbCells);
+ for(int anCellId = 0; anCellId < aNbCells; anCellId++){
+ VISU::TGaussPointID anObjID = aGaussMesh->GetObjID(anCellId);
+ cout<<anObjID.first<<"; "<<anObjID.second<<"; "<<aGaussMesh->GetNodeVTKID(anObjID.first)<<endl;
+ vtkFloatingPointType* aCoord = aGaussMesh->GetNodeCoord(anCellId);
+ cout<<aCoord[0]<<"; "<<aCoord[1]<<"; "<<aCoord[2]<<endl;
+ }
#endif
- }else{
- //continue;
- VISU::PIDMapper anIDMapper =
- aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+ }else{
+ //continue;
+ VISU::PIDMapper anIDMapper =
+ aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
#ifdef _DEBUG_ID_MAPPING_
- vtkDataSet* aDataSet = anIDMapper->GetOutput();
- aDataSet->Update();
- int aNbCells = aDataSet->GetNumberOfCells();
- for(int anCellId = 0; anCellId < aNbCells; anCellId++){
- int anObjID = anIDMapper->GetElemObjID(anCellId);
- int aVTKID = anIDMapper->GetElemVTKID(anObjID);
- cout<<anObjID<<"; "<<aVTKID<<endl;
- }
+ vtkDataSet* aDataSet = anIDMapper->GetOutput();
+ aDataSet->Update();
+ int aNbCells = aDataSet->GetNumberOfCells();
+ for(int anCellId = 0; anCellId < aNbCells; anCellId++){
+ int anObjID = anIDMapper->GetElemObjID(anCellId);
+ int aVTKID = anIDMapper->GetElemVTKID(anObjID);
+ cout<<anObjID<<"; "<<aVTKID<<endl;
+ }
#endif
- }
- //goto OK;
- }
- }
+ }
+ //goto OK;
+ }
+ }
}
//Importing groups
const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
- const string& aGroupName = aGroupMapIter->first;
- aCon->GetMeshOnGroup(aMeshName,aGroupName);
+ const string& aGroupName = aGroupMapIter->first;
+ aCon->GetMeshOnGroup(aMeshName,aGroupName);
}
//continue;
//Import mesh on entity
aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
- const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
- VISU::PIDMapper anIDMapper = aCon->GetMeshOnEntity(aMeshName,anEntity);
+ const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
+ VISU::PIDMapper anIDMapper = aCon->GetMeshOnEntity(aMeshName,anEntity);
#ifdef _DEBUG_ID_MAPPING_
- vtkDataSet* aDataSet = anIDMapper->GetOutput();
- int aNbCells, anCellId, anObjID, aVTKID;
- aNbCells = aDataSet->GetNumberOfCells();
- for(anCellId = 0; anCellId < aNbCells; anCellId++){
- anObjID = anIDMapper->GetElemObjID(anCellId);
- aVTKID = anIDMapper->GetElemVTKID(anObjID);
- MESSAGE(anObjID<<"; "<<aVTKID);
- }
+ vtkDataSet* aDataSet = anIDMapper->GetOutput();
+ int aNbCells, anCellId, anObjID, aVTKID;
+ aNbCells = aDataSet->GetNumberOfCells();
+ for(anCellId = 0; anCellId < aNbCells; anCellId++){
+ anObjID = anIDMapper->GetElemObjID(anCellId);
+ aVTKID = anIDMapper->GetElemVTKID(anObjID);
+ MESSAGE(anObjID<<"; "<<aVTKID);
+ }
#endif
}
//Import families
aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
- const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
- const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
- //aCon->GetMeshOnEntity(aMeshName,anEntity);
- const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
- VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
- for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
- const string& aFamilyName = aFamilyMapIter->first;
- aCon->GetFamilyOnEntity(aMeshName,anEntity,aFamilyName);
- }
+ const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
+ const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+ //aCon->GetMeshOnEntity(aMeshName,anEntity);
+ const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+ VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
+ for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
+ const string& aFamilyName = aFamilyMapIter->first;
+ aCon->GetFamilyOnEntity(aMeshName,anEntity,aFamilyName);
+ }
}
}
OK:
QFileInfo aFileInfo( argv[1] );
for ( int i = 0; i < 1; i++ ) {
if ( aFileInfo.exists() ) {
- if ( aFileInfo.isDir() ) {
- QDir aDir( aFileInfo.absoluteFilePath() );
- QStringList wildcards; wildcards << "*.med";
- QStringList aStringList = aDir.entryList( wildcards, QDir::Files );
- int jEnd = aStringList.count();
- for ( int j = 0; j < jEnd; j++ ) {
- ParseMEDFile( aDir.filePath( aStringList[j] ).toLatin1().data() );
- }
- } else {
- QString anExtension = aFileInfo.suffix();
- if ( anExtension == "med" )
- ParseMEDFile( argv[1] );
- else if ( anExtension == "xls" || anExtension == "txt" )
- ParseXLSFile( argv[1] );
- }
+ if ( aFileInfo.isDir() ) {
+ QDir aDir( aFileInfo.absoluteFilePath() );
+ QStringList wildcards; wildcards << "*.med";
+ QStringList aStringList = aDir.entryList( wildcards, QDir::Files );
+ int jEnd = aStringList.count();
+ for ( int j = 0; j < jEnd; j++ ) {
+ ParseMEDFile( aDir.filePath( aStringList[j] ).toLatin1().data() );
+ }
+ } else {
+ QString anExtension = aFileInfo.suffix();
+ if ( anExtension == "med" )
+ ParseMEDFile( argv[1] );
+ else if ( anExtension == "xls" || anExtension == "txt" )
+ ParseXLSFile( argv[1] );
+ }
}
}
return 0;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISUConvertor.hxx
// Author : Oleg UVAROV
// Module : VISU
#define _VISUConvertor_HXX_
#ifdef WNT
- #if defined VISU_CONVERTOR_EXPORTS
+ #if defined VISU_CONVERTOR_EXPORTS || defined VisuConvertor_EXPORTS
#if defined WIN32
#define VISU_CONVERTOR_EXPORT __declspec( dllexport )
#else
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME OBJECT : kernel of SALOME component
// File : VISU_GeometryFilter.cxx
// Author :
int
VISU_AppendFilter
::RequestData(vtkInformation *theRequest,
- vtkInformationVector **theInputVector,
- vtkInformationVector *theOutputVector)
+ vtkInformationVector **theInputVector,
+ vtkInformationVector *theOutputVector)
{
bool anIsExecuted = false;
if( IsMergingInputs() || IsMappingInputs() )
anIsExecuted = VISU::UnstructuredGridRequestData(theInputVector,
- GetNumberOfInputConnections( 0 ),
- theOutputVector,
- GetSharedPointSet(),
- IsMergingInputs(),
- IsMappingInputs());
+ GetNumberOfInputConnections( 0 ),
+ theOutputVector,
+ GetSharedPointSet(),
+ IsMergingInputs(),
+ IsMappingInputs());
if( !anIsExecuted )
anIsExecuted = Superclass::RequestData(theRequest,
- theInputVector,
- theOutputVector);
+ theInputVector,
+ theOutputVector);
return anIsExecuted;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VISU_APPENDFILTER_H
#define VISU_APPENDFILTER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME OBJECT : kernel of SALOME component
// File : VISU_GeometryFilter.cxx
// Author :
//---------------------------------------------------------------
void
DoMergingInputs(vtkCellData *theCellData,
- TInputId theInputId,
- TObject2InputIdMap& theResult)
+ TInputId theInputId,
+ TObject2InputIdMap& theResult)
{
if(vtkDataArray *aDataArray = theCellData->GetArray("VISU_CELLS_MAPPER")){
if(vtkIntArray *anIntArray = dynamic_cast<vtkIntArray*>(aDataArray)){
int *aPointer = anIntArray->GetPointer(0);
int aNbCells = anIntArray->GetNumberOfTuples();
- for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){
+ for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){
int aObjId = *aPointer++;
int anEntity = *aPointer++;
- TObjectId anObjectId(aObjId, anEntity);
- TObject2InputIdMap::iterator anIter = theResult.find(anObjectId);
- if(anIter != theResult.end())
- continue;
- TInputCellId anInputCellId(theInputId, aCellId);
- theResult.insert(anIter, TObject2InputIdMap::value_type(anObjectId, anInputCellId));
- }
+ TObjectId anObjectId(aObjId, anEntity);
+ TObject2InputIdMap::iterator anIter = theResult.find(anObjectId);
+ if(anIter != theResult.end())
+ continue;
+ TInputCellId anInputCellId(theInputId, aCellId);
+ theResult.insert(anIter, TObject2InputIdMap::value_type(anObjectId, anInputCellId));
+ }
}
}
}
{
vtkCellData *aCellData = theDataSet->GetCellData();
if(myIsFirstCellData){
- myFieldList.InitializeFieldList(aCellData);
- myIsFirstCellData = false;
+ myFieldList.InitializeFieldList(aCellData);
+ myIsFirstCellData = false;
}else{
- myFieldList.IntersectFieldList(aCellData);
+ myFieldList.IntersectFieldList(aCellData);
}
}
template<class TFunctor>
void
ForEachInput(vtkInformationVector **theInputVector,
- vtkIdType theNumberOfInputConnections,
- TFunctor& theFunctor)
+ vtkIdType theNumberOfInputConnections,
+ TFunctor& theFunctor)
{
for(vtkIdType anInputId = 0; anInputId < theNumberOfInputConnections; anInputId++)
if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId))
- if(aDataSet->GetNumberOfPoints() > 0 && aDataSet->GetNumberOfCells() > 0)
- theFunctor(anInputId, aDataSet);
+ if(aDataSet->GetNumberOfPoints() > 0 && aDataSet->GetNumberOfCells() > 0)
+ theFunctor(anInputId, aDataSet);
}
template<class TDataSet>
bool
RequestData(vtkInformationVector **theInputVector,
- vtkIdType theNumberOfInputConnections,
- vtkInformationVector *theOutputVector,
- vtkPointSet* theSharedPointSet,
- bool theIsMergingInputs,
- bool theIsMappingInputs)
+ vtkIdType theNumberOfInputConnections,
+ vtkInformationVector *theOutputVector,
+ vtkPointSet* theSharedPointSet,
+ bool theIsMergingInputs,
+ bool theIsMappingInputs)
{
if ( theNumberOfInputConnections == 1 ) {
// get the input and ouptut
vtkDataSet* anOutput = VISU::GetOutput( theOutputVector );
if ( anInput->GetDataObjectType() != anOutput->GetDataObjectType() )
- return false;
+ return false;
// This has to be here because it initialized all field datas.
anOutput->CopyStructure( anInput );
if ( theSharedPointSet ) {
vtkPoints* aPoints = theSharedPointSet->GetPoints();
if(aPoints->GetNumberOfPoints() < 1)
- return true;
+ return true;
TDataSet* anOutput = TDataSet::SafeDownCast(VISU::GetOutput(theOutputVector));
vtkIdType anNbInputs = theNumberOfInputConnections;
if ( theIsMergingInputs ) {
- TCellIdMerger aFunctor(anNbInputs);
- ForEachInput<TCellIdMerger>(theInputVector, anNbInputs, aFunctor);
-
- vtkDataSetAttributes::FieldList& aFieldList = aFunctor.myFieldList;
- TObject2InputIdMap& anObject2InputIdMap = aFunctor.myObject2InputIdMap;
- vtkIdType aNbCells = aFunctor.GetNbCells();
- if(aNbCells < 1)
- return true;
+ TCellIdMerger aFunctor(anNbInputs);
+ ForEachInput<TCellIdMerger>(theInputVector, anNbInputs, aFunctor);
+
+ vtkDataSetAttributes::FieldList& aFieldList = aFunctor.myFieldList;
+ TObject2InputIdMap& anObject2InputIdMap = aFunctor.myObject2InputIdMap;
+ vtkIdType aNbCells = aFunctor.GetNbCells();
+ if(aNbCells < 1)
+ return true;
- // Now can allocate memory
- anOutput->Allocate(aNbCells);
- vtkCellData *anOutputCellData = anOutput->GetCellData();
- anOutputCellData->CopyAllocate(aFieldList, aNbCells);
+ // Now can allocate memory
+ anOutput->Allocate(aNbCells);
+ vtkCellData *anOutputCellData = anOutput->GetCellData();
+ anOutputCellData->CopyAllocate(aFieldList, aNbCells);
- // Append each input dataset together
- // 1.points
- anOutput->SetPoints(theSharedPointSet->GetPoints());
- anOutput->GetPointData()->PassData(theSharedPointSet->GetPointData());
+ // Append each input dataset together
+ // 1.points
+ anOutput->SetPoints(theSharedPointSet->GetPoints());
+ anOutput->GetPointData()->PassData(theSharedPointSet->GetPointData());
- // 2.cells
- vtkIdList *anIdList = vtkIdList::New();
- anIdList->Allocate(VTK_CELL_SIZE);
- TObject2InputIdMap::const_iterator anIter = anObject2InputIdMap.begin();
- TObject2InputIdMap::const_iterator anEndIter = anObject2InputIdMap.end();
- for(; anIter != anEndIter; anIter++){
- //TObjectId anObjectId = anIter->first;
- const TInputCellId& anInputCellId = anIter->second;
- TInputId anInputId = anInputCellId.first;
- if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){
- TCellId aCellId = anInputCellId.second;
- aDataSet->GetCellPoints(aCellId, anIdList);
-
- vtkIdType aCellType = aDataSet->GetCellType(aCellId);
- vtkIdType aNewCellId = anOutput->InsertNextCell(aCellType, anIdList);
-
- vtkCellData *aCellData = aDataSet->GetCellData();
- anOutputCellData->CopyData(aFieldList, aCellData, anInputId, aCellId, aNewCellId);
- }
- }
- anIdList->Delete();
-
- if(theIsMappingInputs){
- vtkIntArray *aDataArray = vtkIntArray::New();
- aDataArray->SetName("VISU_INPUTS_MAPPER");
- aDataArray->SetNumberOfComponents(2);
- aDataArray->SetNumberOfTuples(aNbCells);
-
- vtkIdType aTupleId = 0;
- TObject2InputIdMap::const_iterator anIter = anObject2InputIdMap.begin();
- TObject2InputIdMap::const_iterator anEndIter = anObject2InputIdMap.end();
- for(vtkIdType aCellId = 0; anIter != anEndIter; anIter++, aCellId++){
- const TInputCellId& anInputCellId = anIter->second;
- TInputId anInputId = anInputCellId.first;
- /*TCellId*/ aCellId = anInputCellId.second;
- aDataArray->SetValue(aTupleId++, anInputId);
- aDataArray->SetValue(aTupleId++, aCellId);
- }
-
- anOutputCellData->AddArray(aDataArray);
- aDataArray->Delete();
- }
-
- return true;
+ // 2.cells
+ vtkIdList *anIdList = vtkIdList::New();
+ anIdList->Allocate(VTK_CELL_SIZE);
+ TObject2InputIdMap::const_iterator anIter = anObject2InputIdMap.begin();
+ TObject2InputIdMap::const_iterator anEndIter = anObject2InputIdMap.end();
+ for(; anIter != anEndIter; anIter++){
+ //TObjectId anObjectId = anIter->first;
+ const TInputCellId& anInputCellId = anIter->second;
+ TInputId anInputId = anInputCellId.first;
+ if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){
+ TCellId aCellId = anInputCellId.second;
+ aDataSet->GetCellPoints(aCellId, anIdList);
+
+ vtkIdType aCellType = aDataSet->GetCellType(aCellId);
+ vtkIdType aNewCellId = anOutput->InsertNextCell(aCellType, anIdList);
+
+ vtkCellData *aCellData = aDataSet->GetCellData();
+ anOutputCellData->CopyData(aFieldList, aCellData, anInputId, aCellId, aNewCellId);
+ }
+ }
+ anIdList->Delete();
+
+ if(theIsMappingInputs){
+ vtkIntArray *aDataArray = vtkIntArray::New();
+ aDataArray->SetName("VISU_INPUTS_MAPPER");
+ aDataArray->SetNumberOfComponents(2);
+ aDataArray->SetNumberOfTuples(aNbCells);
+
+ vtkIdType aTupleId = 0;
+ TObject2InputIdMap::const_iterator anIter = anObject2InputIdMap.begin();
+ TObject2InputIdMap::const_iterator anEndIter = anObject2InputIdMap.end();
+ for(vtkIdType aCellId = 0; anIter != anEndIter; anIter++, aCellId++){
+ const TInputCellId& anInputCellId = anIter->second;
+ TInputId anInputId = anInputCellId.first;
+ /*TCellId*/ aCellId = anInputCellId.second;
+ aDataArray->SetValue(aTupleId++, anInputId);
+ aDataArray->SetValue(aTupleId++, aCellId);
+ }
+
+ anOutputCellData->AddArray(aDataArray);
+ aDataArray->Delete();
+ }
+
+ return true;
}else{
- TCellCounter aFunctor(anNbInputs);
- ForEachInput<TCellCounter>(theInputVector, anNbInputs, aFunctor);
-
- vtkDataSetAttributes::FieldList& aFieldList = aFunctor.myFieldList;
- vtkIdType aNbCells = aFunctor.GetNbCells();
- if(aNbCells < 1)
- return true;
-
- // Now can allocate memory
- anOutput->Allocate(aNbCells);
- vtkCellData *anOutputCellData = anOutput->GetCellData();
- anOutputCellData->CopyAllocate(aFieldList, aNbCells);
-
- // Append each input dataset together
- // 1.points
- anOutput->SetPoints(theSharedPointSet->GetPoints());
- anOutput->GetPointData()->PassData(theSharedPointSet->GetPointData());
-
- // 2.cells
- vtkIdList *anIdList = vtkIdList::New();
- anIdList->Allocate(VTK_CELL_SIZE);
- for(vtkIdType anInputId = 0; anInputId < anNbInputs; anInputId++){
- if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){
- vtkIdType aNbCells = aDataSet->GetNumberOfCells();
- vtkCellData *aCellData = aDataSet->GetCellData();
- // copy cell and cell data
- for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){
- aDataSet->GetCellPoints(aCellId, anIdList);
-
- vtkIdType aCellType = aDataSet->GetCellType(aCellId);
- vtkIdType aNewCellId = anOutput->InsertNextCell(aCellType, anIdList);
-
- anOutputCellData->CopyData(aFieldList, aCellData, anInputId, aCellId, aNewCellId);
- }
- }
- }
- anIdList->Delete();
-
- if(theIsMappingInputs){
- vtkIntArray *aDataArray = vtkIntArray::New();
- aDataArray->SetName("VISU_INPUTS_MAPPER");
- aDataArray->SetNumberOfComponents(2);
- aDataArray->SetNumberOfTuples(aNbCells);
-
- vtkIdType aTupleId = 0;
- for(vtkIdType anInputId = 0; anInputId < anNbInputs; anInputId++){
- if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){
- vtkIdType aNbCells = aDataSet->GetNumberOfCells();
- for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){
- aDataArray->SetValue(aTupleId++, aCellId);
- aDataArray->SetValue(aTupleId++, anInputId);
- }
- }
- }
-
- anOutputCellData->AddArray(aDataArray);
- aDataArray->Delete();
- }
- return true;
+ TCellCounter aFunctor(anNbInputs);
+ ForEachInput<TCellCounter>(theInputVector, anNbInputs, aFunctor);
+
+ vtkDataSetAttributes::FieldList& aFieldList = aFunctor.myFieldList;
+ vtkIdType aNbCells = aFunctor.GetNbCells();
+ if(aNbCells < 1)
+ return true;
+
+ // Now can allocate memory
+ anOutput->Allocate(aNbCells);
+ vtkCellData *anOutputCellData = anOutput->GetCellData();
+ anOutputCellData->CopyAllocate(aFieldList, aNbCells);
+
+ // Append each input dataset together
+ // 1.points
+ anOutput->SetPoints(theSharedPointSet->GetPoints());
+ anOutput->GetPointData()->PassData(theSharedPointSet->GetPointData());
+
+ // 2.cells
+ vtkIdList *anIdList = vtkIdList::New();
+ anIdList->Allocate(VTK_CELL_SIZE);
+ for(vtkIdType anInputId = 0; anInputId < anNbInputs; anInputId++){
+ if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){
+ vtkIdType aNbCells = aDataSet->GetNumberOfCells();
+ vtkCellData *aCellData = aDataSet->GetCellData();
+ // copy cell and cell data
+ for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){
+ aDataSet->GetCellPoints(aCellId, anIdList);
+
+ vtkIdType aCellType = aDataSet->GetCellType(aCellId);
+ vtkIdType aNewCellId = anOutput->InsertNextCell(aCellType, anIdList);
+
+ anOutputCellData->CopyData(aFieldList, aCellData, anInputId, aCellId, aNewCellId);
+ }
+ }
+ }
+ anIdList->Delete();
+
+ if(theIsMappingInputs){
+ vtkIntArray *aDataArray = vtkIntArray::New();
+ aDataArray->SetName("VISU_INPUTS_MAPPER");
+ aDataArray->SetNumberOfComponents(2);
+ aDataArray->SetNumberOfTuples(aNbCells);
+
+ vtkIdType aTupleId = 0;
+ for(vtkIdType anInputId = 0; anInputId < anNbInputs; anInputId++){
+ if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){
+ vtkIdType aNbCells = aDataSet->GetNumberOfCells();
+ for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){
+ aDataArray->SetValue(aTupleId++, aCellId);
+ aDataArray->SetValue(aTupleId++, anInputId);
+ }
+ }
+ }
+
+ anOutputCellData->AddArray(aDataArray);
+ aDataArray->Delete();
+ }
+ return true;
}
}
//---------------------------------------------------------------
bool
UnstructuredGridRequestData(vtkInformationVector **theInputVector,
- vtkIdType theNumberOfInputConnections,
- vtkInformationVector *theOutputVector,
- vtkPointSet* theSharedPointSet,
- bool theIsMergingInputs,
- bool theIsMappingInputs)
+ vtkIdType theNumberOfInputConnections,
+ vtkInformationVector *theOutputVector,
+ vtkPointSet* theSharedPointSet,
+ bool theIsMergingInputs,
+ bool theIsMappingInputs)
{
return RequestData<vtkUnstructuredGrid>(theInputVector,
- theNumberOfInputConnections,
- theOutputVector,
- theSharedPointSet,
- theIsMergingInputs,
- theIsMappingInputs);
+ theNumberOfInputConnections,
+ theOutputVector,
+ theSharedPointSet,
+ theIsMergingInputs,
+ theIsMappingInputs);
}
//---------------------------------------------------------------
bool
PolyDataRequestData(vtkInformationVector **theInputVector,
- vtkIdType theNumberOfInputConnections,
- vtkInformationVector *theOutputVector,
- vtkPointSet* theSharedPointSet,
- bool theIsMergingInputs,
- bool theIsMappingInputs)
+ vtkIdType theNumberOfInputConnections,
+ vtkInformationVector *theOutputVector,
+ vtkPointSet* theSharedPointSet,
+ bool theIsMergingInputs,
+ bool theIsMappingInputs)
{
return RequestData<vtkPolyData>(theInputVector,
- theNumberOfInputConnections,
- theOutputVector,
- theSharedPointSet,
- theIsMergingInputs,
- theIsMappingInputs);
+ theNumberOfInputConnections,
+ theOutputVector,
+ theSharedPointSet,
+ theIsMergingInputs,
+ theIsMappingInputs);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VISU_APPENDFILTERUTILITIES_H
#define VISU_APPENDFILTERUTILITIES_H
class vtkPointSet;
class vtkObject;
-#include <VISU_Convertor.hxx>
+#include "VISU_Convertor.hxx"
#include <vtkSmartPointer.h>
namespace VISU
TAppendFilterHelper(TAppendFilterHelper&);
public:
- void
+ void
SetSharedPointSet(vtkPointSet* thePointSet);
vtkPointSet*
//---------------------------------------------------------------
bool
UnstructuredGridRequestData(vtkInformationVector **theInputVector,
- vtkIdType theNumberOfInputConnections,
- vtkInformationVector *theOutputVector,
- vtkPointSet* theSharedPointSet,
- bool theIsMergingInputs,
- bool theIsMappingInputs);
+ vtkIdType theNumberOfInputConnections,
+ vtkInformationVector *theOutputVector,
+ vtkPointSet* theSharedPointSet,
+ bool theIsMergingInputs,
+ bool theIsMappingInputs);
//---------------------------------------------------------------
bool
PolyDataRequestData(vtkInformationVector **theInputVector,
- vtkIdType theNumberOfInputConnections,
- vtkInformationVector *theOutputVector,
- vtkPointSet* theSharedPointSet,
- bool theIsMergingInputs,
- bool theIsMappingInputs);
+ vtkIdType theNumberOfInputConnections,
+ vtkInformationVector *theOutputVector,
+ vtkPointSet* theSharedPointSet,
+ bool theIsMergingInputs,
+ bool theIsMappingInputs);
}
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME OBJECT : kernel of SALOME component
// File : VTKViewer_GeometryFilter.cxx
// Author :
int
VISU_AppendPolyData
::RequestData(vtkInformation *theRequest,
- vtkInformationVector **theInputVector,
- vtkInformationVector *theOutputVector)
+ vtkInformationVector **theInputVector,
+ vtkInformationVector *theOutputVector)
{
bool anIsExecuted = false;
if(GetNumberOfInputConnections(0) > 1 || IsMergingInputs() || IsMappingInputs())
anIsExecuted = VISU::PolyDataRequestData(theInputVector,
- this->GetNumberOfInputConnections(0),
- theOutputVector,
- GetSharedPointSet(),
- IsMergingInputs(),
- IsMappingInputs());
+ this->GetNumberOfInputConnections(0),
+ theOutputVector,
+ GetSharedPointSet(),
+ IsMergingInputs(),
+ IsMappingInputs());
if(!anIsExecuted)
anIsExecuted = Superclass::RequestData(theRequest,
- theInputVector,
- theOutputVector);
+ theInputVector,
+ theOutputVector);
return anIsExecuted;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VISU_APPENDPOLYDATA_H
#define VISU_APPENDPOLYDATA_H
/*! \brief This class used same as vtkAppendFilter. See documentation on VTK for more information.
*/
class VISU_AppendPolyData : public vtkAppendPolyData,
- public VISU::TAppendFilterHelper
+ public VISU::TAppendFilterHelper
{
public:
/*! \fn static VTKViewer_AppendFilter *New()
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_CommonCellsFilter.cxx
// Created : Wed Apr 4 08:45:07 2007
// Author : Eugeny NIKOLAEV (enk)
//anOutput->GetPointData()->GetArray("VISU_CELLS_MAPPER")->SetName("VISU_POINTS_MAPPER");
// apply VISU_POINTS_MAPPER
- int anEntity = int(VISU::NODE_ENTITY);
+ int anEntity = int(VISU::NODE_ENTITY);
vtkIntArray* aNewPointsIdsArray = vtkIntArray::New();
aNewPointsIdsArray->SetName("VISU_POINTS_MAPPER");
aNewPointsIdsArray->SetNumberOfComponents(2);
aNewPointsIdsArray->SetNumberOfTuples(aPointIdsForCopy->GetNumberOfIds());
- int *aPtr = aNewPointsIdsArray->GetPointer(0);
+ int *aPtr = aNewPointsIdsArray->GetPointer(0);
for(int i = 0; i < aPointIdsForCopy->GetNumberOfIds(); i++){
- *aPtr++ = aPointIdsForCopy->GetId(i);
- *aPtr++ = anEntity;
- }
+ *aPtr++ = aPointIdsForCopy->GetId(i);
+ *aPtr++ = anEntity;
+ }
anOutput->GetPointData()->AddArray(aNewPointsIdsArray);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_CommonCellsFilter.hxx
// Created : Tue Apr 3 16:16:53 2007
// Author : Eugeny NIKOLAEV (enk)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_Convertor.cxx
// Author: Alexey PETROV
std::string
VISU_Convertor
::GenerateName(const std::string& theName,
- unsigned int theTimeId)
+ unsigned int theTimeId)
{
static QString aName;
aName = QString(theName.c_str()).simplified();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU CONVERTOR :
// File : VISU_Convertor.hxx
// Author : Alexey PETROV
virtual
VISU::PNamedIDMapper
GetMeshOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity) = 0;
+ const VISU::TEntity& theEntity) = 0;
//! Get amount of memory to build mesh for corresponding MED ENTITY
virtual
size_t
GetMeshOnEntitySize(const std::string& theMeshName,
- const VISU::TEntity& theEntity) = 0;
+ const VISU::TEntity& theEntity) = 0;
//! Get mesh for corresponding MED FAMILY
virtual
VISU::PUnstructuredGridIDMapper
GetFamilyOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName) = 0;
//! Get amount of memory to build mesh for corresponding MED FAMILY
virtual
size_t
GetFamilyOnEntitySize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName) = 0;
//! Get mesh for corresponding MED GROUP
virtual
VISU::PUnstructuredGridIDMapper
GetMeshOnGroup(const std::string& theMeshName,
- const std::string& theGroupName) = 0;
+ const std::string& theGroupName) = 0;
//! Get amount of memory to build mesh for corresponding MED GROUP
virtual
size_t
GetMeshOnGroupSize(const std::string& theMeshName,
- const std::string& theGroupName) = 0;
+ const std::string& theGroupName) = 0;
//! Get mesh with attached values for corresponding MED TIMESTAMP
virtual
VISU::PUnstructuredGridIDMapper
GetTimeStampOnMesh(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber) = 0;
//! Get Gauss Points mesh with attached values for corresponding MED TIMESTAMP
virtual
VISU::PGaussPtsIDMapper
GetTimeStampOnGaussPts(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber) = 0;
//! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on mesh
virtual
size_t
GetTimeStampOnMeshSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber,
- bool& theIsEstimated) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber,
+ bool& theIsEstimated) = 0;
//! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on Gauss Points
virtual
size_t
GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber,
- bool& theIsEstimated) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber,
+ bool& theIsEstimated) = 0;
//! Get amount of memory to build all MED TIMESTAMPS for corresponding MED FIELD
virtual
size_t
GetFieldOnMeshSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName) = 0;
//! Find MED FIELD container
virtual
const VISU::PField
GetField(const std::string& theMeshName,
- VISU::TEntity theEntity,
- const std::string& theFieldName) = 0;
+ VISU::TEntity theEntity,
+ const std::string& theFieldName) = 0;
//! Find MED TIMESTAMP container
virtual
const VISU::PValForTime
GetTimeStamp(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber) = 0;
//! Allow to generate pretty name for MED TIMESTAMP
static
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU CONVERTOR :
// File :
// Author :
//---------------------------------------------------------------
//! Defines VISU enumeration of geometrical types
enum EGeometry {ePOINT1=1, eSEG2=102, eSEG3=103, eTRIA3=203,
- eQUAD4=204, eTRIA6=206,eQUAD8=208, eTETRA4=304,
- ePYRA5=305, ePENTA6=306, eHEXA8=308, eTETRA10=310,
- ePYRA13=313, ePENTA15=315, eHEXA20=320,
- ePOLYGONE=400, ePOLYEDRE=500, eNONE=-1};
+ eQUAD4=204, eTRIA6=206,eQUAD8=208, eQUAD9=209, eTETRA4=304,
+ ePYRA5=305, ePENTA6=306, eHEXA8=308, eOCTA12=312, eTETRA10=310,
+ ePYRA13=313, ePENTA15=315, eHEXA20=320, eHEXA27=327,
+ ePOLYGONE=400, ePOLYEDRE=500, eNONE=-1};
+
+
+ //---------------------------------------------------------------
+ //! Enumeration used to extract different kinds of values from the data on gauss points
+ enum TGaussMetric { AVERAGE_METRIC = 0, MINIMUM_METRIC, MAXIMUM_METRIC };
//---------------------------------------------------------------
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU CONVERTOR :
// File :
// Author :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Convertor_impl.cxx
// Author : Alexey PETROV
return 3;
case VISU::eQUAD8:
return 4;
+ case VISU::eQUAD9:
+ return 4;
case VISU::eTETRA10:
return 4;
case VISU::eHEXA20:
return 8;
+ case VISU::eHEXA27:
+ return 8;
case VISU::ePENTA15:
return 6;
case VISU::ePYRA13:
return VTK_WEDGE;
case VISU::ePYRA5:
return VTK_PYRAMID;
-
+ case VISU::eOCTA12:
+ return VTK_HEXAGONAL_PRISM;
case VISU::ePOLYGONE:
return VTK_POLYGON;
case VISU::ePOLYEDRE:
return VTK_TRIANGLE;
case VISU::eQUAD8:
return VTK_QUAD;
+ case VISU::eQUAD9:
+ return VTK_QUAD;
case VISU::eTETRA10:
return VTK_TETRA;
case VISU::eHEXA20:
return VTK_HEXAHEDRON;
+ case VISU::eHEXA27:
+ return VTK_TRIQUADRATIC_HEXAHEDRON;
case VISU::ePENTA15:
return VTK_WEDGE;
case VISU::ePYRA13:
#else
case VISU::eSEG3:
-#if defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)
+#if defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_EDGE;
#else
return VTK_POLY_LINE;
#endif
case VISU::eTRIA6:
-#if defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)
+#if defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_TRIANGLE;
#else
return VTK_POLYGON;
#endif
case VISU::eQUAD8:
-#if defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)
+#if defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_QUAD;
#else
return VTK_POLYGON;
#endif
+ case VISU::eQUAD9:
+#if defined(VISU_USE_VTK_QUADRATIC)
+ return VTK_BIQUADRATIC_QUAD;
+#else
+ return VTK_POLYGON;
+#endif
+
case VISU::eTETRA10:
-#if defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)
+#if defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_TETRA;
#else
return VTK_CONVEX_POINT_SET;
#endif
case VISU::eHEXA20:
-#if defined(VTK_QUADRATIC_HEXAHEDRON) && defined(VISU_USE_VTK_QUADRATIC)
+#if defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_HEXAHEDRON;
#else
return VTK_CONVEX_POINT_SET;
#endif
+ case VISU::eHEXA27:
+#if defined(VISU_USE_VTK_QUADRATIC)
+ return VTK_TRIQUADRATIC_HEXAHEDRON;
+#else
+ return VTK_CONVEX_POINT_SET;
+#endif
+
case VISU::ePENTA15:
-#if defined(VTK_QUADRATIC_WEDGE) && defined(VISU_USE_VTK_QUADRATIC)
+#if defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_WEDGE;
#else
return VTK_CONVEX_POINT_SET;
#endif
case VISU::ePYRA13:
-#if defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)
+#if defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_PYRAMID;
#else
return VTK_CONVEX_POINT_SET;
//---------------------------------------------------------------
void
WriteToFile(vtkUnstructuredGrid* theDataSet,
- const std::string& theFileName)
+ const std::string& theFileName)
{
vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New();
//aWriter->SetFileType(VTK_BINARY);
//---------------------------------------------------------------
void
WriteToFile(vtkPolyData* theDataSet,
- const std::string& theFileName)
+ const std::string& theFileName)
{
vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New();
//aWriter->SetFileType(VTK_BINARY);
if ( vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData() )
if ( aDataSetAttributes->GetArray( "ELNO_FIELD" ) != NULL )
- return true;
+ return true;
if ( vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetPointData() )
if ( aDataSetAttributes->GetArray( "ELNO_POINT_COORDS" ) != NULL )
- return true;
+ return true;
return false;
}
int aNbTuples = anIntArray->GetNumberOfTuples();
int* aPointer = anIntArray->GetPointer(0);
for(int aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
- if(*aPointer == theID && *(aPointer + 1) == theEntity){
- return aTupleId;
- }
- aPointer += 2;
+ if(*aPointer == theID && *(aPointer + 1) == theEntity){
+ return aTupleId;
+ }
+ aPointer += 2;
}
}
return -1;
vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData();
if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_CELLS_MAPPER")){
if(theEntity < 0){
- {
- vtkIdType anID = GetVTKID(aDataArray, theID, VISU::CELL_ENTITY);
- if(anID != -1)
- return anID;
- }
- {
- vtkIdType anID = GetVTKID(aDataArray, theID, VISU::FACE_ENTITY);
- if(anID != -1)
- return anID;
- }
- {
- vtkIdType anID = GetVTKID(aDataArray, theID, VISU::EDGE_ENTITY);
- if(anID != -1)
- return anID;
- }
- {
- vtkIdType anID = GetVTKID(aDataArray, theID, VISU::NODE_ENTITY);
- if(anID != -1)
- return anID;
- }
+ {
+ vtkIdType anID = GetVTKID(aDataArray, theID, VISU::CELL_ENTITY);
+ if(anID != -1)
+ return anID;
+ }
+ {
+ vtkIdType anID = GetVTKID(aDataArray, theID, VISU::FACE_ENTITY);
+ if(anID != -1)
+ return anID;
+ }
+ {
+ vtkIdType anID = GetVTKID(aDataArray, theID, VISU::EDGE_ENTITY);
+ if(anID != -1)
+ return anID;
+ }
+ {
+ vtkIdType anID = GetVTKID(aDataArray, theID, VISU::NODE_ENTITY);
+ if(anID != -1)
+ return anID;
+ }
}else
- return GetVTKID(aDataArray, theID, theEntity);
+ return GetVTKID(aDataArray, theID, theEntity);
}
return -1;
}
vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData();
if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_CELLS_MAPPER")){
if(vtkIntArray *anIntArray = dynamic_cast<vtkIntArray*>(aDataArray)){
- vtkIdType anID = 2 * theID;
- TCellID aCellID = anIntArray->GetValue(anID);
- TLocalPntID aLocalPntID = anIntArray->GetValue(anID + 1);
- return TGaussPointID(aCellID, aLocalPntID);
+ vtkIdType anID = 2 * theID;
+ TCellID aCellID = anIntArray->GetValue(anID);
+ TLocalPntID aLocalPntID = anIntArray->GetValue(anID + 1);
+ return TGaussPointID(aCellID, aLocalPntID);
}
}
return TGaussPointID();
vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData();
if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_INPUTS_MAPPER")){
if(vtkIntArray *anIntArray = dynamic_cast<vtkIntArray*>(aDataArray)){
- vtkIdType aVTKID = GetElemVTKID(theDataSet, theObjID);
- vtkIdType aTupleID = 2 * aVTKID;
- TCellID aCellID = anIntArray->GetValue(aTupleID);
- TInputID anInputID = anIntArray->GetValue(aTupleID + 1);
- return TInputCellID(anInputID, aCellID);
+ vtkIdType aVTKID = GetElemVTKID(theDataSet, theObjID);
+ vtkIdType aTupleID = 2 * aVTKID;
+ TCellID aCellID = anIntArray->GetValue(aTupleID);
+ TInputID anInputID = anIntArray->GetValue(aTupleID + 1);
+ return TInputCellID(anInputID, aCellID);
}
}
return TInputCellID();
//---------------------------------------------------------------
vtkDataSet*
GetInput(vtkInformationVector **theInputVector,
- vtkIdType theInputId)
+ vtkIdType theInputId)
{
if(vtkInformation* anInformation = theInputVector[0]->GetInformationObject(theInputId))
return vtkDataSet::SafeDownCast(anInformation->Get(vtkDataObject::DATA_OBJECT()));
//---------------------------------------------------------------
TTimerLog
::TTimerLog(int theIsDebug,
- const std::string& theName):
+ const std::string& theName):
myIsDebug(MYDEBUG + theIsDebug),
myTimerLog(vtkTimerLog::New()),
myPrefixPrinter(myIsDebug == 1),
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ConvertorUtils.hxx
// Author : Alexey PETROV
class vtkTimerLog;
class vtkDataSet;
class vtkCell;
+class vtkDataArray;
#ifndef VISU_ENABLE_QUADRATIC
#define VISU_ENABLE_QUADRATIC
VISU_CONVERTOR_EXPORT
void
WriteToFile(vtkUnstructuredGrid* theDataSet,
- const std::string& theFileName);
+ const std::string& theFileName);
//---------------------------------------------------------------
VISU_CONVERTOR_EXPORT
void
WriteToFile(vtkPolyData* theDataSet,
- const std::string& theFileName);
+ const std::string& theFileName);
//---------------------------------------------------------------
VISU_CONVERTOR_EXPORT
vtkDataSet*
GetInput(vtkInformationVector **theInputVector,
- vtkIdType theInputId = 0);
+ vtkIdType theInputId = 0);
VISU_CONVERTOR_EXPORT
vtkDataSet*
GetOutput(vtkInformationVector *theOutputVector);
+ VISU_CONVERTOR_EXPORT
+ vtkIdType
+ GetObjectID(vtkDataArray *theIDDataArray, vtkIdType theID);
+
+ VISU_CONVERTOR_EXPORT
+ vtkIdType
+ GetVTKID(vtkDataArray *theIDDataArray, vtkIdType theID, int theEntity);
+
+
//! Utility for ELNO Data Selection
//---------------------------------------------------------------
typedef vtkIdType TVTKPointID;
public:
TTimerLog(int theIsDebug,
- const std::string& theName);
+ const std::string& theName);
~TTimerLog();
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Convertor_impl.cxx
// Author : Alexey PETROV
inline
void
PrintCells( vtkCellArray* theConnectivity,
- const VISU::TConnect& theVector)
+ const VISU::TConnect& theVector)
{
theConnectivity->InsertNextCell( theVector.size(), &theVector[ 0 ] );
}
//---------------------------------------------------------------
void
GetCellsOnSubMesh(const VISU::PUnstructuredGrid& theSource,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PSubMeshImpl& theSubMesh,
- const vtkIdType theGeom)
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PSubMeshImpl& theSubMesh,
+ const vtkIdType theGeom)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"GetCellsOnSubMesh");
const VISU::TCell2Connect& anArray = theSubMesh->myCell2Connect;
vtkIdType aCellsSize = theSubMesh->myCellsSize;
vtkIdType aNbCells = theSubMesh->myNbCells;
INITMSG(MYDEBUG,"GetCellsOnSubMesh "<<
- "- theGeom = "<<theGeom<<
- "; aNbCells = "<<aNbCells<<
- endl);
+ "- theGeom = "<<theGeom<<
+ "; aNbCells = "<<aNbCells<<
+ endl);
vtkCellArray* aConnectivity = vtkCellArray::New();
aDataArray->SetNumberOfTuples(aNbTuples);
int *aDataArrayPtr = aDataArray->GetPointer(0);
for(int aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
- int anObjID = theSubMesh->GetElemObjID(aTupleId);
+ int anObjID = theSubMesh->GetElemObjID(aTupleId);
*aDataArrayPtr++ = anObjID;
*aDataArrayPtr++ = anEntity;
}
//---------------------------------------------------------------
void
GetCellsOnFamily(const VISU::PUnstructuredGrid& theSource,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PFamilyImpl& theFamily)
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PFamilyImpl& theFamily)
{
INITMSG(MYDEBUG,"GetCellsOnFamily"<<endl);
const VISU::TGeom2SubMeshID& aGeom2SubMeshID = theFamily->myGeom2SubMeshID;
if(aGeom2SubMeshID.empty())
- EXCEPTION(std::runtime_error,"GetCells >> There is no elements on the family !!!");
+ EXCEPTION(std::runtime_error,"GetCells >> There is no elements on the family !!!");
VISU::TGeom2SubMeshID::const_iterator aGeom2SubMeshIDIter = aGeom2SubMeshID.find(aEGeom);
if(aGeom2SubMeshIDIter == aGeom2SubMeshID.end())
- continue;
+ continue;
const VISU::TSubMeshID& aSubMeshID = aGeom2SubMeshIDIter->second;
INITMSG(MYDEBUG,
- " - aEGeom = "<<aEGeom<<
- "; aVGeom = "<<aVGeom<<
- "; aSubMeshID.size() = "<<aSubMeshID.size()<<
- endl);
+ " - aEGeom = "<<aEGeom<<
+ "; aVGeom = "<<aVGeom<<
+ "; aSubMeshID.size() = "<<aSubMeshID.size()<<
+ endl);
VISU::TSubMeshID::const_iterator aSubMeshIDIter = aSubMeshID.begin();
for(; aSubMeshIDIter != aSubMeshID.end(); aSubMeshIDIter++, aCellId++){
- vtkIdType anID = *aSubMeshIDIter;
- PrintCells( aConnectivity, anArray[ anID ] );
- aCellTypesArray->SetValue(aCellId, (unsigned char)aVGeom);
- vtkIdType anObjID = aSubMesh.GetElemObjID(anID);
- anElemObj2VTKID[anObjID] = aCellId;
- aMeshID[aCellId] = anObjID;
+ vtkIdType anID = *aSubMeshIDIter;
+ PrintCells( aConnectivity, anArray[ anID ] );
+ aCellTypesArray->SetValue(aCellId, (unsigned char)aVGeom);
+ vtkIdType anObjID = aSubMesh.GetElemObjID(anID);
+ anElemObj2VTKID[anObjID] = aCellId;
+ aMeshID[aCellId] = anObjID;
*aDataArrayPtr++ = anObjID;
*aDataArrayPtr++ = anEntity;
}
//---------------------------------------------------------------
void
GetCells(const VISU::PUnstructuredGrid& theSource,
- const VISU::PSubProfileImpl& theSubProfile,
- const VISU::PProfileImpl& theProfile,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity)
+ const VISU::PSubProfileImpl& theSubProfile,
+ const VISU::PProfileImpl& theProfile,
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity)
{
vtkIdType aNbCells = theSubProfile->myNbCells;
vtkIdType aCellsSize = theSubProfile->myCellsSize;
if(theSubProfile->myStatus == VISU::eAddAll){
VISU::TCell2Connect::const_iterator anIter = aCell2Connect.begin();
for(vtkIdType anId = 0, aConnId = 0; anIter != aCell2Connect.end(); anIter++){
- const VISU::TConnect& anArray = aCell2Connect[anId];
- PrintCells( aConnectivity, anArray );
- aCellTypesArray->SetValue(anId,(unsigned char)aVGeom);
- aConnId += aNbNodes;
- anId++;
+ const VISU::TConnect& anArray = aCell2Connect[anId];
+ PrintCells( aConnectivity, anArray );
+ aCellTypesArray->SetValue(anId,(unsigned char)aVGeom);
+ aConnId += aNbNodes;
+ anId++;
}
}else{
VISU::TSubMeshID::const_iterator anIter = aSubMeshID.begin();
for(vtkIdType anId = 0, aConnId = 0; anIter != aSubMeshID.end(); anIter++){
- vtkIdType aSubId = *anIter;
- const VISU::TConnect& anArray = aCell2Connect[aSubId];
- PrintCells( aConnectivity, anArray );
- aCellTypesArray->SetValue(anId,(unsigned char)aVGeom);
- aConnId += aNbNodes;
- anId++;
+ vtkIdType aSubId = *anIter;
+ const VISU::TConnect& anArray = aCell2Connect[aSubId];
+ PrintCells( aConnectivity, anArray );
+ aCellTypesArray->SetValue(anId,(unsigned char)aVGeom);
+ aConnId += aNbNodes;
+ anId++;
}
}
aDataArray->SetNumberOfTuples(aNbTuples);
int *aDataArrayPtr = aDataArray->GetPointer(0);
for(int aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
- int anObjID = theSubProfile->GetElemObjID(aTupleId);
+ int anObjID = theSubProfile->GetElemObjID(aTupleId);
*aDataArrayPtr++ = anObjID;
*aDataArrayPtr++ = anEntity;
}
//---------------------------------------------------------------
void
GetMeshOnSubProfile(const VISU::PMeshImpl& theMesh,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PProfileImpl& theProfile,
- const VISU::PSubProfileImpl& theSubProfile)
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PProfileImpl& theProfile,
+ const VISU::PSubProfileImpl& theSubProfile,
+ const bool checkEntity = true)
{
INITMSG(MYDEBUG,"GetMeshOnSubProfile - aEGeom = "<<theSubProfile->myGeom<<endl);
+
+ //rnv to fix the: 21040: [CEA 428] Bug of visualization of node field on profile
+ //throw exception in case if the profile on node.
+ //This exception catch in tne VISU_Convertor_impl::GetTimeStampOnMesh(...) function.
+ if( theMeshOnEntity->myEntity == VISU::CELL_ENTITY &&
+ theSubProfile->myGeom == VISU::ePOINT1 &&
+ !theSubProfile->isDefault() && checkEntity )
+ EXCEPTION(std::runtime_error,"theMeshOnEntity->myEntity == VISU::CELL_ENTITY && theSubProfile->myGeom == VISU::ePOINT1 && theSubProfile->isDefault()");
const VISU::PUnstructuredGrid& aSource = theSubProfile->GetSource();
if(theSubProfile->myIsVTKDone)
//---------------------------------------------------------------
bool
GetMeshOnProfile(const VISU::PMeshImpl& theMesh,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PProfileImpl& theProfile)
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PProfileImpl& theProfile,
+ const bool checkEntity = true)
{
- //rnv fix for bug IPAL18514 4x (CRASH after trying to build of presentation):
+ //rnv fix for bug IPAL18514 4x (CRASH after trying to build of presentation):
// throw exection in case if pointer on profile =0
if(!theProfile.get())
EXCEPTION(std::runtime_error,"GetMeshOnProfile: theProfile.get() == NULL");
VISU::TGeom2SubProfile::const_iterator anIter = aGeom2SubProfile.begin();
for(vtkIdType anInputID = 0, aCellID = 0; anIter != aGeom2SubProfile.end(); anIter++){
- VISU::PSubProfileImpl aSubProfile = anIter->second;
- if(aSubProfile->myStatus == VISU::eRemoveAll)
- continue;
-
- GetMeshOnSubProfile(theMesh,
- theMeshOnEntity,
- theProfile,
- aSubProfile);
-
- const VISU::PUnstructuredGrid& aSource = aSubProfile->GetSource();
- anAppendFilter->AddInput(aSource.GetPointer());
-
- vtkIdType aNbCells = aSource->GetNumberOfCells();
- for(vtkIdType aCell = 0; aCell < aNbCells; aCell++, aCellID++){
- vtkIdType anObjID = aSubProfile->GetElemObjID(aCell);
- anElemObj2VTKID[anObjID] = aCellID;
- }
-
- aSubProfileArr[anInputID++] = aSubProfile;
+ VISU::PSubProfileImpl aSubProfile = anIter->second;
+ if(aSubProfile->myStatus == VISU::eRemoveAll)
+ continue;
+
+ GetMeshOnSubProfile(theMesh,
+ theMeshOnEntity,
+ theProfile,
+ aSubProfile,
+ checkEntity);
+
+ const VISU::PUnstructuredGrid& aSource = aSubProfile->GetSource();
+ anAppendFilter->AddInput(aSource.GetPointer());
+
+ vtkIdType aNbCells = aSource->GetNumberOfCells();
+ for(vtkIdType aCell = 0; aCell < aNbCells; aCell++, aCellID++){
+ vtkIdType anObjID = aSubProfile->GetElemObjID(aCell);
+ anElemObj2VTKID[anObjID] = aCellID;
+ }
+
+ aSubProfileArr[anInputID++] = aSubProfile;
}
}
anAppendFilter->Update(); // Fix on VTK
//---------------------------------------------------------------
void
GetGaussSubMeshSource(const VISU::PPolyData& theSource,
- const VISU::PGaussSubMeshImpl& theGaussSubMesh,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity)
+ const VISU::PGaussSubMeshImpl& theGaussSubMesh,
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity)
{
vtkCellArray* aConnectivity = vtkCellArray::New();
vtkIdType aCellsSize = theGaussSubMesh->myCellsSize;
aDataArray->SetNumberOfTuples(aNbTuples);
int *aDataArrayPtr = aDataArray->GetPointer(0);
for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
- vtkIdType aGlobalID = theGaussSubMesh->GetGlobalID(aTupleId);
- *aDataArrayPtr++ = aGlobalID;
- *aDataArrayPtr++ = 0;
+ vtkIdType aGlobalID = theGaussSubMesh->GetGlobalID(aTupleId);
+ *aDataArrayPtr++ = aGlobalID;
+ *aDataArrayPtr++ = 0;
}
aSource->GetPointData()->AddArray(aDataArray);
aDataArray->Delete();
aDataArray->SetNumberOfTuples(aNbTuples);
int *aDataArrayPtr = aDataArray->GetPointer(0);
for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
- VISU::TGaussPointID aGaussPointID = theGaussSubMesh->GetObjID(aTupleId);
- *aDataArrayPtr++ = aGaussPointID.first;
- *aDataArrayPtr++ = aGaussPointID.second;
+ VISU::TGaussPointID aGaussPointID = theGaussSubMesh->GetObjID(aTupleId);
+ *aDataArrayPtr++ = aGaussPointID.first;
+ *aDataArrayPtr++ = aGaussPointID.second;
}
aSource->GetCellData()->AddArray(aDataArray);
aDataArray->Delete();
//---------------------------------------------------------------
void
GetGaussSubMesh(const VISU::PMeshImpl& theMesh,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PGaussMeshImpl& theGaussMesh,
- const VISU::PGaussSubMeshImpl& theGaussSubMesh)
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PGaussMeshImpl& theGaussMesh,
+ const VISU::PGaussSubMeshImpl& theGaussSubMesh)
{
VISU::PGaussImpl aGauss = theGaussSubMesh->myGauss;
//---------------------------------------------------------------
void
BuildGaussMesh(const VISU::PMeshImpl& theMesh,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PGaussMeshImpl& theGaussMesh)
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PGaussMeshImpl& theGaussMesh)
{
if(theGaussMesh->myIsVTKDone)
return;
for(vtkIdType aStartID = 0; anIter != aGeom2GaussSubMesh.end(); anIter++){
VISU::PGaussSubMeshImpl aGaussSubMesh = anIter->second;
if(aGaussSubMesh->myStatus == VISU::eRemoveAll)
- continue;
+ continue;
aGaussSubMesh->myStartID = aStartID;
GetGaussSubMesh(theMesh,
- theMeshOnEntity,
- theGaussMesh,
- aGaussSubMesh);
+ theMeshOnEntity,
+ theGaussMesh,
+ aGaussSubMesh);
const VISU::PPolyData& aSource = aGaussSubMesh->GetSource();
aStartID += aSource->GetNumberOfCells();
VISU::PNamedIDMapper
VISU_Convertor_impl
::GetMeshOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity)
+ const VISU::TEntity& theEntity)
{
INITMSG(MYDEBUG,"GetMeshOnEntity"<<
- "; theMeshName = '"<<theMeshName<<"'"<<
- "; theEntity = "<<theEntity<<
- endl);
+ "; theMeshName = '"<<theMeshName<<"'"<<
+ "; theEntity = "<<theEntity<<
+ endl);
//Cheching possibility do the query
TFindMeshOnEntity aFindMeshOnEntity =
aSubMeshArr.resize(aGeom2SubMesh.size());
for(vtkIdType anID = 0, aCellID = 0; anIter != aGeom2SubMesh.end(); anIter++, anID++){
- VISU::EGeometry aEGeom = anIter->first;
- vtkIdType aVGeom = VISUGeom2VTK(aEGeom);
- VISU::PSubMeshImpl aSubMesh = anIter->second;
+ VISU::EGeometry aEGeom = anIter->first;
+ vtkIdType aVGeom = VISUGeom2VTK(aEGeom);
+ VISU::PSubMeshImpl aSubMesh = anIter->second;
- aSubMesh->CopyStructure( aMesh );
+ aSubMesh->CopyStructure( aMesh );
- aSubMesh->myStartID = aCellID;
+ aSubMesh->myStartID = aCellID;
- const VISU::PUnstructuredGrid& aSource = aSubMesh->GetSource();
- GetCellsOnSubMesh(aSource, aMeshOnEntity, aSubMesh, aVGeom);
- anAppendFilter->AddInput(aSource.GetPointer());
-
- vtkIdType aNbCells = aSource->GetNumberOfCells();
- for(vtkIdType aCell = 0; aCell < aNbCells; aCell++, aCellID++){
- vtkIdType anObjID = aSubMesh->GetElemObjID(aCell);
- anElemObj2VTKID[anObjID] = aCellID;
- }
+ const VISU::PUnstructuredGrid& aSource = aSubMesh->GetSource();
+ GetCellsOnSubMesh(aSource, aMeshOnEntity, aSubMesh, aVGeom);
+ anAppendFilter->AddInput(aSource.GetPointer());
+
+ vtkIdType aNbCells = aSource->GetNumberOfCells();
+ for(vtkIdType aCell = 0; aCell < aNbCells; aCell++, aCellID++){
+ vtkIdType anObjID = aSubMesh->GetElemObjID(aCell);
+ anElemObj2VTKID[anObjID] = aCellID;
+ }
- aSubMeshArr[anID] = aSubMesh;
+ aSubMeshArr[anID] = aSubMesh;
}
aMeshOnEntity->CopyStructure( aMesh );
aMeshOnEntity->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
- std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
- std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
- aFileName += aMeshName + dtos("-%d-",int(theEntity)) + "-MeshOnEntity.vtk";
- VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName);
+ std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
+ std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
+ aFileName += aMeshName + dtos("-%d-",int(theEntity)) + "-MeshOnEntity.vtk";
+ VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName);
}
if(MYVTKDEBUG){
- GetMeshOnEntitySize(theMeshName,theEntity);
- PrintMemorySize(anAppendFilter->GetOutput());
+ GetMeshOnEntitySize(theMeshName,theEntity);
+ PrintMemorySize(anAppendFilter->GetOutput());
}
}
VISU::PUnstructuredGridIDMapper
VISU_Convertor_impl
::GetFamilyOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName)
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName)
{
INITMSG(MYDEBUG,"GetFamilyOnEntity"<<
- "; theMeshName = '"<<theMeshName<<"'"<<
- "; theEntity = "<<theEntity<<
- "; theFamilyName = '"<<theFamilyName<<"'"<<
- endl);
+ "; theMeshName = '"<<theMeshName<<"'"<<
+ "; theEntity = "<<theEntity<<
+ "; theFamilyName = '"<<theFamilyName<<"'"<<
+ endl);
//Cheching possibility do the query
TFindFamilyOnEntity aFindFamilyOnEntity =
aFamily->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
- std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
- std::string aFamilyName = (const char*)QString(theFamilyName.c_str()).simplified().toLatin1();
- std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
- aFileName += aMeshName + dtos("-%d-",int(theEntity)) + aFamilyName + "-FamilyOnEntity.vtk";
- VISU::WriteToFile(aSource.GetPointer(),aFileName);
+ std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
+ std::string aFamilyName = (const char*)QString(theFamilyName.c_str()).simplified().toLatin1();
+ std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
+ aFileName += aMeshName + dtos("-%d-",int(theEntity)) + aFamilyName + "-FamilyOnEntity.vtk";
+ VISU::WriteToFile(aSource.GetPointer(),aFileName);
}
if(MYVTKDEBUG){
- GetFamilyOnEntitySize(theMeshName,theEntity,theFamilyName);
- PrintMemorySize(aSource.GetPointer());
+ GetFamilyOnEntitySize(theMeshName,theEntity,theFamilyName);
+ PrintMemorySize(aSource.GetPointer());
}
}
VISU::PUnstructuredGridIDMapper
VISU_Convertor_impl
::GetMeshOnGroup(const std::string& theMeshName,
- const std::string& theGroupName)
+ const std::string& theGroupName)
{
INITMSG(MYDEBUG,"GetMeshOnGroup\n");
INITMSGA(MYDEBUG,0,
- "- theMeshName = '"<<theMeshName<<
- "'; theGroupName = '"<<theGroupName<<"'"<<
- endl);
+ "- theMeshName = '"<<theMeshName<<
+ "'; theGroupName = '"<<theGroupName<<"'"<<
+ endl);
//Cheching possibility do the query
TFindMeshOnGroup aFindMeshOnGroup = FindMeshOnGroup(theMeshName,theGroupName);
aFamilyArr.resize(aFamilySet.size());
for(vtkIdType anID = 0; anIter != aFamilySet.end(); anIter++, anID++){
- VISU::PFamilyImpl aFamily = *anIter;
- const std::string& aFamilyName = aFamily->myName;
- const VISU::TEntity& anEntity = aFamily->myEntity;
-
- VISU::PIDMapper anIDMapper = GetFamilyOnEntity(theMeshName,anEntity,aFamilyName);
- vtkDataSet* anOutput = anIDMapper->GetOutput();
- anAppendFilter->AddInput(anOutput);
-
- vtkIdType aStartID = anElemObj2VTKID.size();
- vtkIdType aNbCells = anOutput->GetNumberOfCells();
- for(vtkIdType aCellID = 0; aCellID < aNbCells; aCellID++){
- anElemObj2VTKID[aFamily->GetElemObjID(aCellID)] = aStartID + aCellID;
- }
- aFamilyArr[anID] = aFamily;
+ VISU::PFamilyImpl aFamily = (*anIter).second;
+ const std::string& aFamilyName = aFamily->myName;
+ const VISU::TEntity& anEntity = aFamily->myEntity;
+
+ VISU::PIDMapper anIDMapper = GetFamilyOnEntity(theMeshName,anEntity,aFamilyName);
+ vtkDataSet* anOutput = anIDMapper->GetOutput();
+ anAppendFilter->AddInput(anOutput);
+
+ vtkIdType aStartID = anElemObj2VTKID.size();
+ vtkIdType aNbCells = anOutput->GetNumberOfCells();
+ for(vtkIdType aCellID = 0; aCellID < aNbCells; aCellID++){
+ anElemObj2VTKID[aFamily->GetElemObjID(aCellID)] = aStartID + aCellID;
+ }
+ aFamilyArr[anID] = aFamily;
}
aGroup->CopyStructure( aMesh );
aGroup->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
- std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
- std::string aGroupName = (const char*)QString(theGroupName.c_str()).simplified().toLatin1();
- std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
- aFileName += aMeshName + "-" + aGroupName + "-MeshOnGroup.vtk";
- VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName);
+ std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
+ std::string aGroupName = (const char*)QString(theGroupName.c_str()).simplified().toLatin1();
+ std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
+ aFileName += aMeshName + "-" + aGroupName + "-MeshOnGroup.vtk";
+ VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName);
}
}
#ifndef _DEXCEPT_
vtkUnstructuredGrid*
VISU_Convertor_impl
::GetTimeStampOnProfile( const VISU::PMeshImpl& theMesh,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PFieldImpl& theField,
- const VISU::PValForTimeImpl& theValForTime,
- const VISU::PUnstructuredGridIDMapperImpl& theUnstructuredGridIDMapper,
- const VISU::PProfileImpl& theProfile,
- const VISU::TEntity& theEntity )
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PFieldImpl& theField,
+ const VISU::PValForTimeImpl& theValForTime,
+ const VISU::PUnstructuredGridIDMapperImpl& theUnstructuredGridIDMapper,
+ const VISU::PProfileImpl& theProfile,
+ const VISU::TEntity& theEntity )
{
LoadMeshOnEntity( theMesh, theMeshOnEntity );
GetMeshOnEntity( theMeshOnEntity->myMeshName, theMeshOnEntity->myEntity );
const VISU::EGeometry& aGeom = aSubProfileIter->first;
const VISU::PSubProfileImpl& aSubProfile = aSubProfileIter->second;
if ( aSubProfile->myStatus == VISU::eAddPart && aGeom == VISU::ePOINT1 ) {
- const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
- VISU::TMeshOnEntityMap::const_reverse_iterator aMeshOnEntityIter = aMeshOnEntityMap.rbegin();
- for( ; aMeshOnEntityIter != aMeshOnEntityMap.rend(); aMeshOnEntityIter++ ) {
- VISU::TEntity anEntity = aMeshOnEntityIter->first;
- if ( anEntity == VISU::NODE_ENTITY )
- continue;
- VISU::PNamedIDMapper aNamedIDMapper = GetMeshOnEntity( theMesh->myName, anEntity );
- if( aNamedIDMapper ) {
- theUnstructuredGridIDMapper->SetReferencedMesh( aNamedIDMapper );
- VISU::PUnstructuredGrid aSource = theUnstructuredGridIDMapper->GetSource();
- VISU::GetTimeStampOnProfile( aSource, theField, theValForTime, theEntity );
-
- return theUnstructuredGridIDMapper->GetUnstructuredGridOutput();
- }
- }
+ const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
+ VISU::TMeshOnEntityMap::const_reverse_iterator aMeshOnEntityIter = aMeshOnEntityMap.rbegin();
+ for( ; aMeshOnEntityIter != aMeshOnEntityMap.rend(); aMeshOnEntityIter++ ) {
+ VISU::TEntity anEntity = aMeshOnEntityIter->first;
+ if ( anEntity == VISU::NODE_ENTITY )
+ continue;
+ VISU::PNamedIDMapper aNamedIDMapper = GetMeshOnEntity( theMesh->myName, anEntity );
+ if( aNamedIDMapper ) {
+ theUnstructuredGridIDMapper->SetReferencedMesh( aNamedIDMapper );
+ VISU::PUnstructuredGrid aSource = theUnstructuredGridIDMapper->GetSource();
+ VISU::GetTimeStampOnProfile( aSource, theField, theValForTime, theEntity );
+
+ return theUnstructuredGridIDMapper->GetUnstructuredGridOutput();
+ }
+ }
}
}
}
VISU::PUnstructuredGridIDMapper
VISU_Convertor_impl
::GetTimeStampOnMesh( const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum )
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum )
{
INITMSG(MYDEBUG,"GetTimeStampOnMesh"<<
- "; theMeshName = '"<<theMeshName<<"'"<<
- "; theEntity = "<<theEntity<<
- "; theFieldName = '"<<theFieldName<<"'"<<
- "; theStampsNum = "<<theStampsNum<<
- endl);
+ "; theMeshName = '"<<theMeshName<<"'"<<
+ "; theEntity = "<<theEntity<<
+ "; theFieldName = '"<<theFieldName<<"'"<<
+ "; theStampsNum = "<<theStampsNum<<
+ endl);
//Cheching possibility do the query
TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
- theEntity,
- theFieldName,
- theStampsNum);
+ theEntity,
+ theFieldName,
+ theStampsNum);
VISU::PMeshImpl aMesh = boost::get<0>(aFindTimeStamp);
VISU::PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindTimeStamp);
vtkUnstructuredGrid* anOutput = NULL;
try{
- anOutput = GetTimeStampOnProfile(aMesh,
- aVTKMeshOnEntity,
- aField,
- aValForTime,
- anUnstructuredGridIDMapper,
- aValForTime->myProfile,
- aMeshOnEntity->myEntity);
+ anOutput = GetTimeStampOnProfile(aMesh,
+ aVTKMeshOnEntity,
+ aField,
+ aValForTime,
+ anUnstructuredGridIDMapper,
+ aValForTime->myProfile,
+ aMeshOnEntity->myEntity);
}catch(std::exception& exc){
- MSG(MYDEBUG,"Follow exception was occured :\n"<<exc.what());
- anOutput = GetTimeStampOnProfile(aMesh,
- aMeshOnEntity,
- aField,
- aValForTime,
- anUnstructuredGridIDMapper,
- aValForTime->myProfile,
- aVTKMeshOnEntity->myEntity);
+ MSG(MYDEBUG,"Follow exception was occured :\n"<<exc.what());
+ anOutput = GetTimeStampOnProfile(aMesh,
+ aMeshOnEntity,
+ aField,
+ aValForTime,
+ anUnstructuredGridIDMapper,
+ aValForTime->myProfile,
+ aVTKMeshOnEntity->myEntity);
}
anUnstructuredGridIDMapper->CopyStructure( aMesh );
anUnstructuredGridIDMapper->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
- std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
- std::string aFieldName = (const char*)QString(theFieldName.c_str()).simplified().toLatin1();
- std::string aPrefix = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
- std::string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) +
- aFieldName + dtos("-%d", theStampsNum) + "-TimeStampOnMesh.vtk";
- VISU::WriteToFile(anOutput,aFileName);
+ std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
+ std::string aFieldName = (const char*)QString(theFieldName.c_str()).simplified().toLatin1();
+ std::string aPrefix = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
+ std::string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) +
+ aFieldName + dtos("-%d", theStampsNum) + "-TimeStampOnMesh.vtk";
+ VISU::WriteToFile(anOutput,aFileName);
}
if(MYVTKDEBUG){
- GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
- anOutput->Update();
- if(theEntity == VISU::NODE_ENTITY)
- BEGMSG(MYVTKDEBUG,"GetPointData() = "<<vtkFloatingPointType(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
- else
- BEGMSG(MYVTKDEBUG,"GetCellData() = "<<vtkFloatingPointType(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
- BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<vtkFloatingPointType(anOutput->GetActualMemorySize()*1000)<<endl);
+ GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
+ anOutput->Update();
+ if(theEntity == VISU::NODE_ENTITY)
+ BEGMSG(MYVTKDEBUG,"GetPointData() = "<<vtkFloatingPointType(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
+ else
+ BEGMSG(MYVTKDEBUG,"GetCellData() = "<<vtkFloatingPointType(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<vtkFloatingPointType(anOutput->GetActualMemorySize()*1000)<<endl);
}
}
#ifndef _DEXCEPT_
VISU::PGaussPtsIDMapper
VISU_Convertor_impl
::GetTimeStampOnGaussPts(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum)
{
INITMSG(MYDEBUG,"GetTimeStampOnGaussPts"<<
- "; theMeshName = '"<<theMeshName<<"'"<<
- "; theEntity = "<<theEntity<<
- "; theFieldName = '"<<theFieldName<<"'"<<
- "; theStampsNum = "<<theStampsNum<<
- endl);
+ "; theMeshName = '"<<theMeshName<<"'"<<
+ "; theEntity = "<<theEntity<<
+ "; theFieldName = '"<<theFieldName<<"'"<<
+ "; theStampsNum = "<<theStampsNum<<
+ endl);
if(theEntity == VISU::NODE_ENTITY)
EXCEPTION(std::runtime_error, "It is impossible to reate Gauss Points on NODE_ENTITY !!!");
//Cheching possibility do the query
TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
- theEntity,
- theFieldName,
- theStampsNum);
+ theEntity,
+ theFieldName,
+ theStampsNum);
VISU::PMeshImpl aMesh = boost::get<0>(aFindTimeStamp);
VISU::PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindTimeStamp);
GetMeshOnEntity(aVTKMeshOnEntity->myMeshName, aVTKMeshOnEntity->myEntity);
VISU::PProfileImpl aProfile = aValForTime->myProfile;
- GetMeshOnProfile(aMesh, aVTKMeshOnEntity, aProfile);
+ GetMeshOnProfile(aMesh, aVTKMeshOnEntity, aProfile, false);
VISU::PGaussMeshImpl aGaussMesh = aValForTime->myGaussMesh;
if(!aGaussMesh->myIsVTKDone){
- BuildGaussMesh(aMesh, aVTKMeshOnEntity, aGaussMesh);
- aGaussMesh->myParent = aProfile.get();
- aGaussMesh->myIsVTKDone = true;
+ BuildGaussMesh(aMesh, aVTKMeshOnEntity, aGaussMesh);
+ aGaussMesh->myParent = aProfile.get();
+ aGaussMesh->myIsVTKDone = true;
}
aGaussPtsIDFilter->myIDMapper = aGaussMesh;
aGaussPtsIDFilter->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
- std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
- std::string aFieldName = (const char*)QString(theFieldName.c_str()).simplified().toLatin1();
- std::string aPrefix = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
- std::string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) +
- aFieldName + dtos("-%d",theStampsNum) + "-TimeStampOnGaussPts.vtk";
- VISU::WriteToFile(anOutput, aFileName);
+ std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
+ std::string aFieldName = (const char*)QString(theFieldName.c_str()).simplified().toLatin1();
+ std::string aPrefix = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
+ std::string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) +
+ aFieldName + dtos("-%d",theStampsNum) + "-TimeStampOnGaussPts.vtk";
+ VISU::WriteToFile(anOutput, aFileName);
}
if(MYVTKDEBUG){
- GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
- anOutput->Update();
- if(theEntity == VISU::NODE_ENTITY)
- BEGMSG(MYVTKDEBUG,"GetPointData() = "<<vtkFloatingPointType(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
- else
- BEGMSG(MYVTKDEBUG,"GetCellData() = "<<vtkFloatingPointType(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
- BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<vtkFloatingPointType(anOutput->GetActualMemorySize()*1000)<<endl);
+ GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
+ anOutput->Update();
+ if(theEntity == VISU::NODE_ENTITY)
+ BEGMSG(MYVTKDEBUG,"GetPointData() = "<<vtkFloatingPointType(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
+ else
+ BEGMSG(MYVTKDEBUG,"GetCellData() = "<<vtkFloatingPointType(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<vtkFloatingPointType(anOutput->GetActualMemorySize()*1000)<<endl);
}
}
#ifndef _DEXCEPT_
VISU_Convertor_impl::TFindMeshOnEntity
VISU_Convertor_impl
::FindMeshOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity)
+ const VISU::TEntity& theEntity)
{
VISU::PMeshImpl aMesh = FindMesh(theMeshName);
VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
VISU::PMeshOnEntityImpl aMeshOnEntity = aMeshOnEntityMapIter->second;
return TFindMeshOnEntity(aMesh,
- aMeshOnEntity);
+ aMeshOnEntity);
}
VISU_Convertor_impl::TFindFamilyOnEntity
VISU_Convertor_impl
::FindFamilyOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName)
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName)
{
if(theFamilyName != ""){
VISU::PMeshImpl aMesh = FindMesh(theMeshName);
if(aFamilyMapIter != aFamilyMap.end()){
const VISU::PFamily& aFamily = aFamilyMapIter->second;
return TFindFamilyOnEntity(aMesh,
- aMeshOnEntity,
- aFamily);
+ aMeshOnEntity,
+ aFamily);
}
}
return TFindFamilyOnEntity();
const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
- const std::string& aFieldName = aFieldMapIter->first;
- const VISU::PField aField = aFieldMapIter->second;
- const VISU::TValField& aValField = aField->myValField;
- VISU::TValField::const_iterator aValFieldIter = aValField.begin();
- for(; aValFieldIter != aValField.end(); aValFieldIter++){
- int aTimeStamp = aValFieldIter->first;
- aResult += GetTimeStampSize(aMeshName,anEntity,aFieldName,aTimeStamp);
- }
+ const std::string& aFieldName = aFieldMapIter->first;
+ const VISU::PField aField = aFieldMapIter->second;
+ const VISU::TValField& aValField = aField->myValField;
+ VISU::TValField::const_iterator aValFieldIter = aValField.begin();
+ for(; aValFieldIter != aValField.end(); aValFieldIter++){
+ int aTimeStamp = aValFieldIter->first;
+ aResult += GetTimeStampSize(aMeshName,anEntity,aFieldName,aTimeStamp);
+ }
}
//Importing groups
const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
- const std::string& aGroupName = aGroupMapIter->first;
- aResult += GetMeshOnGroupSize(aMeshName,aGroupName);
+ const std::string& aGroupName = aGroupMapIter->first;
+ aResult += GetMeshOnGroupSize(aMeshName,aGroupName);
}
//Import families
const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
- const std::string& aFamilyName = aFamilyMapIter->first;
- aResult += GetFamilyOnEntitySize(aMeshName,anEntity,aFamilyName);
+ const std::string& aFamilyName = aFamilyMapIter->first;
+ aResult += GetFamilyOnEntitySize(aMeshName,anEntity,aFamilyName);
}
//Import mesh on entity
aResult += GetMeshOnEntitySize(aMeshName,anEntity);
size_t
VISU_Convertor_impl
::GetMeshOnEntitySize(const std::string& theMeshName,
- const VISU::TEntity& theEntity)
+ const VISU::TEntity& theEntity)
{
TFindMeshOnEntity aFindMeshOnEntity =
FindMeshOnEntity(theMeshName, theEntity);
size_t
VISU_Convertor_impl
::GetFamilyOnEntitySize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName)
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName)
{
TFindFamilyOnEntity aFindFamilyOnEntity =
FindFamilyOnEntity(theMeshName,theEntity,theFamilyName);
VISU_Convertor_impl::TFindMeshOnGroup
VISU_Convertor_impl
::FindMeshOnGroup(const std::string& theMeshName,
- const std::string& theGroupName)
+ const std::string& theGroupName)
{
VISU::PMeshImpl aMesh = FindMesh(theMeshName);
VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
size_t
VISU_Convertor_impl
::GetMeshOnGroupSize(const std::string& theMeshName,
- const std::string& theGroupName)
+ const std::string& theGroupName)
{
TFindMeshOnGroup aFindMeshOnGroup = FindMeshOnGroup(theMeshName,theGroupName);
VISU::PMeshImpl aMesh = boost::get<0>(aFindMeshOnGroup);
VISU_Convertor_impl::TFindField
VISU_Convertor_impl
::FindField(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName)
{
TFindMeshOnEntity aFindMeshOnEntity =
FindMeshOnEntity(theMeshName,theEntity);
VISU::PFieldImpl aField = aFieldIter->second;
return TFindField( aMesh,
- aMeshOnEntity,
- aVTKMeshOnEntity,
- aField );
+ aMeshOnEntity,
+ aVTKMeshOnEntity,
+ aField );
}
size_t
VISU_Convertor_impl
::GetFieldOnMeshSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName)
{
TFindField aFindField = FindField(theMeshName,theEntity,theFieldName);
VISU::PMeshOnEntityImpl aVTKMeshOnEntity = boost::get<2>(aFindField);
VISU_Convertor_impl::TFindTimeStamp
VISU_Convertor_impl
::FindTimeStamp(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum)
{
TFindField aFindField = FindField(theMeshName,theEntity,theFieldName);
VISU::PField aField = boost::get<3>(aFindField);
VISU::PValForTimeImpl aValForTime = aValFieldIter->second;
return TFindTimeStamp(aMesh,
- aMeshOnEntity,
- aVTKMeshOnEntity,
- aField,
- aValForTime);
+ aMeshOnEntity,
+ aVTKMeshOnEntity,
+ aField,
+ aValForTime);
}
size_t
VISU_Convertor_impl
::GetTimeStampSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum)
{
TFindTimeStamp aFindTimeStamp =
FindTimeStamp(theMeshName,theEntity,theFieldName,theStampsNum);
size_t
VISU_Convertor_impl
::GetTimeStampOnMeshSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber,
- bool& theIsEstimated)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber,
+ bool& theIsEstimated)
{
size_t aSize = 0;
//Cheching possibility do the query
TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
VISU::PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
VISU::PUnstructuredGridIDMapperImpl anUnstructuredGridIDMapper = aValForTime->myUnstructuredGridIDMapper;
if(anUnstructuredGridIDMapper->myIsVTKDone){
VISU::PIDMapper anIDMapper = GetTimeStampOnMesh(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
anIDMapper->GetOutput();
aSize += anIDMapper->GetMemorySize();
}else
size_t
VISU_Convertor_impl
::GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber,
- bool& theIsEstimated)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber,
+ bool& theIsEstimated)
{
size_t aSize = 0;
//Cheching possibility do the query
TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
VISU::PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
VISU::PGaussPtsIDFilter aGaussPtsIDFilter = aValForTime->myGaussPtsIDFilter;
if(aGaussPtsIDFilter->myIsVTKDone){
VISU::PGaussPtsIDMapper aGaussPtsIDMapper = GetTimeStampOnGaussPts(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
aGaussPtsIDMapper->GetOutput();
aSize += aGaussPtsIDMapper->GetMemorySize();
}else
const VISU::PField
VISU_Convertor_impl
::GetField(const std::string& theMeshName,
- VISU::TEntity theEntity,
- const std::string& theFieldName)
+ VISU::TEntity theEntity,
+ const std::string& theFieldName)
{
TFindField aFindField = FindField(theMeshName,theEntity,theFieldName);
VISU::PField aField = boost::get<3>(aFindField);
const VISU::PValForTime
VISU_Convertor_impl
::GetTimeStamp(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum)
{
TFindTimeStamp aFindTimeStamp =
FindTimeStamp(theMeshName,theEntity,theFieldName,theStampsNum);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
virtual
VISU::PNamedIDMapper
GetMeshOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity);
+ const VISU::TEntity& theEntity);
//! Implemention of the VISU_Convertor::GetMeshOnEntitySize
virtual
size_t
GetMeshOnEntitySize(const std::string& theMeshName,
- const VISU::TEntity& theEntity);
+ const VISU::TEntity& theEntity);
//! Implemention of the VISU_Convertor::GetFamilyOnEntity
virtual
VISU::PUnstructuredGridIDMapper
GetFamilyOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName);
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName);
//! Implemention of the VISU_Convertor::GetFamilyOnEntitySize
virtual
size_t
GetFamilyOnEntitySize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName);
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName);
//! Implemention of the VISU_Convertor::GetMeshOnGroup
virtual
VISU::PUnstructuredGridIDMapper
GetMeshOnGroup(const std::string& theMeshName,
- const std::string& theGroupName);
+ const std::string& theGroupName);
//! Implemention of the VISU_Convertor::GetMeshOnGroupSize
virtual
size_t
GetMeshOnGroupSize(const std::string& theMeshName,
- const std::string& theGroupName);
+ const std::string& theGroupName);
//! Implemention of the VISU_Convertor::GetTimeStampOnMesh
virtual
VISU::PUnstructuredGridIDMapper
GetTimeStampOnMesh( const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber );
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber );
//! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on mesh
virtual
size_t
GetTimeStampOnMeshSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber,
- bool& theIsEstimated);
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber,
+ bool& theIsEstimated);
//! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on Gauss Points
virtual
size_t
GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber,
- bool& theIsEstimated);
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber,
+ bool& theIsEstimated);
//! Implemention of the VISU_Convertor::GetTimeStampOnGaussPts
virtual
VISU::PGaussPtsIDMapper
GetTimeStampOnGaussPts(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber);
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber);
//! Implemention of the VISU_Convertor::GetFieldOnMeshSize
virtual
size_t
GetFieldOnMeshSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName);
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName);
//! Implemention of the VISU_Convertor::GetField
virtual
const VISU::PField
GetField(const std::string& theMeshName,
- VISU::TEntity theEntity,
- const std::string& theFieldName);
+ VISU::TEntity theEntity,
+ const std::string& theFieldName);
//! Implemention of the VISU_Convertor::GetTimeStamp
virtual
const VISU::PValForTime
GetTimeStamp(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum);
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum);
protected:
//! An utility method to find TMesh by its name
//! An utility method to find TMeshOnEntity by name of its parent mesh and entity
typedef boost::tuple<VISU::PMeshImpl,
- VISU::PMeshOnEntityImpl> TFindMeshOnEntity;
+ VISU::PMeshOnEntityImpl> TFindMeshOnEntity;
TFindMeshOnEntity
FindMeshOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity);
+ const VISU::TEntity& theEntity);
//! An utility method to find TFamily by name of its parent mesh, corresponding entity and its name
typedef boost::tuple<VISU::PMeshImpl,
- VISU::PMeshOnEntityImpl,VISU::PFamilyImpl> TFindFamilyOnEntity;
+ VISU::PMeshOnEntityImpl,VISU::PFamilyImpl> TFindFamilyOnEntity;
TFindFamilyOnEntity
FindFamilyOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName);
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName);
//! An utility method to find Group by name of its parent mesh and its name
typedef boost::tuple<VISU::PMeshImpl,
- VISU::PGroupImpl> TFindMeshOnGroup;
+ VISU::PGroupImpl> TFindMeshOnGroup;
TFindMeshOnGroup
FindMeshOnGroup(const std::string& theMeshName,
- const std::string& theGroupName);
+ const std::string& theGroupName);
//! An utility method to find TField by name of its parent mesh, corresponding entity and its name
typedef boost::tuple<VISU::PMeshImpl,
- VISU::PMeshOnEntityImpl,
- VISU::PMeshOnEntityImpl,
- VISU::PFieldImpl> TFindField;
+ VISU::PMeshOnEntityImpl,
+ VISU::PMeshOnEntityImpl,
+ VISU::PFieldImpl> TFindField;
TFindField
FindField( const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName );
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName );
//! An utility method to find TTimeStamp by name of its parent mesh, corresponding entity, field name and its number
typedef boost::tuple<VISU::PMeshImpl,
- VISU::PMeshOnEntityImpl,
- VISU::PMeshOnEntityImpl,
- VISU::PFieldImpl,
- VISU::PValForTimeImpl> TFindTimeStamp;
+ VISU::PMeshOnEntityImpl,
+ VISU::PMeshOnEntityImpl,
+ VISU::PFieldImpl,
+ VISU::PValForTimeImpl> TFindTimeStamp;
TFindTimeStamp
FindTimeStamp(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum);
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum);
vtkUnstructuredGrid*
GetTimeStampOnProfile( const VISU::PMeshImpl& theMesh,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PFieldImpl& theField,
- const VISU::PValForTimeImpl& theValForTime,
- const VISU::PUnstructuredGridIDMapperImpl& theIDMapperFilter,
- const VISU::PProfileImpl& theProfile,
- const VISU::TEntity& theEntity );
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PFieldImpl& theField,
+ const VISU::PValForTimeImpl& theValForTime,
+ const VISU::PUnstructuredGridIDMapperImpl& theIDMapperFilter,
+ const VISU::PProfileImpl& theProfile,
+ const VISU::TEntity& theEntity );
protected:
//! Implemention of the VISU_Convertor::GetTimeStampSize
virtual
size_t
GetTimeStampSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum);
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum);
//! To fill intermeiate representation of TMeshOnEntity from a MED source
virtual
int
LoadMeshOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity) = 0;
+ VISU::PMeshOnEntityImpl theMeshOnEntity) = 0;
//! To fill intermeiate representation of TFamily from a MED source
virtual
int
LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFamilyImpl theFamily) = 0;
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFamilyImpl theFamily) = 0;
//! To fill intermeiate representation of TGroup from a MED source
virtual
int
LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilySet& theFamilySet) = 0;
+ const VISU::TFamilySet& theFamilySet) = 0;
//! To fill intermeiate representation of TValForTime for ordinary mesh from a MED source
virtual
int
LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime) = 0;
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime) = 0;
//! To fill intermeiate representation of TValForTime for mesh on Gauss Points from a MED source
virtual
int
LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime) = 0;
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime) = 0;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_ElnoMeshValue.hxx
// Author : Alexey PETROV
// Module : VISU
//----------------------------------------------------------------------------
TGetElnoNodeData( vtkDataArray *theElnoDataArray,
- vtkDataArray *theElnoDataMapper )
+ vtkDataArray *theElnoDataMapper )
: myElnoDataArray( TVTKDataArray::SafeDownCast( theElnoDataArray ) )
, myElnoDataMapper( vtkIntArray::SafeDownCast( theElnoDataMapper ) )
{}
//----------------------------------------------------------------------------------------------
TSetElnoNodeData( vtkIdType theEffectNbComp,
- vtkIdType theRealNbComp,
- vtkIdType theNbTuples,
- const char* theDataArrayName,
- const char* theMapperArrayName )
+ vtkIdType theRealNbComp,
+ vtkIdType theNbTuples,
+ const char* theDataArrayName,
+ const char* theMapperArrayName )
: myElnoDataArray( TVTKDataArray::New() )
, myElnoDataMapper( vtkIntArray::New() )
{
TDataType* aDataPtr = myElnoDataArray->GetPointer( aPos );
for ( vtkIdType aCompId = 0; aCompId < myElemInfo[ 1 ]; aCompId++ )
- *aDataPtr++ = *theDataPtr++;
+ *aDataPtr++ = *theDataPtr++;
return myElemInfo[ 2 ]++;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU CONVERTOR :
// File: VISU_ExtractUnstructuredGrid.cxx
// Author: Alexey PETROV
namespace{
inline void InsertCell(vtkUnstructuredGrid *theInput,
- vtkUnstructuredGrid *theOutput,
- vtkIdType theCellId, vtkIdList *theCellIds)
+ vtkUnstructuredGrid *theOutput,
+ vtkIdType theCellId, vtkIdList *theCellIds)
{
theCellIds->Reset();
vtkCell *aCell = theInput->GetCell(theCellId);
else if(!myRemovedCellIds.empty() && myRemovedCellTypes.empty()){
for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++)
if(myRemovedCellIds.find(aCellId) == myRemovedCellIds.end())
- InsertCell(anInput,anOutput,aCellId,aCellIds);
+ InsertCell(anInput,anOutput,aCellId,aCellIds);
}else if(myRemovedCellIds.empty() && !myRemovedCellTypes.empty()){
for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++)
if(myRemovedCellTypes.find(anInput->GetCellType(aCellId)) == myRemovedCellTypes.end())
- InsertCell(anInput,anOutput,aCellId,aCellIds);
+ InsertCell(anInput,anOutput,aCellId,aCellIds);
}else if(!myRemovedCellIds.empty() && !myRemovedCellTypes.empty())
for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++)
if(myRemovedCellTypes.find(anInput->GetCellType(aCellId)) == myRemovedCellTypes.end())
- if(myRemovedCellIds.find(aCellId) == myRemovedCellIds.end())
- InsertCell(anInput,anOutput,aCellId,aCellIds);
+ if(myRemovedCellIds.find(aCellId) == myRemovedCellIds.end())
+ InsertCell(anInput,anOutput,aCellId,aCellIds);
aCellIds->Delete();
anOutput->SetPoints(anInput->GetPoints());
MSG(MYDEBUG,"Execute - anOutput->GetNumberOfCells() = "<<anOutput->GetNumberOfCells());
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU CONVERTOR :
// File : VISU_ExtractUnstructuredGrid.hxx
// Author : Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
int
VISU_GaussMergeFilter
::RequestData(vtkInformation *theRequest,
- vtkInformationVector **theInputVector,
- vtkInformationVector *theOutputVector)
+ vtkInformationVector **theInputVector,
+ vtkInformationVector *theOutputVector)
{
if(vtkUnstructuredGrid *anInput = dynamic_cast<vtkUnstructuredGrid*>(this->GetInput())){
vtkPolyData *anOutput = dynamic_cast<vtkPolyData*>(this->GetOutput());
return ExecuteGauss(anInput,
- anOutput);
+ anOutput);
}
return Superclass::RequestData(theRequest,
- theInputVector,
- theOutputVector);
+ theInputVector,
+ theOutputVector);
}
//----------------------------------------------------------------------------
int
VISU_GaussMergeFilter
::RequestUpdateExtent(vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *vtkNotUsed(outputVector))
+ vtkInformationVector **inputVector,
+ vtkInformationVector *vtkNotUsed(outputVector))
{
vtkInformation *inputInfo;
int idx;
bool
VISU_GaussMergeFilter
::ExecuteGauss(vtkUnstructuredGrid* theInput,
- vtkPolyData* theOutput)
+ vtkPolyData* theOutput)
{
if(IsMergingInputs()){
vtkCellData *aCellData = theInput->GetCellData();
vtkIntArray *aGeometryCellMapper = dynamic_cast<vtkIntArray*>(aCellMapper);
vtkIntArray* aDataPointMapper = GetIDMapper(FieldList,
- VISU::TGetPointData(),
- "VISU_POINTS_MAPPER");
+ VISU::TGetPointData(),
+ "VISU_POINTS_MAPPER");
vtkIntArray* aDataCellIds = vtkIntArray::New();
aDataCellIds->SetNumberOfTuples(nbPoints);
int* aDataCellPointer = aDataCellIds->GetPointer(0);
{
- int nbPoints = aDataPointMapper->GetNumberOfTuples();
- for(int i=0;i<nbPoints;i++,aDataCellPointer++){
- VISU::TGaussPointID aGPID = myGaussPtsIDMapper->GetObjID(i);
- vtkIdType aCellId = aGPID.first;
- *aDataCellPointer = aCellId;
- aDataCellPointer++;
- *aDataCellPointer = 3; // it's a entity CELL
- }
+ int nbPoints = aDataPointMapper->GetNumberOfTuples();
+ for(int i=0;i<nbPoints;i++,aDataCellPointer++){
+ VISU::TGaussPointID aGPID = myGaussPtsIDMapper->GetObjID(i);
+ vtkIdType aCellId = aGPID.first;
+ *aDataCellPointer = aCellId;
+ aDataCellPointer++;
+ *aDataCellPointer = 3; // it's a entity CELL
+ }
}
/*
vtkIntArray* anCellArr = GetIDMapper(FieldList,
- VISU::TGetCellData(),
- "VISU_CELLS_MAPPER");
+ VISU::TGetCellData(),
+ "VISU_CELLS_MAPPER");
vtkIntArray* anPMArr = GetIDMapper(FieldList,
- VISU::TGetPointData(),
- "VISU_POINTS_MAPPER");
+ VISU::TGetPointData(),
+ "VISU_POINTS_MAPPER");
vtkDataArray* anFArr = GetIDMapper(FieldList,
- VISU::TGetPointData(),
- "VISU_FIELD");
+ VISU::TGetPointData(),
+ "VISU_FIELD");
*/
if(VISU::IsDifferent(aDataCellIds, aGeometryCellMapper)){
- VISU::TObjectIdArray anIntersection;
- VISU::GetIntersection(aDataCellIds,
- aGeometryCellMapper,
- anIntersection);
+ VISU::TObjectIdArray anIntersection;
+ VISU::GetIntersection(aDataCellIds,
+ aGeometryCellMapper,
+ anIntersection);
VISU::TObjectId2TupleGaussIdMap aDataCellId2TupleGaussIdMap;
- VISU::GetObjectId2TupleGaussIdArray(aDataCellIds, aDataCellId2TupleGaussIdMap);
+ VISU::GetObjectId2TupleGaussIdArray(aDataCellIds, aDataCellId2TupleGaussIdMap);
vtkIdType aNbTuples = 0;
for(vtkIdType i = 0;i < anIntersection.size();i++)
aNbTuples += aDataCellId2TupleGaussIdMap[anIntersection[i].first].size();
-
- vtkPointSet* aScalarsDataSet = dynamic_cast<vtkPointSet*>(GetScalars());
- vtkPoints* aDataPoints = aScalarsDataSet->GetPoints();
- vtkPoints* anOutputPoints = vtkPoints::New(aDataPoints->GetDataType());
-
- anOutputPoints->SetNumberOfPoints(aNbTuples);
- theOutput->SetPoints(anOutputPoints);
- anOutputPoints->Delete();
-
- vtkCellData* anInputCellData = aScalarsDataSet->GetCellData();
- vtkPointData* anInputPointData = aScalarsDataSet->GetPointData();
-
- theOutput->Allocate(aNbTuples);
- vtkCellData* anOutputCellData = theOutput->GetCellData();
- vtkPointData* anOutputPointData = theOutput->GetPointData();
-
- anOutputCellData->CopyAllocate(anInputCellData,aNbTuples);
- anOutputPointData->CopyAllocate(anInputPointData,aNbTuples);
-
- vtkIdList *aCellIds = vtkIdList::New();
- vtkFloatingPointType aCoords[3];
- for(int aTupleId=0, aNewTupleId=0; aTupleId<anIntersection.size(); aTupleId++){
- VISU::TObjectId& anObjectId = anIntersection[aTupleId];
+
+ vtkPointSet* aScalarsDataSet = dynamic_cast<vtkPointSet*>(GetScalars());
+ vtkPoints* aDataPoints = aScalarsDataSet->GetPoints();
+ vtkPoints* anOutputPoints = vtkPoints::New(aDataPoints->GetDataType());
+
+ anOutputPoints->SetNumberOfPoints(aNbTuples);
+ theOutput->SetPoints(anOutputPoints);
+ anOutputPoints->Delete();
+
+ vtkCellData* anInputCellData = aScalarsDataSet->GetCellData();
+ vtkPointData* anInputPointData = aScalarsDataSet->GetPointData();
+
+ theOutput->Allocate(aNbTuples);
+ vtkCellData* anOutputCellData = theOutput->GetCellData();
+ vtkPointData* anOutputPointData = theOutput->GetPointData();
+
+ anOutputCellData->CopyAllocate(anInputCellData,aNbTuples);
+ anOutputPointData->CopyAllocate(anInputPointData,aNbTuples);
+
+ vtkIdList *aCellIds = vtkIdList::New();
+ vtkFloatingPointType aCoords[3];
+ for(int aTupleId=0, aNewTupleId=0; aTupleId<anIntersection.size(); aTupleId++){
+ VISU::TObjectId& anObjectId = anIntersection[aTupleId];
VISU::TCellIdArray aCellIdArray = aDataCellId2TupleGaussIdMap[anObjectId.first];
for(vtkIdType i = 0; i < aCellIdArray.size();i++) {
aCellIds->Reset();
aCellIds->InsertNextId(aNewTupleId);
aNewTupleId++;
-
+
vtkIdType aCellType = GetScalars()->GetCellType(aCellId);
vtkIdType aNewCellId = theOutput->InsertNextCell(aCellType, aCellIds);
-
+
anOutputCellData->CopyData(anInputCellData, aCellId, aNewCellId);
anOutputPointData->CopyData(anInputPointData, aCellId, aNewCellId);
aDataPoints->GetPoint(aCellId, aCoords);
anOutputPoints->SetPoint(aNewCellId, aCoords);
}
- }
+ }
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
bool
ExecuteGauss(vtkUnstructuredGrid* theInput,
- vtkPolyData* theOutput);
+ vtkPolyData* theOutput);
private:
VISU_GaussMergeFilter(const VISU_GaussMergeFilter&); // Not implemented.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File:
// Author:
if ( IsStructured() ) {
TObj2StructuredId::const_iterator aIter = myObj2StructuredId.find( theNodeId );
if ( aIter != myObj2StructuredId.end() )
- return aIter->second;
+ return aIter->second;
}
return TStructuredId();
TObj2StructuredId::const_iterator aIter = myObj2StructuredId.begin();
for (; aIter != myObj2StructuredId.end(); aIter++ ) {
if ( theVec == aIter->second )
- return aIter->first;
+ return aIter->first;
}
return -1;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU CONVERTOR :
// File : VISU_Convertor.hxx
// Author : Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_MedConvertor.cxx
// Author : Alexey PETROV
#include <vtkCellType.h>
+#ifdef WNT
+#include <float.h>
+#define isnan _isnan
+#endif
+
using MED::TInt;
using MED::TFloat;
using MED::EBooleen;
case MED::eSEG3: return VISU::eSEG3;
case MED::eTRIA6: return VISU::eTRIA6;
case MED::eQUAD8: return VISU::eQUAD8;
+ case MED::eQUAD9: return VISU::eQUAD9;
+ case MED::eOCTA12: return VISU::eOCTA12;
case MED::eTETRA10: return VISU::eTETRA10;
case MED::eHEXA20: return VISU::eHEXA20;
+ case MED::eHEXA27: return VISU::eHEXA27;
case MED::ePENTA15: return VISU::ePENTA15;
case MED::ePYRA13: return VISU::ePYRA13;
case VISU::eSEG3: return MED::eSEG3;
case VISU::eTRIA6: return MED::eTRIA6;
case VISU::eQUAD8: return MED::eQUAD8;
+ case VISU::eQUAD9: return MED::eQUAD9;
+ case VISU::eOCTA12: return MED::eOCTA12;
case VISU::eTETRA10: return MED::eTETRA10;
case VISU::eHEXA20: return MED::eHEXA20;
+ case VISU::eHEXA27: return MED::eHEXA27;
case VISU::ePENTA15: return MED::ePENTA15;
case VISU::ePYRA13: return MED::ePYRA13;
//---------------------------------------------------------------
VISU::PMEDSubProfile
CrSubProfile(const MED::PWrapper& theMEDWrapper,
- const MED::PMeshInfo& theMeshInfo,
- MED::EEntiteMaillage theMEntity,
- MED::EGeometrieElement theMGeom,
- const MED::TGeom2Size& theGeom2Size,
- const MED::TGeom2Profile& theGeom2Profile)
+ const MED::PMeshInfo& theMeshInfo,
+ MED::EEntiteMaillage theMEntity,
+ MED::EGeometrieElement theMGeom,
+ const MED::TGeom2Size& theGeom2Size,
+ const MED::TGeom2Profile& theGeom2Profile)
{
VISU::EGeometry aEGeom = MEDGeom2VISU(theMGeom);
vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
else{
MED::TGeom2Profile::const_iterator aProfileIter = theGeom2Profile.find(theMGeom);
if(aProfileIter != theGeom2Profile.end()){
- MED::PProfileInfo aProfileInfo = aProfileIter->second;
-
- aSubProfile->myName = aProfileInfo->GetName();
- aSubProfile->myStatus = VISU::eAddPart;
-
- const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
- TInt aNbElem = anElemNum.size();
- aSubProfile->myNbCells = aNbElem;
- switch(theMGeom){
- case MED::ePOLYGONE: {
- MED::PPolygoneInfo aPolygoneInfo =
- theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom);
- for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
- TInt aNbConn = aPolygoneInfo->GetNbConn( anElemNum[ anElemId ] - 1 );
- aSubProfile->myCellsSize += aNbConn;
- }
- break;
- }
- case MED::ePOLYEDRE: {
- MED::PPolyedreInfo aPolyedreInfo =
- theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom);
- for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
- MED::TCConnSliceArr aConnSliceArr =
- aPolyedreInfo->GetConnSliceArr( anElemNum[ anElemId ] - 1 );
- TInt aNbFaces = aConnSliceArr.size();
- TInt aCellSize = 0;
- for(TInt iFace = 0; iFace < aNbFaces; iFace++){
- MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
- TInt aNbConn = aConnSlice.size();
- aCellSize += aNbConn;
- }
- aSubProfile->myCellsSize += aCellSize;
- }
- break;
- }
- default: {
- aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
- }}
+ MED::PProfileInfo aProfileInfo = aProfileIter->second;
+
+ aSubProfile->myName = aProfileInfo->GetName();
+ aSubProfile->myStatus = VISU::eAddPart;
+
+ const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
+ TInt aNbElem = anElemNum.size();
+ aSubProfile->myNbCells = aNbElem;
+ switch(theMGeom){
+ case MED::ePOLYGONE: {
+ MED::PPolygoneInfo aPolygoneInfo =
+ theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom);
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ TInt aNbConn = aPolygoneInfo->GetNbConn( anElemNum[ anElemId ] - 1 );
+ aSubProfile->myCellsSize += aNbConn;
+ }
+ break;
+ }
+ case MED::ePOLYEDRE: {
+ MED::PPolyedreInfo aPolyedreInfo =
+ theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom);
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ MED::TCConnSliceArr aConnSliceArr =
+ aPolyedreInfo->GetConnSliceArr( anElemNum[ anElemId ] - 1 );
+ TInt aNbFaces = aConnSliceArr.size();
+ TInt aCellSize = 0;
+ for(TInt iFace = 0; iFace < aNbFaces; iFace++){
+ MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+ TInt aNbConn = aConnSlice.size();
+ aCellSize += aNbConn;
+ }
+ aSubProfile->myCellsSize += aCellSize;
+ }
+ break;
+ }
+ default: {
+ aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
+ }}
}else{
- TInt aNbElem = aTimeStampIter->second;
- aSubProfile->myNbCells = aNbElem;
- switch(theMGeom){
- case MED::ePOLYGONE: {
- MED::PPolygoneInfo aPolygoneInfo =
- theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom);
- for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
- TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId);
- aSubProfile->myCellsSize += aNbConn;
- }
- break;
- }
- case MED::ePOLYEDRE: {
- MED::PPolyedreInfo aPolyedreInfo =
- theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom);
- for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
- MED::TCConnSliceArr aConnSliceArr =
- aPolyedreInfo->GetConnSliceArr(anElemId);
- TInt aNbFaces = aConnSliceArr.size();
- TInt aCellSize = 0;
- for(TInt iFace = 0; iFace < aNbFaces; iFace++){
- MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
- TInt aNbConn = aConnSlice.size();
- aCellSize += aNbConn;
- }
- aSubProfile->myCellsSize += aCellSize;
- }
- break;
- }
- default: {
- aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
- }}
+ TInt aNbElem = aTimeStampIter->second;
+ aSubProfile->myNbCells = aNbElem;
+ switch(theMGeom){
+ case MED::ePOLYGONE: {
+ MED::PPolygoneInfo aPolygoneInfo =
+ theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom);
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId);
+ aSubProfile->myCellsSize += aNbConn;
+ }
+ break;
+ }
+ case MED::ePOLYEDRE: {
+ MED::PPolyedreInfo aPolyedreInfo =
+ theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom);
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ MED::TCConnSliceArr aConnSliceArr =
+ aPolyedreInfo->GetConnSliceArr(anElemId);
+ TInt aNbFaces = aConnSliceArr.size();
+ TInt aCellSize = 0;
+ for(TInt iFace = 0; iFace < aNbFaces; iFace++){
+ MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+ TInt aNbConn = aConnSlice.size();
+ aCellSize += aNbConn;
+ }
+ aSubProfile->myCellsSize += aCellSize;
+ }
+ break;
+ }
+ default: {
+ aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
+ }}
}
}
INITMSG(MYDEBUG,
- "- aMGeom = "<<theMGeom<<
- "; aEGeom = "<<aEGeom<<
- "; aName = '"<<aSubProfile->myName<<"'"<<
- "; aStatus = "<<aSubProfile->myStatus<<
- "; aNbCells = "<<aSubProfile->myNbCells<<
- "; aCellsSize = "<<aSubProfile->myCellsSize<<
- endl);
+ "- aMGeom = "<<theMGeom<<
+ "; aEGeom = "<<aEGeom<<
+ "; aName = '"<<aSubProfile->myName<<"'"<<
+ "; aStatus = "<<aSubProfile->myStatus<<
+ "; aNbCells = "<<aSubProfile->myNbCells<<
+ "; aCellsSize = "<<aSubProfile->myCellsSize<<
+ endl);
return aSubProfile;
}
//---------------------------------------------------------------
VISU::TProfileKey
GetProfileKey(const MED::PWrapper& theMEDWrapper,
- const MED::PMeshInfo& theMeshInfo,
- const MED::PTimeStampValueBase& theTimeStampValue,
- const VISU::TMEDMeshOnEntity& theMeshOnEntity,
- MED::EEntiteMaillage theMEntity,
- const MED::TGeom2Size& theGeom2Size)
+ const MED::PMeshInfo& theMeshInfo,
+ const MED::PTimeStampValueBase& theTimeStampValue,
+ const VISU::TMEDMeshOnEntity& theMeshOnEntity,
+ MED::EEntiteMaillage theMEntity,
+ const MED::TGeom2Size& theGeom2Size)
{
INITMSG(MYDEBUG,"GetProfileKey"<<endl);
for(; anIter != aGeom2Size.end(); anIter++){
MED::EGeometrieElement aMGeom = anIter->first;
VISU::PSubProfile aSubProfile = CrSubProfile(theMEDWrapper,
- theMeshInfo,
- theMEntity,
- aMGeom,
- theGeom2Size,
- aGeom2Profile);
+ theMeshInfo,
+ theMEntity,
+ aMGeom,
+ theGeom2Size,
+ aGeom2Profile);
aProfileKey.insert(aSubProfile);
}
//---------------------------------------------------------------
void
InitProfile(const MED::PWrapper& theMEDWrapper,
- const MED::PMeshInfo& theMeshInfo,
- MED::PTimeStampValueBase& theTimeStampValue,
- VISU::TMEDMeshOnEntity& theMeshOnEntity,
- MED::EEntiteMaillage theMEntity,
- const MED::TGeom2Size& theGeom2Size,
- VISU::TMEDValForTime& theValForTime)
+ const MED::PMeshInfo& theMeshInfo,
+ MED::PTimeStampValueBase& theTimeStampValue,
+ VISU::TMEDMeshOnEntity& theMeshOnEntity,
+ MED::EEntiteMaillage theMEntity,
+ const MED::TGeom2Size& theGeom2Size,
+ VISU::TMEDValForTime& theValForTime)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"InitProfile");
INITMSG(MYDEBUG,"InitProfile"<<endl);
VISU::TProfileMap& aProfileMap = theMeshOnEntity.myProfileMap;
VISU::TProfileKey aProfileKey = GetProfileKey(theMEDWrapper,
- theMeshInfo,
- theTimeStampValue,
- theMeshOnEntity,
- theMEntity,
- theGeom2Size);
+ theMeshInfo,
+ theTimeStampValue,
+ theMeshOnEntity,
+ theMEntity,
+ theGeom2Size);
VISU::TProfileMap::const_iterator anIter = aProfileMap.find(aProfileKey);
if(anIter != aProfileMap.end()){
VISU::TProfileKey::const_iterator anIter = aProfileKey.begin();
for(; anIter != aProfileKey.end(); anIter++){
- VISU::PMEDSubProfile aSubProfile(*anIter);
+ VISU::PMEDSubProfile aSubProfile(*anIter);
- if(aProfile->myIsAll && aSubProfile->myStatus != VISU::eAddAll)
- aProfile->myIsAll = false;
+ if(aProfile->myIsAll && aSubProfile->myStatus != VISU::eAddAll)
+ aProfile->myIsAll = false;
- VISU::EGeometry aEGeom = aSubProfile->myGeom;
- aGeom2SubProfile[aEGeom] = aSubProfile;
+ VISU::EGeometry aEGeom = aSubProfile->myGeom;
+ aGeom2SubProfile[aEGeom] = aSubProfile;
}
aProfileMap[aProfileKey] = aProfile;
//---------------------------------------------------------------
VISU::TGaussKey
GetGaussKey(const MED::PTimeStampValueBase& theTimeStampValue,
- const VISU::TMEDMeshOnEntity& theMeshOnEntity,
- const MED::TGeom2Size& theGeom2Size,
- VISU::TMEDValForTime& theValForTime)
+ const VISU::TMEDMeshOnEntity& theMeshOnEntity,
+ const MED::TGeom2Size& theGeom2Size,
+ VISU::TMEDValForTime& theValForTime)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"GetGaussKey");
INITMSG(MYDEBUG,"GetGaussKey"<<endl);
VISU::TGeom2SubProfile::iterator anIter2 = aGeom2SubProfile.find(aEGeom);
if(anIter2 == aGeom2SubProfile.end()){
- INITMSG(MYDEBUG,"anIter2 == aGeom2SubProfile.end!!"<<endl);
- continue;
+ INITMSG(MYDEBUG,"anIter2 == aGeom2SubProfile.end!!"<<endl);
+ continue;
}
VISU::PMEDSubProfile aSubProfile = anIter2->second;
MED::TGeom2Size::const_iterator aTimeStampIter = theGeom2Size.find(aMGeom);
if(aTimeStampIter != theGeom2Size.end()){
- TInt aNbCells = aTimeStampIter->second;
- if(aSubProfile->myStatus == VISU::eAddPart)
- aNbCells = aSubProfile->myNbCells;
-
- VISU::PMEDGaussSubMesh aGaussSubMesh(new VISU::TMEDGaussSubMesh());
- aGaussSubMesh->mySubProfile = aSubProfile;
- aGaussSubMesh->myStatus = aSubProfile->myStatus;
-
- VISU::PMEDGauss aGauss(new VISU::TMEDGauss());
- aGaussSubMesh->myGauss = aGauss;
- aGauss->myGeom = aEGeom;
- aGauss->myNbPoints = 1;
-
- MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
- if(aGaussIter != aGeom2Gauss.end()){
- MED::PGaussInfo aGaussInfo = aGaussIter->second;
- aGauss->myGaussInfo = aGaussInfo;
- aGauss->myName = aGaussInfo->GetName();
- aGauss->myNbPoints = aGaussInfo->GetNbGauss();
- } else if ( aTimeStampInfo.GetNbGauss(aMGeom) > 1 )
- EXCEPTION( std::runtime_error, "aGaussIter == aGeom2Gauss.end()"
- " && aTimeStampInfo.GetNbGauss(aMGeom) > 1 !!!" );
-
- aGaussSubMesh->myNbCells = aNbCells*aGauss->myNbPoints;
- aGaussSubMesh->myCellsSize = aGaussSubMesh->myNbCells*2;
-
- aGaussKey.insert(aGaussSubMesh);
-
- INITMSGA(MYDEBUG,0,
- "- aEGeom = "<<aGauss->myGeom<<
- "; aName = '"<<aGauss->myName<<"'"<<
- "; aNbGauss = "<<aGauss->myNbPoints<<
- "; aStatus = "<<aGaussSubMesh->myStatus<<
- "; aNbCells = "<<aGaussSubMesh->myNbCells<<
- "; aCellsSize = "<<aGaussSubMesh->myCellsSize<<
- endl);
-
- //break;
+ TInt aNbCells = aTimeStampIter->second;
+ if(aSubProfile->myStatus == VISU::eAddPart)
+ aNbCells = aSubProfile->myNbCells;
+
+ VISU::PMEDGaussSubMesh aGaussSubMesh(new VISU::TMEDGaussSubMesh());
+ aGaussSubMesh->mySubProfile = aSubProfile;
+ aGaussSubMesh->myStatus = aSubProfile->myStatus;
+
+ VISU::PMEDGauss aGauss(new VISU::TMEDGauss());
+ aGaussSubMesh->myGauss = aGauss;
+ aGauss->myGeom = aEGeom;
+ aGauss->myNbPoints = 1;
+
+ MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
+ if(aGaussIter != aGeom2Gauss.end()){
+ MED::PGaussInfo aGaussInfo = aGaussIter->second;
+ aGauss->myGaussInfo = aGaussInfo;
+ aGauss->myName = aGaussInfo->GetName();
+ aGauss->myNbPoints = aGaussInfo->GetNbGauss();
+ } else if ( aTimeStampInfo.GetNbGauss(aMGeom) > 1 )
+ EXCEPTION( std::runtime_error, "aGaussIter == aGeom2Gauss.end()"
+ " && aTimeStampInfo.GetNbGauss(aMGeom) > 1 !!!" );
+
+ aGaussSubMesh->myNbCells = aNbCells*aGauss->myNbPoints;
+ aGaussSubMesh->myCellsSize = aGaussSubMesh->myNbCells*2;
+
+ aGaussKey.insert(aGaussSubMesh);
+
+ INITMSGA(MYDEBUG,0,
+ "- aEGeom = "<<aGauss->myGeom<<
+ "; aName = '"<<aGauss->myName<<"'"<<
+ "; aNbGauss = "<<aGauss->myNbPoints<<
+ "; aStatus = "<<aGaussSubMesh->myStatus<<
+ "; aNbCells = "<<aGaussSubMesh->myNbCells<<
+ "; aCellsSize = "<<aGaussSubMesh->myCellsSize<<
+ endl);
+
+ //break;
}
}
//---------------------------------------------------------------
void
InitGaussMesh(MED::PTimeStampValueBase& theTimeStampValue,
- VISU::TMEDMeshOnEntity& theMeshOnEntity,
- const MED::TGeom2Size& theGeom2Size,
- VISU::TMEDValForTime& theValForTime)
+ VISU::TMEDMeshOnEntity& theMeshOnEntity,
+ const MED::TGeom2Size& theGeom2Size,
+ VISU::TMEDValForTime& theValForTime)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"InitGaussMesh");
INITMSG(MYDEBUG,"InitGaussMesh"<<endl);
VISU::TGaussMeshMap& aGaussMeshMap = theMeshOnEntity.myGaussMeshMap;
VISU::TGaussKey aGaussKey = GetGaussKey(theTimeStampValue,
- theMeshOnEntity,
- theGeom2Size,
- theValForTime);
+ theMeshOnEntity,
+ theGeom2Size,
+ theValForTime);
VISU::TGaussMeshMap::const_iterator anIter = aGaussMeshMap.find(aGaussKey);
if(anIter != aGaussMeshMap.end()){
VISU::PMEDGaussMesh aGaussMesh(new VISU::TMEDGaussMesh());
VISU::TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
{
- VISU::TGaussKey::const_iterator anIter = aGaussKey.begin();
- for(; anIter != aGaussKey.end(); anIter++){
- VISU::PMEDGaussSubMesh aGaussSubMesh(*anIter);
- VISU::PMEDGauss aGauss = aGaussSubMesh->myGauss;
- VISU::EGeometry aEGeom = aGauss->myGeom;
- aGeom2GaussSubMesh[aEGeom] = aGaussSubMesh;
- }
+ VISU::TGaussKey::const_iterator anIter = aGaussKey.begin();
+ for(; anIter != aGaussKey.end(); anIter++){
+ VISU::PMEDGaussSubMesh aGaussSubMesh(*anIter);
+ VISU::PMEDGauss aGauss = aGaussSubMesh->myGauss;
+ VISU::EGeometry aEGeom = aGauss->myGeom;
+ aGeom2GaussSubMesh[aEGeom] = aGaussSubMesh;
+ }
}
{
- VISU::TGaussSubMeshArr& aGaussSubMeshArr = aGaussMesh->myGaussSubMeshArr;
- aGaussSubMeshArr.resize(aGeom2GaussSubMesh.size());
- VISU::TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.begin();
- for(TInt anID = 0; anIter != aGeom2GaussSubMesh.end(); anIter++, anID++){
- const VISU::PGaussSubMeshImpl& aGaussSubMesh = anIter->second;
- aGaussSubMeshArr[anID] = aGaussSubMesh;
- }
+ VISU::TGaussSubMeshArr& aGaussSubMeshArr = aGaussMesh->myGaussSubMeshArr;
+ aGaussSubMeshArr.resize(aGeom2GaussSubMesh.size());
+ VISU::TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.begin();
+ for(TInt anID = 0; anIter != aGeom2GaussSubMesh.end(); anIter++, anID++){
+ const VISU::PGaussSubMeshImpl& aGaussSubMesh = anIter->second;
+ aGaussSubMeshArr[anID] = aGaussSubMesh;
+ }
}
INITMSG(MYDEBUG,"aGaussMeshMap[aGaussKey] = aGaussMesh"<<std::endl);
aGaussMeshMap[aGaussKey] = aGaussMesh;
//---------------------------------------------------------------
void
BuildMeshOnEntityMap(VISU::PMEDMesh theMesh,
- const MED::TEntityInfo& theEntityInfo,
- const MED::PNodeInfo& theNodeInfo,
- const MED::PWrapper& theMEDWrapper)
+ const MED::TEntityInfo& theEntityInfo,
+ const MED::PNodeInfo& theNodeInfo,
+ const MED::PWrapper& theMEDWrapper)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMeshOnEntityMap");
INITMSG(MYDEBUG,"BuildMeshOnEntityMap"<<endl);
VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
VISU::PMEDMeshOnEntity aMeshOnEntity =
- aMeshOnEntityMap[aVEntity](new VISU::TMEDMeshOnEntity());
+ aMeshOnEntityMap[aVEntity](new VISU::TMEDMeshOnEntity());
aMeshOnEntity->myEntity = aVEntity;
aMeshOnEntity->myMeshName = aMeshName;
aMeshOnEntity->myGeom2Size = aGeom2Size;
VISU::TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
+ VISU::TGeom2ElemID2FamilyID& aGeom2ElemID2FamilyID = aMeshOnEntity->myGeom2ElemID2FamilyID;
INITMSG(MYDEBUG,
- "- aMEntity = "<<aMEntity<<
- "; aVEntity = "<<aVEntity<<
- endl);
+ "- aMEntity = "<<aMEntity<<
+ "; aVEntity = "<<aVEntity<<
+ endl);
if(aMEntity == MED::eNOEUD){
- aMeshOnEntity->myNbCells = theMesh->myNbPoints;
- aMeshOnEntity->myCellsSize = 2*theMesh->myNbPoints;
-
- for(TInt iElem = 0; iElem < theMesh->myNbPoints; iElem++){
- TInt aFamId = theNodeInfo->GetFamNum(iElem);
- if(aFamId != 0)
- aFamilyID2CellsSize[aFamId] += 2;
- }
-
- INITMSG(MYDEBUG,
- "- myNbCells = "<<aMeshOnEntity->myNbCells<<
- "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
- std::endl);
-
+ aMeshOnEntity->myNbCells = theMesh->myNbPoints;
+ aMeshOnEntity->myCellsSize = 2*theMesh->myNbPoints;
+
+ VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[MED::ePOINT1];
+
+ for(TInt iElem = 0; iElem < theMesh->myNbPoints; iElem++){
+ TInt aFamId = theNodeInfo->GetFamNum(iElem);
+ if(aFamId != 0)
+ aFamilyID2CellsSize[aFamId] += 2;
+ anElemID2FamilyID[iElem] = aFamId;
+ }
+
+ INITMSG(MYDEBUG,
+ "- myNbCells = "<<aMeshOnEntity->myNbCells<<
+ "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
+ std::endl);
+
}else{
- MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
- aMeshOnEntity->myNbCells = 0;
- aMeshOnEntity->myCellsSize = 0;
- for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
- const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
-
- switch(aMGeom){
- case MED::ePOLYGONE: {
- MED::PPolygoneInfo aPolygoneInfo = theMEDWrapper->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
- TInt aNbElem = aPolygoneInfo->GetNbElem();
-
- INITMSG(MYDEBUG,
- "- aMGeom = "<<aMGeom<<
- "; aNbElem = "<<aNbElem<<
- endl);
-
- aMeshOnEntity->myNbCells += aNbElem;
- for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
- TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId);
- aMeshOnEntity->myCellsSize += aNbConn;
- TInt aFamId = aPolygoneInfo->GetFamNum(anElemId);
- if(aFamId != 0)
- aFamilyID2CellsSize[aFamId] += aNbConn + 1;
- }
- break;
- }
- case MED::ePOLYEDRE: {
- MED::PPolyedreInfo aPolyedreInfo = theMEDWrapper->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
- TInt aNbElem = aPolyedreInfo->GetNbElem();
-
- INITMSG(MYDEBUG,
- "- aMGeom = "<<aMGeom<<
- "; aNbElem = "<<aNbElem<<
- endl);
-
- aMeshOnEntity->myNbCells += aNbElem;
- for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
- MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(anElemId);
- TInt aNbFaces = aConnSliceArr.size();
- TInt aCellSize = 0;
- for(TInt iFace = 0; iFace < aNbFaces; iFace++){
- MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
- TInt aNbConn = aConnSlice.size();
- aCellSize += aNbConn;
- }
- aMeshOnEntity->myCellsSize += aCellSize;
- TInt aFamId = aPolyedreInfo->GetFamNum(anElemId);
- if(aFamId != 0)
- aFamilyID2CellsSize[aFamId] += aCellSize + 1;
- }
- break;
- }
- default: {
- VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
- vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
- MED::PCellInfo aCellInfo = theMEDWrapper->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
- TInt aNbElem = aCellInfo->GetNbElem();
- aMeshOnEntity->myNbCells += aNbElem;
- aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
-
- INITMSG(MYDEBUG,
- "- aMGeom = "<<aMGeom<<
- "; aNbElem = "<<aNbElem<<
- "; myNbCells = "<<aMeshOnEntity->myNbCells<<
- "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
- endl);
-
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- TInt aFamId = aCellInfo->GetFamNum(iElem);
- if(aFamId != 0)
- aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
- }
- }} // end switch(...)
- }
+ MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
+ aMeshOnEntity->myNbCells = 0;
+ aMeshOnEntity->myCellsSize = 0;
+ for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
+ const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
+
+ VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[aMGeom];
+ switch(aMGeom){
+ case MED::ePOLYGONE: {
+ MED::PPolygoneInfo aPolygoneInfo = theMEDWrapper->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
+ TInt aNbElem = aPolygoneInfo->GetNbElem();
+
+ INITMSG(MYDEBUG,
+ "- aMGeom = "<<aMGeom<<
+ "; aNbElem = "<<aNbElem<<
+ endl);
+
+ aMeshOnEntity->myNbCells += aNbElem;
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId);
+ aMeshOnEntity->myCellsSize += aNbConn;
+ TInt aFamId = aPolygoneInfo->GetFamNum(anElemId);
+ if(aFamId != 0)
+ aFamilyID2CellsSize[aFamId] += aNbConn + 1;
+ anElemID2FamilyID[anElemId] = aFamId;
+ }
+ break;
+ }
+ case MED::ePOLYEDRE: {
+ MED::PPolyedreInfo aPolyedreInfo = theMEDWrapper->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
+ TInt aNbElem = aPolyedreInfo->GetNbElem();
+
+ INITMSG(MYDEBUG,
+ "- aMGeom = "<<aMGeom<<
+ "; aNbElem = "<<aNbElem<<
+ endl);
+
+ aMeshOnEntity->myNbCells += aNbElem;
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(anElemId);
+ TInt aNbFaces = aConnSliceArr.size();
+ TInt aCellSize = 0;
+ for(TInt iFace = 0; iFace < aNbFaces; iFace++){
+ MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+ TInt aNbConn = aConnSlice.size();
+ aCellSize += aNbConn;
+ }
+ aMeshOnEntity->myCellsSize += aCellSize;
+ TInt aFamId = aPolyedreInfo->GetFamNum(anElemId);
+ if(aFamId != 0)
+ aFamilyID2CellsSize[aFamId] += aCellSize + 1;
+ anElemID2FamilyID[anElemId] = aFamId;
+ }
+ break;
+ }
+ default: {
+ VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
+ vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
+ MED::PCellInfo aCellInfo = theMEDWrapper->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
+ TInt aNbElem = aCellInfo->GetNbElem();
+ aMeshOnEntity->myNbCells += aNbElem;
+ aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
+
+ INITMSG(MYDEBUG,
+ "- aMGeom = "<<aMGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; myNbCells = "<<aMeshOnEntity->myNbCells<<
+ "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
+ endl);
+
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ TInt aFamId = aCellInfo->GetFamNum(iElem);
+ if(aFamId != 0)
+ aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
+ anElemID2FamilyID[iElem] = aFamId;
+ }
+ }} // end switch(...)
+ }
}
}
}
//---------------------------------------------------------------
void
BuildMeshGrilleOnEntityMap(VISU::PMEDMesh theMesh,
- const MED::TEntityInfo& theEntityInfo,
- const MED::PGrilleInfo& theGrilleInfo,
- const MED::PWrapper& theMEDWrapper)
+ const MED::TEntityInfo& theEntityInfo,
+ const MED::PGrilleInfo& theGrilleInfo,
+ const MED::PWrapper& theMEDWrapper)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMeshGrilleOnEntityMap");
INITMSG(MYDEBUG,"BuildMeshGrilleOnEntityMap"<<endl);
VISU::TStructuredId& aGrilleStructure = theMesh->myGrilleStructure;
if ( theGrilleInfo->GetGrilleType() != MED::eGRILLE_STANDARD )
for ( int aDimId = 0; aDimId < theMesh->myDim; aDimId++ )
- aGrilleStructure[aDimId] = theGrilleInfo->GetNbIndexes(aDimId);
+ aGrilleStructure[aDimId] = theGrilleInfo->GetNbIndexes(aDimId);
else {
MED::TIntVector aVector = theGrilleInfo->GetGrilleStructure();
for ( int aDimId = 0; aDimId < aVector.size(); aDimId++ )
- aGrilleStructure[aDimId] = aVector[aDimId];
+ aGrilleStructure[aDimId] = aVector[aDimId];
}
int kMax = aGrilleStructure[2];
switch ( theMesh->myDim ) {
case 1:
for ( int i = 1; i <= iMax; i++ )
- aObj2StructuredId[i-1][0] = i;
+ aObj2StructuredId[i-1][0] = i;
break;
case 2:
for ( int j = 1; j <= jMax; j++ )
- for ( int i = 1; i <= iMax; i++ ) {
- aObj2StructuredId[iii][0] = i;
- aObj2StructuredId[iii][1] = j;
- iii++;
- }
+ for ( int i = 1; i <= iMax; i++ ) {
+ aObj2StructuredId[iii][0] = i;
+ aObj2StructuredId[iii][1] = j;
+ iii++;
+ }
break;
case 3:
for ( int k = 1; k <= kMax; k++ )
- for ( int j = 1; j <= jMax; j++ )
- for ( int i = 1; i <= iMax; i++ ) {
- aObj2StructuredId[iii][0] = i;
- aObj2StructuredId[iii][1] = j;
- aObj2StructuredId[iii][2] = k;
- iii++;
- }
+ for ( int j = 1; j <= jMax; j++ )
+ for ( int i = 1; i <= iMax; i++ ) {
+ aObj2StructuredId[iii][0] = i;
+ aObj2StructuredId[iii][1] = j;
+ aObj2StructuredId[iii][2] = k;
+ iii++;
+ }
}
for(; anEntityIter != theEntityInfo.end(); anEntityIter++){
VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
VISU::PMEDMeshOnEntity aMeshOnEntity =
- aMeshOnEntityMap[aVEntity](new VISU::TMEDMeshOnEntity());
+ aMeshOnEntityMap[aVEntity](new VISU::TMEDMeshOnEntity());
aMeshOnEntity->myEntity = aVEntity;
aMeshOnEntity->myMeshName = aMeshName;
aMeshOnEntity->myGeom2Size = aGeom2Size;
VISU::TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
+ VISU::TGeom2ElemID2FamilyID& aGeom2ElemID2FamilyID = aMeshOnEntity->myGeom2ElemID2FamilyID;
INITMSG(MYDEBUG,
- "- aMEntity = "<<aMEntity<<
- "; aVEntity = "<<aVEntity<<
- endl);
-
+ "- aMEntity = "<<aMEntity<<
+ "; aVEntity = "<<aVEntity<<
+ endl);
+
if(aMEntity == MED::eNOEUD){
- aMeshOnEntity->myNbCells = theGrilleInfo->GetNbNodes();
- aMeshOnEntity->myCellsSize = 2*theGrilleInfo->GetNbNodes();
-
- if((theGrilleInfo->myFamNumNode).size() > 0)
- for(TInt iElem = 0; iElem < theGrilleInfo->GetNbNodes(); iElem++){
- TInt aFamId = theGrilleInfo->GetFamNumNode(iElem);
- if(aFamId != 0)
- aFamilyID2CellsSize[aFamId] += 2;
- }
-
- INITMSG(MYDEBUG,
- "- myNbCells = "<<aMeshOnEntity->myNbCells<<
- "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
- endl);;
-
+ aMeshOnEntity->myNbCells = theGrilleInfo->GetNbNodes();
+ aMeshOnEntity->myCellsSize = 2*theGrilleInfo->GetNbNodes();
+
+ VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[MED::ePOINT1];
+
+ if((theGrilleInfo->myFamNumNode).size() > 0)
+ for(TInt iElem = 0; iElem < theGrilleInfo->GetNbNodes(); iElem++){
+ TInt aFamId = theGrilleInfo->GetFamNumNode(iElem);
+ if(aFamId != 0)
+ aFamilyID2CellsSize[aFamId] += 2;
+ anElemID2FamilyID[iElem] = aFamId;
+ }
+
+ INITMSG(MYDEBUG,
+ "- myNbCells = "<<aMeshOnEntity->myNbCells<<
+ "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
+ endl);;
+
} else {
- MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
- aMeshOnEntity->myNbCells = 0;
- aMeshOnEntity->myCellsSize = 0;
- for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
- const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
- VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
- vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
- TInt aNbElem = aGeom2SizeIter->second;//theGrilleInfo->GetNbCells();
- aMeshOnEntity->myNbCells += aNbElem;
- aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
-
- INITMSG(MYDEBUG,
- "- aMGeom = "<<aMGeom<<
- "; aNbElem = "<<aNbElem<<
- "; myNbCells = "<<aMeshOnEntity->myNbCells<<
- "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
- endl);
-
- if((theGrilleInfo->myFamNum).size() > 0)
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- TInt aFamId = theGrilleInfo->GetFamNum(iElem);
- if(aFamId != 0)
- aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
- }
- }
+ MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
+ aMeshOnEntity->myNbCells = 0;
+ aMeshOnEntity->myCellsSize = 0;
+ for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
+ const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
+ VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
+ vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
+ TInt aNbElem = aGeom2SizeIter->second;//theGrilleInfo->GetNbCells();
+ aMeshOnEntity->myNbCells += aNbElem;
+ aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
+
+ VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[aMGeom];
+
+ INITMSG(MYDEBUG,
+ "- aMGeom = "<<aMGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; myNbCells = "<<aMeshOnEntity->myNbCells<<
+ "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
+ endl);
+
+ MED::TElemNum& famNums =
+ (aMEntity == MED::eMAILLE) ? theGrilleInfo->myFamNum : theGrilleInfo->myFamSubNum;
+ if (famNums.size() == aNbElem)
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ TInt aFamId = famNums[iElem];
+ if(aFamId != 0)
+ aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
+ anElemID2FamilyID[iElem] = aFamId;
+ }
+ }
}
}
}
//---------------------------------------------------------------
void
BuildFieldMap(VISU::PMEDMesh theMesh,
- const MED::TEntityInfo& theEntityInfo,
- MED::PWrapper theMEDWrapper)
+ const MED::TEntityInfo& theEntityInfo,
+ MED::PWrapper theMEDWrapper)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"BuildFieldMap");
TInt aNbFields = theMEDWrapper->GetNbFields();
MED::TErr anError = 0;
MED::PFieldInfo aFieldInfo = theMEDWrapper->GetPFieldInfo(aMeshInfo, iField, &anError);
if ( anError < 0 )
- continue;
+ continue;
TInt aNbComp = aFieldInfo->GetNbComp();
std::string aFieldName = aFieldInfo->GetName();
MED::TGeom2Size aGeom2Size;
MED::EEntiteMaillage aMEntity;
TInt aNbTimeStamps = theMEDWrapper->GetNbTimeStamps(aFieldInfo,
- theEntityInfo,
- aMEntity,
- aGeom2Size);
+ theEntityInfo,
+ aMEntity,
+ aGeom2Size);
if(aNbTimeStamps < 1)
- continue;
+ continue;
VISU::TEntity aVEntity = MEDEntityToVTK( aMEntity );
vtkIdType aDataType = VTK_DOUBLE;
if ( aFieldInfo->GetType() != MED::eFLOAT64 ) {
#if defined(HAVE_F77INT64)
- aDataType = VTK_LONG;
-#else
- aDataType = VTK_INT;
+ aDataType = VTK_LONG;
+#else
+ aDataType = VTK_INT;
#endif
}
VISU::PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity];
aField->myIsELNO = ( aMEntity == MED::eNOEUD_ELEMENT );
INITMSG(MYDEBUG,"myName = '"<<aField->myName<<"'"<<
- "; myId = "<<aField->myId<<
- "; myEntity = "<<aField->myEntity<<
- "; myDataSize = "<<aField->myDataSize<<
- "; myNbComp = "<<aField->myNbComp<<"\n");
+ "; myId = "<<aField->myId<<
+ "; myEntity = "<<aField->myEntity<<
+ "; myDataSize = "<<aField->myDataSize<<
+ "; myNbComp = "<<aField->myNbComp<<"\n");
for(TInt iComp = 0; iComp < aNbComp; iComp++){
- aField->myCompNames[iComp] = aFieldInfo->GetCompName(iComp);
- aField->myUnitNames[iComp] = aFieldInfo->GetUnitName(iComp);
+ aField->myCompNames[iComp] = aFieldInfo->GetCompName(iComp);
+ aField->myUnitNames[iComp] = aFieldInfo->GetUnitName(iComp);
}
for(TInt iTimeStamp = 1; iTimeStamp <= aNbTimeStamps; iTimeStamp++){
- VISU::TTimerLog aTimerLog(MYDEBUG,"GetPTimeStampInfo");
-
- MED::TErr anError = 0;
- MED::PTimeStampInfo aTimeStampInfo = theMEDWrapper->GetPTimeStampInfo(aFieldInfo,
- aMEntity,
- aGeom2Size,
- iTimeStamp,
- &anError);
- if ( anError < 0 )
- continue;
-
- TFloat aDt = aTimeStampInfo->GetDt();
- std::string anUnitDt = aTimeStampInfo->GetUnitDt();
-
- VISU::TValField& aValField = aField->myValField;
- VISU::PMEDValForTime aValForTime = aValField[iTimeStamp](new VISU::TMEDValForTime());
- aValForTime->myId = iTimeStamp;
- aValForTime->myFieldName = aField->myName;
- aValForTime->myEntity = aField->myEntity;
- aValForTime->myMeshName = aField->myMeshName;
- aValForTime->myTime = VISU::TTime(aDt,anUnitDt);
- INITMSG(MYDEBUG,"aDt = '"<<aDt<<", "<<anUnitDt<<"'\n");
-
- VISU::TGeom2NbGauss& aVGeom2NbGauss = aValForTime->myGeom2NbGauss;
- const MED::TGeom2NbGauss& aMGeom2NbGauss = aTimeStampInfo->myGeom2NbGauss;
- MED::TGeom2NbGauss::const_iterator anIter = aMGeom2NbGauss.begin();
- for(; anIter != aMGeom2NbGauss.end(); anIter++){
- const MED::EGeometrieElement& aMGeom = anIter->first;
- VISU::EGeometry aEGeom = MEDGeom2VISU( aMGeom );
- TInt aNbGauss = anIter->second;
- aVGeom2NbGauss[ aEGeom ] = aNbGauss;
-
- // ELNO data should satisfy the following condition ( implicitly )
- vtkIdType aNbNodes = MEDGeom2NbNodes( aMGeom );
- aField->myIsELNO &= ( aNbGauss == aNbNodes );
- }
+ VISU::TTimerLog aTimerLog(MYDEBUG,"GetPTimeStampInfo");
+
+ MED::TErr anError = 0;
+ MED::PTimeStampInfo aTimeStampInfo = theMEDWrapper->GetPTimeStampInfo(aFieldInfo,
+ aMEntity,
+ aGeom2Size,
+ iTimeStamp,
+ &anError);
+ if ( anError < 0 )
+ continue;
+
+ TFloat aDt = aTimeStampInfo->GetDt();
+ std::string anUnitDt = aTimeStampInfo->GetUnitDt();
+
+ VISU::TValField& aValField = aField->myValField;
+ VISU::PMEDValForTime aValForTime = aValField[iTimeStamp](new VISU::TMEDValForTime());
+ aValForTime->myId = iTimeStamp;
+ aValForTime->myFieldName = aField->myName;
+ aValForTime->myEntity = aField->myEntity;
+ aValForTime->myMeshName = aField->myMeshName;
+ aValForTime->myTime = VISU::TTime(aDt,anUnitDt);
+ INITMSG(MYDEBUG,"aDt = '"<<aDt<<", "<<anUnitDt<<"'\n");
+
+ VISU::TGeom2NbGauss& aVGeom2NbGauss = aValForTime->myGeom2NbGauss;
+ const MED::TGeom2NbGauss& aMGeom2NbGauss = aTimeStampInfo->myGeom2NbGauss;
+ MED::TGeom2NbGauss::const_iterator anIter = aMGeom2NbGauss.begin();
+ for(; anIter != aMGeom2NbGauss.end(); anIter++){
+ const MED::EGeometrieElement& aMGeom = anIter->first;
+ VISU::EGeometry aEGeom = MEDGeom2VISU( aMGeom );
+ TInt aNbGauss = anIter->second;
+ aVGeom2NbGauss[ aEGeom ] = aNbGauss;
+
+ // ELNO data should satisfy the following condition ( implicitly )
+ vtkIdType aNbNodes = MEDGeom2NbNodes( aMGeom );
+ aField->myIsELNO &= ( aNbGauss == aNbNodes );
+ }
}
}
}
//---------------------------------------------------------------
void
BuildFamilyMap(VISU::PMEDMesh theMesh,
- const MED::TEntityInfo& theEntityInfo,
- const MED::TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo,
- const MED::TFamilyInfoSet& theFamilyInfoSet,
- MED::PWrapper theMEDWrapper)
+ const MED::TEntityInfo& theEntityInfo,
+ const MED::TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo,
+ const MED::TFamilyInfoSet& theFamilyInfoSet,
+ MED::PWrapper theMEDWrapper)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"BuildFamilyMap");
INITMSG(MYDEBUG,"BuildFamilyMap\n");
VISU::PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity];
const VISU::TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
-
+ VISU::TFamilyIDMap& aFamilyIDMap = aMeshOnEntity->myFamilyIDMap;
+
if(aFamilyTSizeSet.empty())
- continue;
-
+ continue;
+
INITMSG(MY_FAMILY_DEBUG,
- "- aMEntity = "<<aMEntity<<
- "; aVEntity = "<<aVEntity<<
- endl);
+ "- aMEntity = "<<aMEntity<<
+ "; aVEntity = "<<aVEntity<<
+ endl);
MED::TFamilyTSizeSet::const_iterator aFamilyTSizeSetIter = aFamilyTSizeSet.begin();
for(; aFamilyTSizeSetIter != aFamilyTSizeSet.end(); aFamilyTSizeSetIter++){
- const MED::TFamilyTSize& aFamilyTSize = *aFamilyTSizeSetIter;
- const MED::PFamilyInfo& aFamilyInfo = boost::get<0>(aFamilyTSize);
- TInt aSize = boost::get<1>(aFamilyTSize);
- TInt anId = aFamilyInfo->GetId();
- if(anId == 0)
- continue;
-
- std::string aFamilyName = aFamilyInfo->GetName();
-
- VISU::PMEDFamily aFamily = aFamilyMap[aFamilyName](new VISU::TMEDFamily());
- aFamily->myId = anId;
- aFamily->myEntity = aVEntity;
- aFamily->myName = aFamilyName;
- aFamily->myNbCells = aSize;
-
- aFamily->myCellsSize = 0;
- VISU::TFamilyID2CellsSize::const_iterator anIter = aFamilyID2CellsSize.find(anId);
- if(anIter != aFamilyID2CellsSize.end())
- aFamily->myCellsSize = anIter->second;
-
- INITMSG(MY_FAMILY_DEBUG,
- "- aFamilyName = '"<<aFamilyName<<"'"<<
- "; myId = "<<aFamily->myId<<"; "<<
- "; aNbAttr = "<<aFamilyInfo->GetNbAttr()<<
- "; aNbGroup = "<<aFamilyInfo->GetNbGroup()<<
- "; aVEntity = "<<aVEntity<<
- "; myNbCells = "<<aFamily->myNbCells<<
- "; myCellsSize = "<<aFamily->myCellsSize<<
- endl);
-#ifdef _DEBUG_
- const TInt aNbGroup = aFamilyInfo->GetNbGroup();
- for(TInt i = 0; i < aNbGroup; i++){
- std::string aGroupName = aFamilyInfo->GetGroupName(i);
- INITMSG(MY_FAMILY_DEBUG,"- aGroupName = '"<<aGroupName<<"'\n");
- }
+ const MED::TFamilyTSize& aFamilyTSize = *aFamilyTSizeSetIter;
+ const MED::PFamilyInfo& aFamilyInfo = boost::get<0>(aFamilyTSize);
+ TInt aSize = boost::get<1>(aFamilyTSize);
+ TInt anId = aFamilyInfo->GetId();
+ if(anId == 0)
+ continue;
+
+ std::string aFamilyName = aFamilyInfo->GetName();
+
+ VISU::PMEDFamily aFamily = aFamilyMap[aFamilyName](new VISU::TMEDFamily());
+ aFamily->myId = anId;
+ aFamily->myEntity = aVEntity;
+ aFamily->myName = aFamilyName;
+ aFamily->myNbCells = aSize;
+
+ aFamily->myCellsSize = 0;
+ VISU::TFamilyID2CellsSize::const_iterator anIter = aFamilyID2CellsSize.find(anId);
+ if(anIter != aFamilyID2CellsSize.end())
+ aFamily->myCellsSize = anIter->second;
+
+ const TInt aNbGroup = aFamilyInfo->GetNbGroup();
+ VISU::TNames& aGroupNames = aFamily->myGroupNames;
+ aGroupNames.resize(aNbGroup);
+ for(TInt i = 0; i < aNbGroup; i++){
+ std::string aGroupName = aFamilyInfo->GetGroupName(i);
+ aGroupNames[i] = aGroupName;
+ }
+
+ aFamilyIDMap[anId] = aFamily;
+
+ INITMSG(MY_FAMILY_DEBUG,
+ "- aFamilyName = '"<<aFamilyName<<"'"<<
+ "; myId = "<<aFamily->myId<<"; "<<
+ "; aNbAttr = "<<aFamilyInfo->GetNbAttr()<<
+ "; aNbGroup = "<<aFamilyInfo->GetNbGroup()<<
+ "; aVEntity = "<<aVEntity<<
+ "; myNbCells = "<<aFamily->myNbCells<<
+ "; myCellsSize = "<<aFamily->myCellsSize<<
+ endl);
+#ifdef _DEBUG_
+ for(TInt i = 0; i < aNbGroup; i++){
+ std::string aGroupName = aFamilyInfo->GetGroupName(i);
+ INITMSG(MY_FAMILY_DEBUG,"- aGroupName = '"<<aGroupName<<"'\n");
+ }
#endif
}
*/
void
BuildGrilleFamilyMap(VISU::PMEDMesh theMesh,
- const MED::TEntityInfo& theEntityInfo,
- const MED::TFamilyInfoSet& theFamilyInfoSet,
- MED::PWrapper theMEDWrapper)
+ const MED::TEntityInfo& theEntityInfo,
+ const MED::TFamilyInfoSet& theFamilyInfoSet,
+ MED::PWrapper theMEDWrapper)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"BuildGrilleFamilyMap");
INITMSG(MYDEBUG,"BuildGrilleFamilyMap\n");
TInt anId = aFamilyInfo->GetId();
if(anId == 0)
- continue;
+ continue;
std::string aFamilyName = aFamilyInfo->GetName();
const MED::EEntiteMaillage& aMEntity = MED::GetEntityByFamilyId(aGrilleInfo,
- anId);
+ anId);
VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
VISU::PMEDMeshOnEntity aMeshOnEntity;
VISU::TMeshOnEntityMap::iterator aMeshOnEntityIter = aMeshOnEntityMap.find(aVEntity);
if(aMeshOnEntityIter != aMeshOnEntityMap.end())
- aMeshOnEntity = aMeshOnEntityIter->second;
+ aMeshOnEntity = aMeshOnEntityIter->second;
VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+ VISU::TFamilyIDMap& aFamilyIDMap = aMeshOnEntity->myFamilyIDMap;
VISU::PMEDFamily aFamily = aFamilyMap[aFamilyName](new VISU::TMEDFamily());
aFamily->myId = anId;
const VISU::TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
VISU::TFamilyID2CellsSize::const_iterator aFamilyid2CellsSizeIter = aFamilyID2CellsSize.find(anId);
if(aFamilyid2CellsSizeIter != (aMeshOnEntity->myFamilyID2CellsSize).end())
- aFamily->myCellsSize = aFamilyid2CellsSizeIter->second;
+ aFamily->myCellsSize = aFamilyid2CellsSizeIter->second;
MED::TFamilyID2NbCells::const_iterator aFam2NbCellsIter = aFam2NbCells.find(anId);
if(aFam2NbCellsIter != aFam2NbCells.end())
- aFamily->myNbCells = aFam2NbCellsIter->second;
+ aFamily->myNbCells = aFam2NbCellsIter->second;
+
+ const TInt aNbGroup = aFamilyInfo->GetNbGroup();
+ VISU::TNames& aGroupNames = aFamily->myGroupNames;
+ aGroupNames.resize(aNbGroup);
+ for(TInt i = 0; i < aNbGroup; i++){
+ std::string aGroupName = aFamilyInfo->GetGroupName(i);
+ aGroupNames[i] = aGroupName;
+ }
+
+ aFamilyIDMap[anId] = aFamily;
INITMSG(MY_FAMILY_DEBUG,
- "- aFamilyName =|"<<aFamily->myName<<"|"
- << "; myId = "<<aFamily->myId
- << "; aNbAttr = "<<aFamilyInfo->GetNbAttr()
- << "; aNbGroup = "<<aFamilyInfo->GetNbGroup()
- << "; aVEntity = "<<aVEntity
- << "; myNbCells = "<<aFamily->myNbCells
- << "; myCellsSize = "<<aFamily->myCellsSize
- <<endl);
+ "- aFamilyName =|"<<aFamily->myName<<"|"
+ << "; myId = "<<aFamily->myId
+ << "; aNbAttr = "<<aFamilyInfo->GetNbAttr()
+ << "; aNbGroup = "<<aFamilyInfo->GetNbGroup()
+ << "; aVEntity = "<<aVEntity
+ << "; myNbCells = "<<aFamily->myNbCells
+ << "; myCellsSize = "<<aFamily->myCellsSize
+ <<endl);
}
//---------------------------------------------------------------
void
BuildGroupMap(VISU::PMEDMesh theMesh,
- const MED::TFamilyInfoSet& theFamilyInfoSet)
+ const MED::TFamilyInfoSet& theFamilyInfoSet)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"BuildGroupMap");
INITMSG(MYDEBUG,"BuildGroupMap\n");
const MED::TFamilyInfoSet& aFamilyInfoSet = aGroupInfoIter->second;
MED::TFamilyInfoSet::const_iterator aFamilyIter = aFamilyInfoSet.begin();
for(; aFamilyIter != aFamilyInfoSet.end(); aFamilyIter++){
- const MED::PFamilyInfo& aFamilyInfo = *aFamilyIter;
- std::string aFamilyName = aFamilyInfo->GetName();
-
- VISU::TEntity aVEntity = VISU::TEntity(-1);
- VISU::PMEDFamily aFamily;
-
- // Find aVisuEntity
- const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
- VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityIter = aMeshOnEntityMap.begin();
- for(; aMeshOnEntityIter != aMeshOnEntityMap.end(); aMeshOnEntityIter++){
- const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityIter->second;
- const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
- VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
- for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
- const std::string& aName = aFamilyMapIter->first;
- if(aName == aFamilyName){
+ const MED::PFamilyInfo& aFamilyInfo = *aFamilyIter;
+ std::string aFamilyName = aFamilyInfo->GetName();
+
+ VISU::TEntity aVEntity = VISU::TEntity(-1);
+ VISU::PMEDFamily aFamily;
+
+ // Find aVisuEntity
+ const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
+ VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityIter = aMeshOnEntityMap.begin();
+ for(; aMeshOnEntityIter != aMeshOnEntityMap.end(); aMeshOnEntityIter++){
+ const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityIter->second;
+ const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+ VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
+ for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
+ const std::string& aName = aFamilyMapIter->first;
+ if(aName == aFamilyName){
aFamily = aFamilyMapIter->second;
- aVEntity = aFamily->myEntity;
- goto exit_lable;
- }
- }
- }
- exit_lable:
- if(aFamily && aVEntity >= 0){
- aFamilySet.insert(aFamily);
- INITMSG(MY_GROUP_DEBUG,
- "- aFamilyName = '"<<aFamilyName<<"'"<<
- "; aVEntity = "<<aVEntity<<
- "\n");
- }
+ aVEntity = aFamily->myEntity;
+ if(aFamily && aVEntity >= 0){
+ aFamilySet.insert(VISU::TEnity2Family(aVEntity, aFamily));
+ INITMSG(MY_GROUP_DEBUG,
+ "- aFamilyName = '"<<aFamilyName<<"'"<<
+ "; aVEntity = "<<aVEntity<<
+ "\n");
+ }
+ }
+ }
+ }
}
if(!aFamilySet.empty())
- aGroupMap.insert(VISU::TGroupMap::value_type(aGroupName,aGroup));
+ aGroupMap.insert(VISU::TGroupMap::value_type(aGroupName,aGroup));
}
}
void
TMEDNamedPointCoords
::Init(const MED::PNodeInfo& theNodeInfo,
- MED::EVersion theVersion)
+ MED::EVersion theVersion)
{
TMEDCoordHolder* aCoordHolder = new TMEDCoordHolder();
TInt aNbElem = theNodeInfo->GetNbElem();
- TInt aDim = theNodeInfo->GetMeshInfo()->GetDim();
+ TInt aDim = theNodeInfo->GetMeshInfo()->GetSpaceDim();
aCoordHolder->Init(aNbElem, aDim, theNodeInfo->myCoord);
TNamedPointCoords::Init(PCoordHolder(aCoordHolder));
myVersion = theVersion;
{
TMEDCoordHolder* aCoordHolder = new TMEDCoordHolder();
TInt aNbElem = theGrilleInfo->GetNbNodes();
- TInt aDim = theGrilleInfo->GetMeshInfo()->GetDim();
+ TInt aDim = theGrilleInfo->GetMeshInfo()->GetSpaceDim();
MED::PNodeCoord aCoord(new MED::TNodeCoord(aNbElem * aDim));
aCoordHolder->Init(aNbElem, aDim, aCoord);
TNamedPointCoords::Init(PCoordHolder(aCoordHolder));
VISU::TCoordSlice aVCoordSlice = GetCoordSlice(iElem);
MED::TNodeCoord aMCoord = theGrilleInfo->GetCoord(iElem);
for(TInt iDim = 0; iDim < aDim; iDim++){
- aVCoordSlice[iDim] = aMCoord[iDim];
+ aVCoordSlice[iDim] = aMCoord[iDim];
}
}
}
if(myIsElemNum){
// To prepare corresponding mapper engine
if(myObj2VTKID.empty()){
- vtkIdType anEnd = myElemNum->size();
- for(vtkIdType anID = 0; anID < anEnd; anID++)
- myObj2VTKID[(*myElemNum)[anID]] = anID;
+ vtkIdType anEnd = myElemNum->size();
+ for(vtkIdType anID = 0; anID < anEnd; anID++)
+ myObj2VTKID[(*myElemNum)[anID]] = anID;
}
TObj2VTKID::const_iterator anIter = myObj2VTKID.find(theID);
if(anIter != myObj2VTKID.end())
- return anIter->second;
+ return anIter->second;
return -1;
}
return TNamedPointCoords::GetVTKID(theID);
{
if ( myIsElemNum )
for ( size_t anId = 0; anId < (*myElemNum).size(); anId++ )
- if ( (*myElemNum)[ anId ] == theID ) {
- theID = anId;
- break;
- }
+ if ( (*myElemNum)[ anId ] == theID ) {
+ theID = anId;
+ break;
+ }
return TSubProfileImpl::GetElemVTKID( theID );
}
void
TMEDGauss
::LessThan(const PGaussImpl& theGauss,
- bool& theResult) const
+ bool& theResult) const
{
TGaussImpl::LessThan(theGauss,theResult);
if(myGaussInfo){
if(PMEDGauss aGauss = theGauss){
- const MED::TGaussInfo& aLeft = myGaussInfo;
- const MED::TGaussInfo& aReight = aGauss->myGaussInfo;
- theResult = MED::TGaussInfo::TLess()(aLeft,aReight);
+ const MED::TGaussInfo& aLeft = myGaussInfo;
+ const MED::TGaussInfo& aReight = aGauss->myGaussInfo;
+ theResult = MED::TGaussInfo::TLess()(aLeft,aReight);
}
}
}
void
TMEDSubMesh
::Init(const MED::PElemInfo& theElemInfo,
- MED::EVersion theVersion)
+ MED::EVersion theVersion)
{
myVersion = theVersion;
myIsElemNum = theElemInfo->IsElemNum();
std::string aMeshName = aMeshInfo->GetName();
TInt aDim = aMeshInfo->GetDim();
MED::EMaillage aType = aMeshInfo->GetType();
-
+
// creating TMesh structure and TMeshOnEntityMap
VISU::PMEDMesh aMesh = aMeshMap[aMeshName](new VISU::TMEDMesh());
aMesh->myNamedPointCoords(new VISU::TMEDNamedPointCoords());
INITMSG(MYDEBUG,"aMeshName = '"<<aMeshName<<
- "; aDim = "<<aDim<<"\n");
+ "; aDim = "<<aDim<<"\n");
if(aType == MED::eNON_STRUCTURE){
- if(MED::PNodeInfo aNodeInfo = myMed->GetPNodeInfo(aMeshInfo)){
- MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
+ if(MED::PNodeInfo aNodeInfo = myMed->GetPNodeInfo(aMeshInfo)){
+ MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
- aMesh->myNbPoints = aNodeInfo->GetNbElem();
- aMesh->myEntityInfo = anEntityInfo;
-
-
+ aMesh->myNbPoints = aNodeInfo->GetNbElem();
+ aMesh->myEntityInfo = anEntityInfo;
+
+
#ifndef _DEXCEPT_
- try{
+ try{
#endif
- INITMSG(MYDEBUG,"myNbPoints = "<<aMesh->myNbPoints<<
- "; anEntityInfo.size() = "<<anEntityInfo.size()<<
- "\n");
-
- BuildMeshOnEntityMap(aMesh,
- anEntityInfo,
- aNodeInfo,
- myMed);
-
+ INITMSG(MYDEBUG,"myNbPoints = "<<aMesh->myNbPoints<<
+ "; anEntityInfo.size() = "<<anEntityInfo.size()<<
+ "\n");
+
+ BuildMeshOnEntityMap(aMesh,
+ anEntityInfo,
+ aNodeInfo,
+ myMed);
+
#ifndef _DEXCEPT_
- }catch(std::exception& exc){
- MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
- }catch(...){
- MSG(MYDEBUG,"Unknown exception !!!");
- }
+ }catch(std::exception& exc){
+ MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+ }catch(...){
+ MSG(MYDEBUG,"Unknown exception !!!");
+ }
#endif
- }
+ }
} // NON STRUCTURED MESH
else {
- MED::PGrilleInfo aGrilleInfo = myMed->GetPGrilleInfo(aMeshInfo);
-
- MED::TEntityInfo anEntityInfo;
- anEntityInfo[MED::eNOEUD][MED::ePOINT1] = aGrilleInfo->GetNbNodes();
- anEntityInfo[aGrilleInfo->GetEntity()][aGrilleInfo->GetGeom()] = aGrilleInfo->GetNbCells();
-
- aMesh->myNbPoints = aGrilleInfo->GetNbNodes();
- aMesh->myEntityInfo = anEntityInfo;
-
- aMesh->myIsPolarType = (MED::eGRILLE_POLAIRE == aGrilleInfo->GetGrilleType());
- aMesh->myIsStructured = true;
+ MED::PGrilleInfo aGrilleInfo = myMed->GetPGrilleInfo(aMeshInfo);
+
+ MED::TEntityInfo anEntityInfo;
+ anEntityInfo[MED::eNOEUD][MED::ePOINT1] = aGrilleInfo->GetNbNodes();
+ anEntityInfo[aGrilleInfo->GetEntity()][aGrilleInfo->GetGeom()] = aGrilleInfo->GetNbCells();
+ anEntityInfo[aGrilleInfo->GetSubEntity()][aGrilleInfo->GetSubGeom()] = aGrilleInfo->GetNbSubCells();
+
+ aMesh->myNbPoints = aGrilleInfo->GetNbNodes();
+ aMesh->myEntityInfo = anEntityInfo;
+
+ aMesh->myIsPolarType = (MED::eGRILLE_POLAIRE == aGrilleInfo->GetGrilleType());
+ aMesh->myIsStructured = true;
#ifndef _DEXCEPT_
- try{
+ try{
#endif
- BEGMSG(MYDEBUG,"anEntityInfo.size() = "<<anEntityInfo.size()<<"\n");
-
- BuildMeshGrilleOnEntityMap(aMesh,
- anEntityInfo,
- aGrilleInfo,
- myMed);
-
+ BEGMSG(MYDEBUG,"anEntityInfo.size() = "<<anEntityInfo.size()<<"\n");
+
+ BuildMeshGrilleOnEntityMap(aMesh,
+ anEntityInfo,
+ aGrilleInfo,
+ myMed);
+
#ifndef _DEXCEPT_
- }catch(std::exception& exc){
- MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
- }catch(...){
- MSG(MYDEBUG,"Unknown exception !!!");
- }
+ }catch(std::exception& exc){
+ MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+ }catch(...){
+ MSG(MYDEBUG,"Unknown exception !!!");
+ }
#endif
}
VISU::TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
if(anIter == aMeshMap.end())
- continue;
+ continue;
VISU::PMEDMesh aMesh = anIter->second;
INITMSG(MYDEBUG,"aMeshName = '"<<aMeshName<<"'\n");
#ifndef _DEXCEPT_
try{
#endif
- MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
+ MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
- BuildFieldMap(aMesh,
- anEntityInfo,
- myMed);
+ BuildFieldMap(aMesh,
+ anEntityInfo,
+ myMed);
#ifndef _DEXCEPT_
}catch(std::exception& exc){
- MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+ MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
}catch(...){
- MSG(MYDEBUG,"Unknown exception !!!");
+ MSG(MYDEBUG,"Unknown exception !!!");
}
#endif
template<class TimeStampValueType>
void
BuildTimeStampMinMax(MED::SharedPtr<TimeStampValueType> theTimeStampValue,
- const MED::TGeom2Gauss& theGeom2Gauss,
- VISU::TMinMaxArr& theMinMaxArr,
- VISU::TMinMaxArr& theAverageMinMaxArr,
- TInt theNbComp,
- TInt theNbComp2)
+ const VISU::PMEDMeshOnEntity theMeshOnEntity,
+ const MED::TGeom2Gauss& theGeom2Gauss,
+ VISU::TMetric2Comp2MinMax& theMetric2Comp2MinMax,
+ VISU::TMetric2Comp2MinMax& theMetric2Comp2AverageMinMax,
+ VISU::TMetric2Comp2Group2MinMax& theMetric2Comp2Group2MinMax,
+ VISU::TMetric2Comp2Group2MinMax& theMetric2Comp2Group2AverageMinMax,
+ TInt theNbComp,
+ TInt theNbComp2)
{
+ const VISU::TFamilyIDMap& aFamilyIDMap = theMeshOnEntity->myFamilyIDMap;
+ VISU::TGeom2ElemID2FamilyID aGeom2ElemID2FamilyID = theMeshOnEntity->myGeom2ElemID2FamilyID;
+
+ VISU::TVector<double> aBaseAverageValues;
+ aBaseAverageValues.resize(3);
+ aBaseAverageValues[VISU::AVERAGE_METRIC] = 0.0;
+ aBaseAverageValues[VISU::MINIMUM_METRIC] = VTK_LARGE_FLOAT;
+ aBaseAverageValues[VISU::MAXIMUM_METRIC] = -VTK_LARGE_FLOAT;
+
const typename TimeStampValueType::TTGeom2Value& aGeom2Value = theTimeStampValue->myGeom2Value;
typename TimeStampValueType::TTGeom2Value::const_iterator anIter = aGeom2Value.begin();
for(; anIter != aGeom2Value.end(); anIter++){
const typename TimeStampValueType::TTMeshValue& aMMeshValue = anIter->second;
MED::EGeometrieElement aMGeom = anIter->first;
-
+
TInt aNbElem = aMMeshValue.myNbElem;
TInt aNbGauss = aMMeshValue.myNbGauss;
-
- MED::TGeom2Gauss::const_iterator aGaussIter = theGeom2Gauss.find(aMGeom);
- if(aGaussIter == theGeom2Gauss.end())
- aNbGauss = 1;
-
+
+// AKL: fix of 0021175 issue. Non-regression test is GVIEW10561(import zzzz121b.med).
+// MED::TGeom2Gauss::const_iterator aGaussIter = theGeom2Gauss.find(aMGeom);
+// if(aGaussIter == theGeom2Gauss.end())
+// aNbGauss = 1;
+
INITMSG(MYDEBUG,
- "- aMGeom = "<<aMGeom<<
- "; aNbElem = "<<aNbElem<<
- "; aNbGauss = "<<aNbGauss<<
- endl);
+ "- aMGeom = "<<aMGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; aNbGauss = "<<aNbGauss<<
+ endl);
+
+ VISU::TElemID2FamilyID anElemID2FamilyID = aGeom2ElemID2FamilyID[aMGeom];
bool isAverageByGaussPoints = (aNbGauss > 1);
// To calculate min/max per components
for(TInt iElem = 0; iElem < aNbElem; iElem++){
typename TimeStampValueType::TTMeshValue::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetCompValueSliceArr(iElem);
- for(TInt iComp = 0; iComp < theNbComp; iComp++){
- const typename TimeStampValueType::TTMeshValue::TCValueSlice& aMValueSlice = aMValueSliceArr[iComp];
- VISU::TMinMax& aMinMax = theMinMaxArr[iComp+1];
- vtkFloatingPointType& aMin = aMinMax.first;
- vtkFloatingPointType& aMax = aMinMax.second;
- VISU::TMinMax& anAverageMinMax = theAverageMinMaxArr[iComp+1];
- vtkFloatingPointType& anAverageMin = anAverageMinMax.first;
- vtkFloatingPointType& anAverageMax = anAverageMinMax.second;
- vtkFloatingPointType anAverageValue = 0.0;
- for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
- const vtkFloatingPointType& aVal = aMValueSlice[iGauss];
- aMin = std::min(aMin,aVal);
- aMax = std::max(aMax,aVal);
- if(isAverageByGaussPoints){
- anAverageValue += aVal;
+
+ for(int aGaussMetric = (int)VISU::AVERAGE_METRIC; aGaussMetric <= (int)VISU::MAXIMUM_METRIC; aGaussMetric++){
+ VISU::TComp2MinMax& aComp2MinMax = theMetric2Comp2MinMax[aGaussMetric];
+ VISU::TComp2MinMax& aComp2AverageMinMax = theMetric2Comp2AverageMinMax[aGaussMetric];
+ VISU::TComp2Group2MinMax& aComp2Group2MinMax = theMetric2Comp2Group2MinMax[aGaussMetric];
+ VISU::TComp2Group2MinMax& aComp2Group2AverageMinMax = theMetric2Comp2Group2AverageMinMax[aGaussMetric];
+
+ for(TInt iComp = 0; iComp < theNbComp; iComp++){
+ const typename TimeStampValueType::TTMeshValue::TCValueSlice& aMValueSlice = aMValueSliceArr[iComp];
+
+ VISU::TMinMax& aMinMax = aComp2MinMax[iComp+1];
+ vtkFloatingPointType& aMin = aMinMax.first;
+ vtkFloatingPointType& aMax = aMinMax.second;
+ VISU::TMinMax& anAverageMinMax = aComp2AverageMinMax[iComp+1];
+ vtkFloatingPointType& anAverageMin = anAverageMinMax.first;
+ vtkFloatingPointType& anAverageMax = anAverageMinMax.second;
+ vtkFloatingPointType anAverageValue = aBaseAverageValues[aGaussMetric];
+
+ VISU::TGroup2MinMax& aGroup2MinMax = aComp2Group2MinMax[iComp+1];
+ VISU::TGroup2MinMax& aGroup2AverageMinMax = aComp2Group2AverageMinMax[iComp+1];
+ std::map<VISU::TName,vtkFloatingPointType> aGroup2AverageValue;
+
+ // get names of groups, to which the element belongs
+ VISU::TNames aGroupNames;
+ VISU::TElemID2FamilyID::const_iterator anIter = anElemID2FamilyID.find(iElem);
+ if(anIter != anElemID2FamilyID.end()){
+ int aFamilyId = anIter->second;
+ if(aFamilyId != 0){
+ VISU::TFamilyIDMap::const_iterator aFamilyIter = aFamilyIDMap.find(aFamilyId);
+ if(aFamilyIter != aFamilyIDMap.end()){
+ VISU::PMEDFamily aFamily = aFamilyIter->second;
+ aGroupNames = aFamily->myGroupNames;
+ VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+ for(; aGroupIter != aGroupNames.end(); aGroupIter++)
+ aGroup2AverageValue[*aGroupIter] = aBaseAverageValues[aGaussMetric];
+ }
+ }
+ }
+
+ for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
+ const vtkFloatingPointType& aVal = aMValueSlice[iGauss];
+ aMin = isnan(aVal) ? aVal : std::min(aMin,aVal);
+ aMax = isnan(aVal) ? aVal : std::max(aMax,aVal);
+ if(isAverageByGaussPoints){
+ switch(aGaussMetric) {
+ case VISU::AVERAGE_METRIC: anAverageValue += aVal; break;
+ case VISU::MINIMUM_METRIC: anAverageValue = std::min(anAverageValue, aVal); break;
+ case VISU::MAXIMUM_METRIC: anAverageValue = std::max(anAverageValue, aVal); break;
+ }
+ }
+ else {
+ anAverageMin = aMin;
+ anAverageMax = aMax;
+ }
+
+ // additional calculation for each group, to which the element belongs
+ VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+ for(; aGroupIter != aGroupNames.end(); aGroupIter++){
+ VISU::TName aGroupName = *aGroupIter;
+ bool isGroupFound = aGroup2MinMax.find(aGroupName) != aGroup2MinMax.end();
+ VISU::TMinMax& aGroupMinMax = aGroup2MinMax[aGroupName];
+ vtkFloatingPointType& aGroupMin = aGroupMinMax.first;
+ vtkFloatingPointType& aGroupMax = aGroupMinMax.second;
+ aGroupMin = isGroupFound ? std::min(aGroupMin,aVal) : aVal;
+ aGroupMax = isGroupFound ? std::max(aGroupMax,aVal) : aVal;
+
+ if(isAverageByGaussPoints){
+ switch(aGaussMetric) {
+ case VISU::AVERAGE_METRIC: aGroup2AverageValue[aGroupName] = aGroup2AverageValue[aGroupName] + aVal; break;
+ case VISU::MINIMUM_METRIC: aGroup2AverageValue[aGroupName] = std::min(aGroup2AverageValue[aGroupName], aVal); break;
+ case VISU::MAXIMUM_METRIC: aGroup2AverageValue[aGroupName] = std::max(aGroup2AverageValue[aGroupName], aVal); break;
+ }
+ }
+ else {
+ VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
+ vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
+ vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
+ aGroupAverageMin = aGroupMin;
+ aGroupAverageMax = aGroupMax;
+ }
+ }
}
- else {
- anAverageMin = aMin;
- anAverageMax = aMax;
+ if(isAverageByGaussPoints){
+ if(aGaussMetric == VISU::AVERAGE_METRIC)
+ anAverageValue /= aNbGauss;
+ anAverageMin = std::min(anAverageMin,anAverageValue);
+ anAverageMax = std::max(anAverageMax,anAverageValue);
+
+ VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+ for(; aGroupIter != aGroupNames.end(); aGroupIter++){
+ VISU::TName aGroupName = *aGroupIter;
+ vtkFloatingPointType aGroupAverageValue = aGroup2AverageValue[aGroupName];
+ if(aGaussMetric == VISU::AVERAGE_METRIC)
+ aGroupAverageValue /= aNbGauss;
+ bool isGroupFound = aGroup2AverageMinMax.find(aGroupName) != aGroup2AverageMinMax.end();
+ VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
+ vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
+ vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
+ aGroupAverageMin = isGroupFound ? std::min(aGroupAverageMin,aGroupAverageValue) : aGroupAverageValue;
+ aGroupAverageMax = isGroupFound ? std::max(aGroupAverageMax,aGroupAverageValue) : aGroupAverageValue;
+ }
}
- }
- if(isAverageByGaussPoints){
- anAverageValue /= aNbGauss;
- anAverageMin = std::min(anAverageMin,anAverageValue);
- anAverageMax = std::max(anAverageMax,anAverageValue);
}
}
}
-
+
// To calculate min/max per vector modulus
- VISU::TMinMax& aMinMax = theMinMaxArr[0];
- vtkFloatingPointType& aMin = aMinMax.first;
- vtkFloatingPointType& aMax = aMinMax.second;
- VISU::TMinMax& anAverageMinMax = theAverageMinMaxArr[0];
- vtkFloatingPointType& anAverageMin = anAverageMinMax.first;
- vtkFloatingPointType& anAverageMax = anAverageMinMax.second;
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- typename TimeStampValueType::TTMeshValue::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetGaussValueSliceArr(iElem);
- for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
- const typename TimeStampValueType::TTMeshValue::TCValueSlice& aMValueSlice = aMValueSliceArr[iGauss];
- vtkFloatingPointType aValue = 0.0;
- for(TInt iComp = 0; iComp < theNbComp2; iComp++){
- vtkFloatingPointType aVal = aMValueSlice[iComp];
- aValue += aVal*aVal;
+ for(int aGaussMetric = (int)VISU::AVERAGE_METRIC; aGaussMetric <= (int)VISU::MAXIMUM_METRIC; aGaussMetric++){
+ VISU::TComp2MinMax& aComp2MinMax = theMetric2Comp2MinMax[aGaussMetric];
+ VISU::TComp2MinMax& aComp2AverageMinMax = theMetric2Comp2AverageMinMax[aGaussMetric];
+ VISU::TComp2Group2MinMax& aComp2Group2MinMax = theMetric2Comp2Group2MinMax[aGaussMetric];
+ VISU::TComp2Group2MinMax& aComp2Group2AverageMinMax = theMetric2Comp2Group2AverageMinMax[aGaussMetric];
+
+ VISU::TMinMax& aMinMax = aComp2MinMax[0];
+ vtkFloatingPointType& aMin = aMinMax.first;
+ vtkFloatingPointType& aMax = aMinMax.second;
+ VISU::TMinMax& anAverageMinMax = aComp2AverageMinMax[0];
+ vtkFloatingPointType& anAverageMin = anAverageMinMax.first;
+ vtkFloatingPointType& anAverageMax = anAverageMinMax.second;
+
+ VISU::TGroup2MinMax& aGroup2MinMax = aComp2Group2MinMax[0];
+ VISU::TGroup2MinMax& aGroup2AverageMinMax = aComp2Group2AverageMinMax[0];
+
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ typename TimeStampValueType::TTMeshValue::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetGaussValueSliceArr(iElem);
+
+ // get names of groups, to which the element belongs
+ VISU::TNames aGroupNames;
+ VISU::TElemID2FamilyID::const_iterator anIter = anElemID2FamilyID.find(iElem);
+ if(anIter != anElemID2FamilyID.end()){
+ int aFamilyId = anIter->second;
+ if(aFamilyId != 0){
+ VISU::TFamilyIDMap::const_iterator aFamilyIter = aFamilyIDMap.find(aFamilyId);
+ if(aFamilyIter != aFamilyIDMap.end()){
+ VISU::PMEDFamily aFamily = aFamilyIter->second;
+ aGroupNames = aFamily->myGroupNames;
+ }
+ }
}
- aValue = sqrt(aValue);
- aMin = std::min(aMin,aValue);
- aMax = std::max(aMax,aValue);
- }
- if(isAverageByGaussPoints){
- typename TimeStampValueType::TTMeshValue::TCValueSliceArr aMCompValueSliceArr = aMMeshValue.GetCompValueSliceArr(iElem);
- vtkFloatingPointType aValue = 0.0;
- for(TInt iComp = 0; iComp < theNbComp2; iComp++){
- const typename TimeStampValueType::TTMeshValue::TCValueSlice& aMCompValueSlice = aMCompValueSliceArr[iComp];
- vtkFloatingPointType anAverageValue = 0.0;
- for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
- const vtkFloatingPointType& aVal = aMCompValueSlice[iGauss];
- anAverageValue += aVal;
+
+ for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
+ const typename TimeStampValueType::TTMeshValue::TCValueSlice& aMValueSlice = aMValueSliceArr[iGauss];
+ vtkFloatingPointType aValue = 0.0;
+ for(TInt iComp = 0; iComp < theNbComp2; iComp++){
+ vtkFloatingPointType aVal = aMValueSlice[iComp];
+ aValue += aVal*aVal;
+ }
+ aValue = sqrt(aValue);
+ aMin = isnan(aValue) ? aValue : std::min(aMin,aValue);
+ aMax = isnan(aValue) ? aValue : std::max(aMax,aValue);
+
+ // additional calculation for each group, to which the element belongs
+ VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+ for(; aGroupIter != aGroupNames.end(); aGroupIter++){
+ VISU::TName aGroupName = *aGroupIter;
+ bool isGroupFound = aGroup2MinMax.find(aGroupName) != aGroup2MinMax.end();
+ VISU::TMinMax& aGroupMinMax = aGroup2MinMax[aGroupName];
+ vtkFloatingPointType& aGroupMin = aGroupMinMax.first;
+ vtkFloatingPointType& aGroupMax = aGroupMinMax.second;
+ aGroupMin = isGroupFound ? std::min(aGroupMin,aValue) : aValue;
+ aGroupMax = isGroupFound ? std::max(aGroupMax,aValue) : aValue;
+ }
+ }
+ if(isAverageByGaussPoints){
+ typename TimeStampValueType::TTMeshValue::TCValueSliceArr aMCompValueSliceArr = aMMeshValue.GetCompValueSliceArr(iElem);
+ vtkFloatingPointType aValue = 0.0;
+ for(TInt iComp = 0; iComp < theNbComp2; iComp++){
+ const typename TimeStampValueType::TTMeshValue::TCValueSlice& aMCompValueSlice = aMCompValueSliceArr[iComp];
+ vtkFloatingPointType anAverageValue = aBaseAverageValues[aGaussMetric];
+ for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
+ const vtkFloatingPointType& aVal = aMCompValueSlice[iGauss];
+ switch(aGaussMetric) {
+ case VISU::AVERAGE_METRIC: anAverageValue += aVal; break;
+ case VISU::MINIMUM_METRIC: anAverageValue = std::min(anAverageValue, aVal); break;
+ case VISU::MAXIMUM_METRIC: anAverageValue = std::max(anAverageValue, aVal); break;
+ }
+ }
+ if(aGaussMetric == VISU::AVERAGE_METRIC)
+ anAverageValue /= aNbGauss;
+ aValue += anAverageValue*anAverageValue;
+ }
+ aValue = sqrt(aValue);
+ anAverageMin = std::min(anAverageMin,aValue);
+ anAverageMax = std::max(anAverageMax,aValue);
+
+ // additional calculation for each group, to which the element belongs
+ VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+ for(; aGroupIter != aGroupNames.end(); aGroupIter++){
+ VISU::TName aGroupName = *aGroupIter;
+ bool isGroupFound = aGroup2AverageMinMax.find(aGroupName) != aGroup2AverageMinMax.end();
+ VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
+ vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
+ vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
+ aGroupAverageMin = isGroupFound ? std::min(aGroupAverageMin,aValue) : aValue;
+ aGroupAverageMax = isGroupFound ? std::max(aGroupAverageMax,aValue) : aValue;
+ }
+ }
+ else {
+ anAverageMin = aMin;
+ anAverageMax = aMax;
+
+ // additional calculation for each group, to which the element belongs
+ VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+ for(; aGroupIter != aGroupNames.end(); aGroupIter++){
+ VISU::TName aGroupName = *aGroupIter;
+ VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
+ vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
+ vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
+ aGroupAverageMin = aGroup2MinMax[aGroupName].first;
+ aGroupAverageMax = aGroup2MinMax[aGroupName].second;
}
- anAverageValue /= aNbGauss;
- aValue += anAverageValue*anAverageValue;
}
- aValue = sqrt(aValue);
- anAverageMin = std::min(anAverageMin,aValue);
- anAverageMax = std::max(anAverageMax,aValue);
- }
- else {
- anAverageMin = aMin;
- anAverageMax = aMax;
}
}
}
VISU::TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
if(anIter == aMeshMap.end())
- continue;
+ continue;
VISU::PMEDMesh aMesh = anIter->second;
#ifndef _DEXCEPT_
try{
#endif
- TInt aNbFields = myMed->GetNbFields();
-
- INITMSG(MYDEBUG,
- "- aMeshName = '"<<aMeshName<<"'"<<
- "; aNbFields = "<<aNbFields<<"\n");
-
- MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
-
- for(TInt iField = 1; iField <= aNbFields; iField++){
- VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPFieldInfo()");
-
- MED::TErr anError = 0;
- MED::PFieldInfo aFieldInfo = myMed->GetPFieldInfo(aMeshInfo, iField, &anError);
- if ( anError < 0 )
- continue;
-
- std::string aFieldName = aFieldInfo->GetName();
- INITMSG(MYDEBUG,"- aFieldName = '"<<aFieldName<<"'\n");
-
- MED::TGeom2Size aGeom2Size;
- MED::EEntiteMaillage aMEntity;
- TInt aNbTimeStamps = myMed->GetNbTimeStamps(aFieldInfo,
- anEntityInfo,
- aMEntity,
- aGeom2Size);
- if(aNbTimeStamps < 1)
- continue;
-
- VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
- VISU::PMEDMeshOnEntity aMeshOnEntity = aMesh->myMeshOnEntityMap[aVEntity];
- VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- VISU::PMEDField aField = aFieldMap[aFieldName];
-
- TInt aNbComp = aField->myNbComp;
- int aNbComp2 = aNbComp;
- if(aNbComp == 2 || aNbComp == 4)
- aNbComp2 = 2;
- else if(aNbComp > 4)
- aNbComp2 = 3;
-
- VISU::TMinMaxArr& aMinMaxArr = aField->myMinMaxArr;
- VISU::TMinMaxArr& anAverageMinMaxArr = aField->myAverageMinMaxArr;
- TSetIsDone aSetIsDone(aField->myIsMinMaxInitilized);
- for(TInt iTimeStamp = aNbTimeStamps; iTimeStamp >= 1; iTimeStamp--){
- VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPTimeStampInfo()");
- INITMSG(MYDEBUG,"- iTimeStamp = "<<iTimeStamp<<endl);
-
+ TInt aNbFields = myMed->GetNbFields();
+
+ INITMSG(MYDEBUG,
+ "- aMeshName = '"<<aMeshName<<"'"<<
+ "; aNbFields = "<<aNbFields<<"\n");
+
+ MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
+
+ for(TInt iField = 1; iField <= aNbFields; iField++)
+ {
+ VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPFieldInfo()");
+
+ MED::TErr anError = 0;
+ MED::PFieldInfo aFieldInfo = myMed->GetPFieldInfo(aMeshInfo, iField, &anError);
+ if ( anError < 0 )
+ continue;
+
+ std::string aFieldName = aFieldInfo->GetName();
+ INITMSG(MYDEBUG,"- aFieldName = '"<<aFieldName<<"'\n");
+
+ MED::TGeom2Size aGeom2Size;
+ MED::EEntiteMaillage aMEntity;
+ TInt aNbTimeStamps = myMed->GetNbTimeStamps(aFieldInfo,
+ anEntityInfo,
+ aMEntity,
+ aGeom2Size);
+ if(aNbTimeStamps < 1)
+ continue;
+
+ VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
+ VISU::PMEDMeshOnEntity aMeshOnEntity = aMesh->myMeshOnEntityMap[aVEntity];
+ VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ VISU::PMEDField aField = aFieldMap[aFieldName];
+
+ TInt aNbComp = aField->myNbComp;
+ int aNbComp2 = aNbComp;
+ if(aNbComp == 2 || aNbComp == 4)
+ aNbComp2 = 2;
+ else if(aNbComp > 4)
+ aNbComp2 = 3;
+
+ VISU::TMetric2Comp2MinMax& aMetric2Comp2MinMax = aField->myMetric2Comp2MinMax;
+ VISU::TMetric2Comp2MinMax& aMetric2Comp2AverageMinMax = aField->myMetric2Comp2AverageMinMax;
+ VISU::TMetric2Comp2Group2MinMax& aMetric2Comp2Group2MinMax = aField->myMetric2Comp2Group2MinMax;
+ VISU::TMetric2Comp2Group2MinMax& aMetric2Comp2Group2AverageMinMax = aField->myMetric2Comp2Group2AverageMinMax;
+ TSetIsDone aSetIsDone(aField->myIsMinMaxInitilized);
+ for(TInt iTimeStamp = aNbTimeStamps; iTimeStamp >= 1; iTimeStamp--){
+ VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPTimeStampInfo()");
+ INITMSG(MYDEBUG,"- iTimeStamp = "<<iTimeStamp<<endl);
+
#ifndef _DEXCEPT_
try {
#ifdef NO_CAS_CATCH
if(aFieldInfo->GetType() == MED::eFLOAT64)
BuildTimeStampMinMax<MED::TFloatTimeStampValue>(CastToFloatTimeStampValue(aTimeStampValue),
+ aMeshOnEntity,
aGeom2Gauss,
- aMinMaxArr,
- anAverageMinMaxArr,
+ aMetric2Comp2MinMax,
+ aMetric2Comp2AverageMinMax,
+ aMetric2Comp2Group2MinMax,
+ aMetric2Comp2Group2AverageMinMax,
aNbComp,
aNbComp2);
+
else
BuildTimeStampMinMax<MED::TIntTimeStampValue>(CastToIntTimeStampValue(aTimeStampValue),
+ aMeshOnEntity,
aGeom2Gauss,
- aMinMaxArr,
- anAverageMinMaxArr,
+ aMetric2Comp2MinMax,
+ aMetric2Comp2AverageMinMax,
+ aMetric2Comp2Group2MinMax,
+ aMetric2Comp2Group2AverageMinMax,
aNbComp,
aNbComp2);
MSG(MYDEBUG,"Unknown exception !!!");
}
#endif
- }
- for(TInt iComp = 0; iComp <= aNbComp; iComp++){
- VISU::TMinMax aMinMax = aField->GetMinMax(iComp);
- INITMSG(MYDEBUG,"- "<<iComp<<": "<<aMinMax.first<<"; "<<aMinMax.second<<endl);
- }
- }
+ }
+ for(TInt iComp = 0; iComp <= aNbComp; iComp++){
+ VISU::TMinMax aMinMax = aField->GetMinMax(iComp, VISU::TNames());
+ INITMSG(MYDEBUG,"- "<<iComp<<": "<<aMinMax.first<<"; "<<aMinMax.second<<endl);
+ }
+ }
#ifndef _DEXCEPT_
}catch(std::exception& exc){
- MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+ MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
}catch(...){
- MSG(MYDEBUG,"Unknown exception !!!");
+ MSG(MYDEBUG,"Unknown exception !!!");
}
#endif
VISU::TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
MED::PMeshInfo aMeshInfo = myMed->GetPMeshInfo(iMesh);
- std::string aMeshName = aMeshInfo->GetName();
+ std::string aMeshName = aMeshInfo->GetName();
VISU::TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
if(anIter == aMeshMap.end())
- continue;
+ continue;
VISU::PMEDMesh aMesh = anIter->second;
INITMSG(MYDEBUG,"aMeshName = '"<<aMeshName<<"'\n");
MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
MED::TEntity2TGeom2ElemInfo anEntity2TGeom2ElemInfo =
- MED::GetEntity2TGeom2ElemInfo(myMed, aMeshInfo, anEntityInfo);
+ MED::GetEntity2TGeom2ElemInfo(myMed, aMeshInfo, anEntityInfo);
#ifndef _DEXCEPT_
try{
#endif
- MED::TFamilyInfoSet aFamilyInfoSet = MED::GetFamilyInfoSet(myMed, aMeshInfo);
-
- if(aType == MED::eNON_STRUCTURE)
- BuildFamilyMap(aMesh,
- anEntityInfo,
- anEntity2TGeom2ElemInfo,
- aFamilyInfoSet,
- myMed);
- else
- BuildGrilleFamilyMap(aMesh,
- anEntityInfo,
- aFamilyInfoSet,
- myMed);
-
- BuildGroupMap(aMesh,
- aFamilyInfoSet);
+ MED::TFamilyInfoSet aFamilyInfoSet = MED::GetFamilyInfoSet(myMed, aMeshInfo);
+
+ if(aType == MED::eNON_STRUCTURE)
+ BuildFamilyMap(aMesh,
+ anEntityInfo,
+ anEntity2TGeom2ElemInfo,
+ aFamilyInfoSet,
+ myMed);
+ else
+ BuildGrilleFamilyMap(aMesh,
+ anEntityInfo,
+ aFamilyInfoSet,
+ myMed);
+
+ BuildGroupMap(aMesh,
+ aFamilyInfoSet);
#ifndef _DEXCEPT_
}catch(std::exception& exc){
- MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+ MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
}catch(...){
- MSG(MYDEBUG,"Unknown exception !!!");
+ MSG(MYDEBUG,"Unknown exception !!!");
}
#endif
int
VISU_MedConvertor
::LoadMeshOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity)
+ VISU::PMeshOnEntityImpl theMeshOnEntity)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadMeshOnEntity");
INITMSG(MYDEBUG,"LoadMeshOnEntity"<<endl);
int
VISU_MedConvertor
::LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFamilyImpl theFamily)
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFamilyImpl theFamily)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadFamilyOnEntity");
INITMSG(MYDEBUG,"LoadFamilyOnEntity"<<endl);
int
VISU_MedConvertor
::LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilySet& theFamilySet)
+ const VISU::TFamilySet& theFamilySet)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadMeshOnGroup");
INITMSG(MYDEBUG,"LoadMeshOnGroup"<<endl);
int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
VISU::TFamilySet::const_iterator aFamilyIter = theFamilySet.begin();
for(; aFamilyIter != theFamilySet.end(); aFamilyIter++){
- VISU::PMEDFamily aFamily = *aFamilyIter;
+ VISU::PMEDFamily aFamily = (*aFamilyIter).second;
const VISU::TEntity& anEntity = aFamily->myEntity;
const VISU::PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[anEntity];
isPointsUpdated += LoadPoints(myMed, theMesh);
int
VISU_MedConvertor
::LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime)
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadValForTimeOnMesh");
INITMSG(MYDEBUG,"LoadValForTimeOnMesh"<<endl);
int
VISU_MedConvertor
::LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime)
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadValForTimeOnGaussPts");
INITMSG(MYDEBUG,"LoadValForTimeOnGaussPts"<<endl);
int
VISU_MedConvertor
::LoadPoints(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh)
+ VISU::PMEDMesh theMesh)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadPoints");
try{
VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
aCell2Connect.resize(aNbElem);
for (int iElem = 0; iElem < aNbElem; iElem++)
- aCell2Connect[iElem] = VISU::TConnect(1,iElem);
+ aCell2Connect[iElem] = VISU::TConnect(1,iElem);
} // END NON_STRUCTURED
else { // STRUCTURED
//Main part of code
VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
aCell2Connect.resize(aNbElem);
for(int iElem = 0; iElem < aNbElem; iElem++)
- aCell2Connect[iElem] = VISU::TConnect(1,iElem);
+ aCell2Connect[iElem] = VISU::TConnect(1,iElem);
}
int
VISU_MedConvertor
::LoadPointsOnFamily(const MED::PWrapper& theMed,
- const VISU::PMEDMesh theMesh,
- const VISU::PMEDFamily theFamily)
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDFamily theFamily)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadPointsOnFamily");
try{
TInt aNbElem = aNodeInfo->GetNbElem();
if(aNbElem > 0){
- TInt anId = theFamily->myId;
- VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1];
- for(TInt iElem = 0; iElem < aNbElem; iElem++)
- if(aNodeInfo->GetFamNum(iElem) == anId)
- aSubMeshID.push_back(iElem);
+ TInt anId = theFamily->myId;
+ VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1];
+ for(TInt iElem = 0; iElem < aNbElem; iElem++)
+ if(aNodeInfo->GetFamNum(iElem) == anId)
+ aSubMeshID.push_back(iElem);
}
}
else {
TInt aNbElem = aGrilleInfo->GetNbNodes();
if(aNbElem > 0){
- TInt anId = theFamily->myId;
- VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1];
- for(TInt iElem = 0; iElem < aNbElem; iElem++)
- if(aGrilleInfo->GetFamNumNode(iElem) == anId)
- aSubMeshID.push_back(iElem);
+ TInt anId = theFamily->myId;
+ VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1];
+ for(TInt iElem = 0; iElem < aNbElem; iElem++)
+ if(aGrilleInfo->GetFamNumNode(iElem) == anId)
+ aSubMeshID.push_back(iElem);
}
}
int
VISU_MedConvertor
::LoadCellsOnEntity(const MED::PWrapper& theMed,
- const VISU::PMEDMesh theMesh,
- const VISU::PMEDMeshOnEntity theMeshOnEntity)
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDMeshOnEntity theMeshOnEntity)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadCellsOnEntity");
#ifndef _DEXCEPT_
VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
- const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
- VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
- INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"; aEGeom = "<<aEGeom<<"\n");
- {
- vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
- INITMSG(MYDEBUG,"aVNbNodes = "<<aVNbNodes<<"\n");
-
- TInt aNbElem = aGeom2SizeIter->second;//aGrilleInfo->GetNbCells();
-
- if(aNbElem > 0){
- VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
-
- aSubMesh->Init(aGrilleInfo);
- aSubMesh->myNbCells = aNbElem;
- aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1);
-
- VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
- aCell2Connect.resize(aNbElem);
-
- TInt aMNbNodes = MEDGeom2NbNodes(aMGeom);
- VISU::TVector<TInt> aConnect(aMNbNodes);
-
- for(TInt iElem = 0; iElem < aNbElem; iElem++) {
- MED::TIntVector aConn = aGrilleInfo->GetConn(iElem);
- VISU::TConnect& anArray = aCell2Connect[iElem];
- anArray.resize(aVNbNodes);
-
- if(anIsNodeNum){
- for(TInt iConn = 0; iConn < aMNbNodes; iConn++){
- aConnect[iConn] = aNodeIdMap[aConn[iConn] - 1];
- }
- }else{
- for(int iConn = 0; iConn < aMNbNodes; ++iConn){
- aConnect[iConn] = aConn[iConn];
- }
- }
-
- switch(aMGeom){
- case MED::eQUAD4:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[2];
- anArray[2] = aConnect[3];
- anArray[3] = aConnect[1];
- break;
- case MED::eHEXA8:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[2];
- anArray[2] = aConnect[3];
- anArray[3] = aConnect[1];
- anArray[4] = aConnect[4];
- anArray[5] = aConnect[6];
- anArray[6] = aConnect[7];
- anArray[7] = aConnect[5];
- break;
- default:
- for(int iNode = 0; iNode < aVNbNodes; iNode++)
- anArray[iNode] = aConnect[iNode];
- }
-
- for(int iNode = 0; iNode < aVNbNodes; iNode++)
- if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode])
- EXCEPTION(std::runtime_error,"LoadCellsOnEntity - "<<
- " aNbPoints("<<aNbPoints<<") "<<
- "<= anArray["<<iElem<<"]"<<
- "["<<iNode<<"]"<<
- "("<<anArray[iNode]<<") < 0");
- }
- }
- }
+ const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
+ VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
+ INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"; aEGeom = "<<aEGeom<<"\n");
+ {
+ vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
+ INITMSG(MYDEBUG,"aVNbNodes = "<<aVNbNodes<<"\n");
+
+ TInt aNbElem = aGeom2SizeIter->second;//aGrilleInfo->GetNbCells();
+
+ if(aNbElem > 0){
+ VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
+
+ aSubMesh->Init(aGrilleInfo);
+ aSubMesh->myNbCells = aNbElem;
+ aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1);
+
+ VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
+ aCell2Connect.resize(aNbElem);
+
+ TInt aMNbNodes = MEDGeom2NbNodes(aMGeom);
+ VISU::TVector<TInt> aConnect(aMNbNodes);
+
+ for(TInt iElem = 0; iElem < aNbElem; iElem++) {
+ MED::TIntVector aConn = aGrilleInfo->GetConn(iElem, theMeshOnEntity->myEntity != VISU::CELL_ENTITY);
+ VISU::TConnect& anArray = aCell2Connect[iElem];
+ anArray.resize(aVNbNodes);
+
+ if(anIsNodeNum){
+ for(TInt iConn = 0; iConn < aMNbNodes; iConn++){
+ aConnect[iConn] = aNodeIdMap[aConn[iConn] - 1];
+ }
+ }else{
+ for(int iConn = 0; iConn < aMNbNodes; ++iConn){
+ aConnect[iConn] = aConn[iConn];
+ }
+ }
+
+ switch(aMGeom){
+ case MED::eQUAD4:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[2];
+ anArray[2] = aConnect[3];
+ anArray[3] = aConnect[1];
+ break;
+ case MED::eHEXA8:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[2];
+ anArray[2] = aConnect[3];
+ anArray[3] = aConnect[1];
+ anArray[4] = aConnect[4];
+ anArray[5] = aConnect[6];
+ anArray[6] = aConnect[7];
+ anArray[7] = aConnect[5];
+ break;
+ default:
+ for(int iNode = 0; iNode < aVNbNodes; iNode++)
+ anArray[iNode] = aConnect[iNode];
+ }
+
+ for(int iNode = 0; iNode < aVNbNodes; iNode++)
+ if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode])
+ EXCEPTION(std::runtime_error,"LoadCellsOnEntity - "<<
+ " aNbPoints("<<aNbPoints<<") "<<
+ "<= anArray["<<iElem<<"]"<<
+ "["<<iNode<<"]"<<
+ "("<<anArray[iNode]<<") < 0");
+ }
+ }
+ }
}
theMeshOnEntity->myIsDone = true;
EBooleen anIsNodeNum = aNodeInfo->IsElemNum();
if(anIsNodeNum){
for(TInt i = 0; i < aNbPoints; i++){
- aNodeIdMap[aNodeInfo->GetElemNum(i)-1] = i;
+ aNodeIdMap[aNodeInfo->GetElemNum(i)-1] = i;
}
}
#endif
INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"; aEGeom = "<<aEGeom<<"\n");
switch(aMGeom){
case MED::ePOLYGONE: {
- MED::PPolygoneInfo aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
- TInt aNbElem = aPolygoneInfo->GetNbElem();
- if(aNbElem > 0){
- VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
-
- aSubMesh->Init(MED::PElemInfo(aPolygoneInfo),theMed->GetVersion());
- aSubMesh->myNbCells = aNbElem;
-
- VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
- aCell2Connect.resize(aNbElem);
-
- for(TInt iElem = 0; iElem < aNbElem; iElem++) {
- MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem);
- TInt aNbConn = aPolygoneInfo->GetNbConn(iElem);
- aSubMesh->myCellsSize += aNbConn;
- VISU::TConnect& anArray = aCell2Connect[iElem];
- anArray.resize(aNbConn);
- for(TInt iConn = 0; iConn < aNbConn; iConn++)
- anArray[iConn] = aConnSlice[iConn] - 1;
- }
- }
- break;
+ MED::PPolygoneInfo aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
+ TInt aNbElem = aPolygoneInfo->GetNbElem();
+ if(aNbElem > 0){
+ VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
+
+ aSubMesh->Init(MED::PElemInfo(aPolygoneInfo),theMed->GetVersion());
+ aSubMesh->myNbCells = aNbElem;
+
+ VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
+ aCell2Connect.resize(aNbElem);
+
+ for(TInt iElem = 0; iElem < aNbElem; iElem++) {
+ MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem);
+ TInt aNbConn = aPolygoneInfo->GetNbConn(iElem);
+ aSubMesh->myCellsSize += aNbConn;
+ VISU::TConnect& anArray = aCell2Connect[iElem];
+ anArray.resize(aNbConn);
+ for(TInt iConn = 0; iConn < aNbConn; iConn++)
+ anArray[iConn] = aConnSlice[iConn] - 1;
+ }
+ }
+ break;
}
case MED::ePOLYEDRE: {
- MED::PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
- TInt aNbElem = aPolyedreInfo->GetNbElem();
-
- if(aNbElem > 0){
- VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
-
- aSubMesh->Init(MED::PElemInfo(aPolyedreInfo),theMed->GetVersion());
- aSubMesh->myNbCells = aNbElem;
-
- VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
- aCell2Connect.resize(aNbElem);
-
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem);
- VISU::TConnect& anArray = aCell2Connect[iElem];
- typedef std::set<TInt> TConnectSet;
- TConnectSet aConnectSet;
- TInt aNbFaces = aConnSliceArr.size();
- for(TInt iFace = 0; iFace < aNbFaces; iFace++){
- MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
- TInt aNbConn = aConnSlice.size();
- aSubMesh->myCellsSize += aNbConn;
- for(TInt iConn = 0; iConn < aNbConn; iConn++){
- aConnectSet.insert(aConnSlice[iConn]);
- }
- }
-
- int aNbConn = aConnectSet.size();
- anArray.resize(aNbConn);
- TConnectSet::iterator anIter = aConnectSet.begin();
- for(int i = 0; anIter != aConnectSet.end(); anIter++, i++){
- TInt anId = *anIter;
- anArray[i] = anId - 1;
- }
- }
- }
-
- break;
+ MED::PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
+ TInt aNbElem = aPolyedreInfo->GetNbElem();
+
+ if(aNbElem > 0){
+ VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
+
+ aSubMesh->Init(MED::PElemInfo(aPolyedreInfo),theMed->GetVersion());
+ aSubMesh->myNbCells = aNbElem;
+
+ VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
+ aCell2Connect.resize(aNbElem);
+
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem);
+ VISU::TConnect& anArray = aCell2Connect[iElem];
+ typedef std::set<TInt> TConnectSet;
+ TConnectSet aConnectSet;
+ TInt aNbFaces = aConnSliceArr.size();
+ for(TInt iFace = 0; iFace < aNbFaces; iFace++){
+ MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+ TInt aNbConn = aConnSlice.size();
+ aSubMesh->myCellsSize += aNbConn;
+ for(TInt iConn = 0; iConn < aNbConn; iConn++){
+ aConnectSet.insert(aConnSlice[iConn]);
+ }
+ }
+
+ int aNbConn = aConnectSet.size();
+ anArray.resize(aNbConn);
+ TConnectSet::iterator anIter = aConnectSet.begin();
+ for(int i = 0; anIter != aConnectSet.end(); anIter++, i++){
+ TInt anId = *anIter;
+ anArray[i] = anId - 1;
+ }
+ }
+ }
+
+ break;
}
default: {
- vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
- INITMSG(MYDEBUG,"aVNbNodes = "<<aVNbNodes<<"\n");
-
- MED::PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
- TInt aNbElem = aCellInfo->GetNbElem();
-
- if(aNbElem > 0){
- VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
-
- aSubMesh->Init(MED::PElemInfo(aCellInfo), theMed->GetVersion());
- aSubMesh->myNbCells = aNbElem;
- aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1);
-
- VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
- aCell2Connect.resize(aNbElem);
-
- TInt aMNbNodes = MEDGeom2NbNodes(aMGeom);
- VISU::TVector<TInt> aConnect(aMNbNodes);
-
- for(TInt iElem = 0; iElem < aNbElem; iElem++) {
- MED::TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
- VISU::TConnect& anArray = aCell2Connect[iElem];
- anArray.resize(aVNbNodes);
-
- if(anIsNodeNum){
- for(TInt iConn = 0; iConn < aMNbNodes; iConn++){
- aConnect[iConn] = aNodeIdMap[aConnSlice[iConn] - 1];
- }
- }else{
- for(int iConn = 0; iConn < aMNbNodes; iConn++){
- aConnect[iConn] = aConnSlice[iConn] - 1;
- }
- }
-
- switch(aMGeom){
-#if !(defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
- case MED::eSEG3:
- anArray[0] = aConnect[0];
- anArray[2] = aConnect[1];
-
- anArray[1] = aConnect[2];
- break;
+ vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
+ INITMSG(MYDEBUG,"aVNbNodes = "<<aVNbNodes<<"\n");
+
+ MED::PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
+ TInt aNbElem = aCellInfo->GetNbElem();
+
+ if(aNbElem > 0){
+ VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
+
+ aSubMesh->Init(MED::PElemInfo(aCellInfo), theMed->GetVersion());
+ aSubMesh->myNbCells = aNbElem;
+ aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1);
+
+ VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
+ aCell2Connect.resize(aNbElem);
+
+ TInt aMNbNodes = MEDGeom2NbNodes(aMGeom);
+ VISU::TVector<TInt> aConnect(aMNbNodes);
+
+ for(TInt iElem = 0; iElem < aNbElem; iElem++) {
+ MED::TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
+ VISU::TConnect& anArray = aCell2Connect[iElem];
+ anArray.resize(aVNbNodes);
+
+ if(anIsNodeNum){
+ for(TInt iConn = 0; iConn < aMNbNodes; iConn++){
+ aConnect[iConn] = aNodeIdMap[aConnSlice[iConn] - 1];
+ }
+ }else{
+ for(int iConn = 0; iConn < aMNbNodes; iConn++){
+ aConnect[iConn] = aConnSlice[iConn] - 1;
+ }
+ }
+
+ switch(aMGeom){
+#if !(defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+ case MED::eSEG3:
+ anArray[0] = aConnect[0];
+ anArray[2] = aConnect[1];
+
+ anArray[1] = aConnect[2];
+ break;
+#endif
+#if !(defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+ case MED::eTRIA6:
+ anArray[0] = aConnect[0];
+ anArray[2] = aConnect[1];
+ anArray[4] = aConnect[2];
+
+ anArray[1] = aConnect[3];
+ anArray[3] = aConnect[4];
+ anArray[5] = aConnect[5];
+ break;
#endif
-#if !(defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
- case MED::eTRIA6:
- anArray[0] = aConnect[0];
- anArray[2] = aConnect[1];
- anArray[4] = aConnect[2];
-
- anArray[1] = aConnect[3];
- anArray[3] = aConnect[4];
- anArray[5] = aConnect[5];
- break;
+#if !(defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+ case MED::eQUAD8:
+ anArray[0] = aConnect[0];
+ anArray[2] = aConnect[1];
+ anArray[4] = aConnect[2];
+ anArray[6] = aConnect[3];
+
+ anArray[1] = aConnect[4];
+ anArray[3] = aConnect[5];
+ anArray[5] = aConnect[6];
+ anArray[7] = aConnect[7];
+ break;
#endif
-#if !(defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
- case MED::eQUAD8:
- anArray[0] = aConnect[0];
- anArray[2] = aConnect[1];
- anArray[4] = aConnect[2];
- anArray[6] = aConnect[3];
-
- anArray[1] = aConnect[4];
- anArray[3] = aConnect[5];
- anArray[5] = aConnect[6];
- anArray[7] = aConnect[7];
- break;
+#if !(defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+ case MED::eQUAD9:
+ anArray[0] = aConnect[0];
+ anArray[2] = aConnect[1];
+ anArray[4] = aConnect[2];
+ anArray[6] = aConnect[3];
+
+ anArray[1] = aConnect[4];
+ anArray[3] = aConnect[5];
+ anArray[5] = aConnect[6];
+ anArray[7] = aConnect[7];
+ anArray[8] = aConnect[8];
+ break;
#endif
-#if (defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
- case MED::eTETRA10:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[2];
- anArray[2] = aConnect[1];
- anArray[3] = aConnect[3];
-
- anArray[4] = aConnect[6];
- anArray[5] = aConnect[5];
- anArray[6] = aConnect[4];
-
- anArray[7] = aConnect[7];
- anArray[8] = aConnect[9];
- anArray[9] = aConnect[8];
- break;
+#if (defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+ case MED::eTETRA10:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[2];
+ anArray[2] = aConnect[1];
+ anArray[3] = aConnect[3];
+
+ anArray[4] = aConnect[6];
+ anArray[5] = aConnect[5];
+ anArray[6] = aConnect[4];
+
+ anArray[7] = aConnect[7];
+ anArray[8] = aConnect[9];
+ anArray[9] = aConnect[8];
+ break;
#endif
- case MED::eTETRA4:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[2];
- anArray[2] = aConnect[1];
- anArray[3] = aConnect[3];
- break;
-#if (defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
- case MED::ePYRA13:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[3];
- anArray[2] = aConnect[2];
- anArray[3] = aConnect[1];
- anArray[4] = aConnect[4];
-
- anArray[5] = aConnect[8];
- anArray[6] = aConnect[7];
- anArray[7] = aConnect[6];
- anArray[8] = aConnect[5];
-
- anArray[9] = aConnect[9];
- anArray[10] = aConnect[12];
- anArray[11] = aConnect[11];
- anArray[12] = aConnect[10];
- break;
+ case MED::eTETRA4:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[2];
+ anArray[2] = aConnect[1];
+ anArray[3] = aConnect[3];
+ break;
+#if (defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+ case MED::ePYRA13:
+ anArray[0] = aConnect[0];
+
+ anArray[1] = aConnect[3];
+ anArray[2] = aConnect[2];
+ anArray[3] = aConnect[1];
+ anArray[4] = aConnect[4];
+
+ anArray[5] = aConnect[8];
+ anArray[6] = aConnect[7];
+ anArray[7] = aConnect[6];
+ anArray[8] = aConnect[5];
+
+ anArray[9] = aConnect[9];
+ anArray[10] = aConnect[12];
+ anArray[11] = aConnect[11];
+ anArray[12] = aConnect[10];
+ break;
#endif
- case MED::ePYRA5:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[3];
- anArray[2] = aConnect[2];
- anArray[3] = aConnect[1];
- anArray[4] = aConnect[4];
- break;
- default:
- for(int iNode = 0; iNode < aVNbNodes; iNode++)
- anArray[iNode] = aConnect[iNode];
- }
- for(int iNode = 0; iNode < aVNbNodes; iNode++)
- if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode])
- EXCEPTION(std::runtime_error,"LoadCellsOnEntity - "<<
- " aNbPoints("<<aNbPoints<<") "<<
- "<= anArray["<<iElem<<"]"<<
- "["<<iNode<<"]"<<
- "("<<anArray[iNode]<<") < 0");
- }
- }
+ case MED::ePYRA5:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[3];
+ anArray[2] = aConnect[2];
+ anArray[3] = aConnect[1];
+ anArray[4] = aConnect[4];
+ break;
+#if (defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+ case MED::eHEXA27:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[3];
+ anArray[2] = aConnect[2];
+ anArray[3] = aConnect[1];
+
+ anArray[4] = aConnect[4];
+ anArray[5] = aConnect[7];
+ anArray[6] = aConnect[6];
+ anArray[7] = aConnect[5];
+
+ anArray[8] = aConnect[11];
+ anArray[9] = aConnect[10];
+ anArray[10] = aConnect[9];
+ anArray[11] = aConnect[8];
+
+ anArray[12] = aConnect[15];
+ anArray[13] = aConnect[14];
+ anArray[14] = aConnect[13];
+ anArray[15] = aConnect[12];
+
+ anArray[16] = aConnect[16];
+ anArray[17] = aConnect[19];
+ anArray[18] = aConnect[18];
+ anArray[19] = aConnect[17];
+
+ anArray[20] = aConnect[21];
+ anArray[21] = aConnect[23];
+ anArray[22] = aConnect[24];
+ anArray[23] = aConnect[22];
+
+ anArray[24] = aConnect[20];
+ anArray[25] = aConnect[25];
+ anArray[26] = aConnect[26];
+ break;
+#endif
+ default:
+ for(int iNode = 0; iNode < aVNbNodes; iNode++)
+ anArray[iNode] = aConnect[iNode];
+ }
+ for(int iNode = 0; iNode < aVNbNodes; iNode++)
+ if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode])
+ EXCEPTION(std::runtime_error,"LoadCellsOnEntity - "<<
+ " aNbPoints("<<aNbPoints<<") "<<
+ "<= anArray["<<iElem<<"]"<<
+ "["<<iNode<<"]"<<
+ "("<<anArray[iNode]<<") < 0");
+ }
+ }
}}
}
int
VISU_MedConvertor
::LoadCellsOnFamily(const MED::PWrapper& theMed,
- const VISU::PMEDMesh theMesh,
- const VISU::PMEDMeshOnEntity theMeshOnEntity,
- const VISU::PMEDFamily theFamily)
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDMeshOnEntity theMeshOnEntity,
+ const VISU::PMEDFamily theFamily)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadCellsOnFamily");
#ifndef _DEXCEPT_
for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
if(aType == MED::eNON_STRUCTURE){
- MED::PElemInfo anElemInfo;
- switch(aMGeom){
- case MED::ePOLYGONE: {
- anElemInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
- break;
- }
- case MED::ePOLYEDRE: {
- anElemInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
- break;
- }
- default: {
- anElemInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
- break;
- }}
- if(anElemInfo){
- if(TInt aNbElem = anElemInfo->GetNbElem()){
- VISU::TSubMeshID aSubMeshID;
- for(TInt iElem = 0; iElem < aNbElem; iElem++)
- if(anElemInfo->GetFamNum(iElem) == anId)
- aSubMeshID.push_back(iElem);
- if(!aSubMeshID.empty()){
- VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
- INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"\n");
- aGeom2SubMeshID.insert(VISU::TGeom2SubMeshID::value_type(aEGeom,aSubMeshID));
- }
- }
- }
+ MED::PElemInfo anElemInfo;
+ switch(aMGeom){
+ case MED::ePOLYGONE: {
+ anElemInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
+ break;
+ }
+ case MED::ePOLYEDRE: {
+ anElemInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
+ break;
+ }
+ default: {
+ anElemInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
+ break;
+ }}
+ if(anElemInfo){
+ if(TInt aNbElem = anElemInfo->GetNbElem()){
+ VISU::TSubMeshID aSubMeshID;
+ for(TInt iElem = 0; iElem < aNbElem; iElem++)
+ if(anElemInfo->GetFamNum(iElem) == anId)
+ aSubMeshID.push_back(iElem);
+ if(!aSubMeshID.empty()){
+ VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
+ INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"\n");
+ aGeom2SubMeshID.insert(VISU::TGeom2SubMeshID::value_type(aEGeom,aSubMeshID));
+ }
+ }
+ }
} else {
- MED::PGrilleInfo anElemInfo = theMed->GetPGrilleInfo(aMeshInfo);
- if(anElemInfo){
- TInt aNbElem = anElemInfo->GetNbCells();
- if(aNbElem>0 && (aMGeom == anElemInfo->GetGeom()) ){
- VISU::TSubMeshID aSubMeshID;
- for(TInt iElem = 0; iElem < aNbElem; iElem++)
- if(anElemInfo->GetFamNum(iElem) == anId)
- aSubMeshID.push_back(iElem);
- if(!aSubMeshID.empty()){
- VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
- INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"\n");
- aGeom2SubMeshID.insert(VISU::TGeom2SubMeshID::value_type(aEGeom,aSubMeshID));
- }
- }
- }
+ MED::PGrilleInfo anElemInfo = theMed->GetPGrilleInfo(aMeshInfo);
+ if(anElemInfo){
+ TInt aNbElem = anElemInfo->GetNbCells();
+ if(aNbElem>0 && (aMGeom == anElemInfo->GetGeom()) ){
+ VISU::TSubMeshID aSubMeshID;
+ for(TInt iElem = 0; iElem < aNbElem; iElem++)
+ if(anElemInfo->GetFamNum(iElem) == anId)
+ aSubMeshID.push_back(iElem);
+ if(!aSubMeshID.empty()){
+ VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
+ INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"\n");
+ aGeom2SubMeshID.insert(VISU::TGeom2SubMeshID::value_type(aEGeom,aSubMeshID));
+ }
+ }
+ }
}
}
//---------------------------------------------------------------
void
LoadProfile(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- MED::PTimeStampValueBase theTimeStampValue,
- VISU::TMEDValForTime& theValForTime,
- VISU::TMEDMeshOnEntity& theMeshOnEntity)
+ VISU::PMEDMesh theMesh,
+ MED::PTimeStampValueBase theTimeStampValue,
+ VISU::TMEDValForTime& theValForTime,
+ VISU::TMEDMeshOnEntity& theMeshOnEntity)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadProfile");
INITMSG(MYDEBUG,"LoadProfile"<<endl);
MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
if(!anElemNum.empty()){
- VISU::TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
- TInt aSize = anElemNum.size();
- aSubMeshID.resize(aSize);
- for(TInt anId = 0; anId < aSize; anId++)
- aSubMeshID[anId] = anElemNum[anId] - 1;
+ VISU::TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
+ TInt aSize = anElemNum.size();
+ aSubMeshID.resize(aSize);
+ for(TInt anId = 0; anId < aSize; anId++)
+ aSubMeshID[anId] = anElemNum[anId] - 1;
}
INITMSG(MYDEBUG,
- "- aEGeom = "<<aEGeom<<
- "; aNbCells = "<<aSubProfile->mySubMeshID.size()<<
- endl);
+ "- aEGeom = "<<aEGeom<<
+ "; aNbCells = "<<aSubProfile->mySubMeshID.size()<<
+ endl);
}
}
{
//---------------------------------------------------------------
void
LoadGaussMesh(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- MED::PTimeStampValueBase theTimeStampValue,
- VISU::TMEDValForTime& theValForTime,
- VISU::TMEDMeshOnEntity& theMeshOnEntity)
+ VISU::PMEDMesh theMesh,
+ MED::PTimeStampValueBase theTimeStampValue,
+ VISU::TMEDValForTime& theValForTime,
+ VISU::TMEDMeshOnEntity& theMeshOnEntity)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadGaussMesh");
INITMSG(MYDEBUG,"LoadGaussMesh"<<endl);
switch(aMGeom){
case MED::ePOLYGONE:
aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,
- aMEntity,
- aMGeom);
+ aMEntity,
+ aMGeom);
anElemInfo = aPolygoneInfo;
break;
case MED::ePOLYEDRE:
aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,
- aMEntity,
- aMGeom);
+ aMEntity,
+ aMGeom);
anElemInfo = aPolyedreInfo;
break;
default:
aCellInfo = theMed->GetPCellInfo(aMeshInfo,
- aMEntity,
- aMGeom);
+ aMEntity,
+ aMGeom);
anElemInfo = aCellInfo;
}
aGaussSubMesh->myIsElemNum = anElemInfo->IsElemNum();
VISU::PMEDGauss aGauss = aGaussSubMesh->myGauss;
MED::PGaussInfo aGaussInfo = aGauss->myGaussInfo;
if(aGaussInfo){
- aName = aGaussInfo->GetName();
- if(!aSubMeshID.empty()){
- const std::string& aProfileName = aSubProfile->myName;
- MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed,
- aProfileName);
- if(aProfileInfo){
- const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
- anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo,
- aCellInfo,
- aNodeInfo,
- aGaussCoord,
- anElemNum);
- }
- }else
- anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo,
- aCellInfo,
- aNodeInfo,
- aGaussCoord);
+ aName = aGaussInfo->GetName();
+ if(!aSubMeshID.empty()){
+ const std::string& aProfileName = aSubProfile->myName;
+ MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed,
+ aProfileName);
+ if(aProfileInfo){
+ const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
+ anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo,
+ aCellInfo,
+ aNodeInfo,
+ aGaussCoord,
+ anElemNum);
+ }
+ }else
+ anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo,
+ aCellInfo,
+ aNodeInfo,
+ aGaussCoord);
}
}else{
if(!aSubMeshID.empty()){
- const std::string& aProfileName = aSubProfile->myName;
- MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed,
- aProfileName);
- if(aProfileInfo){
- const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
- switch(aMGeom){
- case MED::ePOLYGONE:
- anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo,
- aNodeInfo,
- aGaussCoord,
- anElemNum);
- break;
- case MED::ePOLYEDRE:
- anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo,
- aNodeInfo,
- aGaussCoord,
- anElemNum);
- break;
- default:
- anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo,
- aNodeInfo,
- aGaussCoord,
- anElemNum);
- }
- }
+ const std::string& aProfileName = aSubProfile->myName;
+ MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed,
+ aProfileName);
+ if(aProfileInfo){
+ const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
+ switch(aMGeom){
+ case MED::ePOLYGONE:
+ anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo,
+ aNodeInfo,
+ aGaussCoord,
+ anElemNum);
+ break;
+ case MED::ePOLYEDRE:
+ anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo,
+ aNodeInfo,
+ aGaussCoord,
+ anElemNum);
+ break;
+ default:
+ anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo,
+ aNodeInfo,
+ aGaussCoord,
+ anElemNum);
+ }
+ }
}else
- switch(aMGeom){
- case MED::ePOLYGONE:
- anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo,
- aNodeInfo,
- aGaussCoord);
- break;
- case MED::ePOLYEDRE:
- anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo,
- aNodeInfo,
- aGaussCoord);
- break;
- default:
- anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo,
- aNodeInfo,
- aGaussCoord);
- }
+ switch(aMGeom){
+ case MED::ePOLYGONE:
+ anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo,
+ aNodeInfo,
+ aGaussCoord);
+ break;
+ case MED::ePOLYEDRE:
+ anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo,
+ aNodeInfo,
+ aGaussCoord);
+ break;
+ default:
+ anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo,
+ aNodeInfo,
+ aGaussCoord);
+ }
}
if(anIsGaussCoord3D){
TInt aNbCells = aNbElem*aNbGauss;
INITMSG(MYDEBUG,
- "- aEGeom = "<<aEGeom<<
- "; aName = '"<<aName<<"'"<<
- "; aStatus = "<<aGaussSubMesh->myStatus<<
- "; aNbElem = "<<aNbElem<<
- "; aNbGauss = "<<aNbGauss<<
- "; aNbCells = "<<aNbCells<<
- endl);
+ "- aEGeom = "<<aEGeom<<
+ "; aName = '"<<aName<<"'"<<
+ "; aStatus = "<<aGaussSubMesh->myStatus<<
+ "; aNbElem = "<<aNbElem<<
+ "; aNbGauss = "<<aNbGauss<<
+ "; aNbCells = "<<aNbCells<<
+ endl);
}else
EXCEPTION(std::runtime_error,"LoadGaussMesh - Gauss Points localization error!!!");
}
template<class TimeStampValueType>
void
FillValForTime(MED::SharedPtr<TimeStampValueType> theTimeStampValue,
- const VISU::TGeom2SubProfile& theGeom2SubProfile,
- VISU::PMEDValForTime theValForTime,
- VISU::PMEDField theField)
+ const VISU::TGeom2SubProfile& theGeom2SubProfile,
+ VISU::PMEDValForTime theValForTime,
+ VISU::PMEDField theField)
{
+ if(theValForTime->myIsFilled)
+ return;
theField->myDataSize = 0;
TInt aNbComp = theField->myNbComp;
VISU::TGeom2SubProfile::const_iterator anIter = theGeom2SubProfile.begin();
- for(; anIter != theGeom2SubProfile.end(); anIter++){
+ for(; anIter != theGeom2SubProfile.end(); anIter++) {
VISU::EGeometry aEGeom = anIter->first;
VISU::PMEDSubProfile aSubProfile(anIter->second);
TInt aNbGauss = theValForTime->GetNbGauss(aEGeom);
INITMSG(MYDEBUG,
- "- aEGeom = "<<aEGeom<<
- "; aNbElem = "<<aNbElem<<
- "; aNbGauss = "<<aNbGauss<<
- endl);
+ "- aEGeom = "<<aEGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; aNbGauss = "<<aNbGauss<<
+ endl);
VISU::PMeshValue& aVMeshValue = theValForTime->GetMeshValue(aEGeom);
typedef typename TimeStampValueType::TElement TElement;
aVMeshValue.reset(aMeshValue);
}
}
+ theValForTime->myIsFilled = true;
}
//---------------------------------------------------------------
int
LoadValForTime(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- VISU::PMEDMeshOnEntity theMeshOnEntity,
- VISU::PMEDField theField,
- VISU::PMEDValForTime theValForTime,
- bool theIsGauss,
- bool& theIsDone)
+ VISU::PMEDMesh theMesh,
+ VISU::PMEDMeshOnEntity theMeshOnEntity,
+ VISU::PMEDField theField,
+ VISU::PMEDValForTime theValForTime,
+ bool theIsGauss,
+ bool& theIsDone)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadValForTime");
INITMSG(MYDEBUG,"LoadValForTime - theIsGauss = "<<theIsGauss<<endl);
const std::string& aMeshName = theMeshOnEntity->myMeshName;
const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
MED::PFieldInfo aFieldInfo = theMed->GetPFieldInfo(aMeshInfo,
- theField->myId);
+ theField->myId);
MED::TGeom2Size aGeom2Size;
MED::EEntiteMaillage aMEntity;
theMed->GetNbTimeStamps(aFieldInfo,
- theMesh->myEntityInfo,
- aMEntity,
- aGeom2Size);
+ theMesh->myEntityInfo,
+ aMEntity,
+ aGeom2Size);
MED::PTimeStampInfo aTimeStampInfo =
theMed->GetPTimeStampInfo(aFieldInfo,
- aMEntity,
- aGeom2Size,
- theValForTime->myId);
+ aMEntity,
+ aGeom2Size,
+ theValForTime->myId);
MED::TKey2Gauss aKey2Gauss = GetKey2Gauss(theMed);
MED::TMKey2Profile aMKey2Profile = GetMKey2Profile(theMed);
MED::PTimeStampValueBase aTimeStampValue =
theMed->GetPTimeStampValue(aTimeStampInfo,
- aMKey2Profile,
- aKey2Gauss);
+ aMKey2Profile,
+ aKey2Gauss);
InitProfile(theMed,
- aMeshInfo,
- aTimeStampValue,
- theMeshOnEntity,
- aMEntity,
- aGeom2Size,
- theValForTime);
+ aMeshInfo,
+ aTimeStampValue,
+ theMeshOnEntity,
+ aMEntity,
+ aGeom2Size,
+ theValForTime);
LoadProfile(theMed,
- theMesh,
- aTimeStampValue,
- theValForTime,
- theMeshOnEntity);
+ theMesh,
+ aTimeStampValue,
+ theValForTime,
+ theMeshOnEntity);
if(theIsGauss) {
InitGaussMesh(aTimeStampValue,
- theMeshOnEntity,
- aGeom2Size,
- theValForTime);
+ theMeshOnEntity,
+ aGeom2Size,
+ theValForTime);
LoadGaussMesh(theMed,
- theMesh,
- aTimeStampValue,
- theValForTime,
- theMeshOnEntity);
+ theMesh,
+ aTimeStampValue,
+ theValForTime,
+ theMeshOnEntity);
}
VISU::PMEDProfile aProfile = theValForTime->myProfile;
VISU::TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
INITMSGA(MYDEBUG,0,
- "- aMeshName = '"<<aMeshName<<"'"<<
- "; aFieldName = '"<<aFieldInfo->GetName()<<"'"<<
- "; aMEntity = "<<aMEntity<<
- "; aNbComp = "<<theField->myNbComp<<
- endl);
+ "- aMeshName = '"<<aMeshName<<"'"<<
+ "; aFieldName = '"<<aFieldInfo->GetName()<<"'"<<
+ "; aMEntity = "<<aMEntity<<
+ "; aNbComp = "<<theField->myNbComp<<
+ endl);
if(aFieldInfo->GetType() == MED::eFLOAT64)
FillValForTime<MED::TFloatTimeStampValue>(CastToFloatTimeStampValue(aTimeStampValue),
- aGeom2SubProfile,
- theValForTime,
- theField);
+ aGeom2SubProfile,
+ theValForTime,
+ theField);
else
FillValForTime<MED::TIntTimeStampValue>(CastToIntTimeStampValue(aTimeStampValue),
- aGeom2SubProfile,
- theValForTime,
- theField);
+ aGeom2SubProfile,
+ theValForTime,
+ theField);
theIsDone = true;
return 1;
int
VISU_MedConvertor
::LoadValForTimeOnMesh(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- VISU::PMEDMeshOnEntity theMeshOnEntity,
- VISU::PMEDField theField,
- VISU::PMEDValForTime theValForTime)
+ VISU::PMEDMesh theMesh,
+ VISU::PMEDMeshOnEntity theMeshOnEntity,
+ VISU::PMEDField theField,
+ VISU::PMEDValForTime theValForTime)
{
VISU::PUnstructuredGridIDMapperImpl anUnstructuredGridIDMapper = theValForTime->myUnstructuredGridIDMapper;
return LoadValForTime(theMed,
- theMesh,
- theMeshOnEntity,
- theField,
- theValForTime,
- false,
- anUnstructuredGridIDMapper->myIsVTKDone);
+ theMesh,
+ theMeshOnEntity,
+ theField,
+ theValForTime,
+ false,
+ anUnstructuredGridIDMapper->myIsVTKDone);
}
int
VISU_MedConvertor
::LoadValForTimeOnGaussPts(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- VISU::PMEDMeshOnEntity theMeshOnEntity,
- VISU::PMEDField theField,
- VISU::PMEDValForTime theValForTime)
+ VISU::PMEDMesh theMesh,
+ VISU::PMEDMeshOnEntity theMeshOnEntity,
+ VISU::PMEDField theField,
+ VISU::PMEDValForTime theValForTime)
{
VISU::PGaussPtsIDFilter aGaussPtsIDFilter = theValForTime->myGaussPtsIDFilter;
return LoadValForTime(theMed,
- theMesh,
- theMeshOnEntity,
- theField,
- theValForTime,
- true,
- aGaussPtsIDFilter->myIsVTKDone);
+ theMesh,
+ theMeshOnEntity,
+ theField,
+ theValForTime,
+ true,
+ aGaussPtsIDFilter->myIsVTKDone);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_MedConvertor.hxx
// Author : Alexey PETROV
// Module : VISU
//---------------------------------------------------------------
template<class TValueType>
struct VISU_CONVERTOR_EXPORT TTMEDMeshValue: TTMeshValueHolder<TValueType,
- MED::SharedPtr<MED::TTMeshValue<MED::TVector<TValueType> > > >
+ MED::SharedPtr<MED::TTMeshValue<MED::TVector<TValueType> > > >
{
virtual
const TValueType*
void
Init(const MED::PNodeInfo& theNodeInfo,
- MED::EVersion theVersion);
+ MED::EVersion theVersion);
void
Init(const MED::PGrilleInfo& theGrilleInfo);
virtual
void
LessThan(const PGaussImpl& theGauss,
- bool& theResult) const;
+ bool& theResult) const;
};
typedef MED::SharedPtr<TMEDGauss> PMEDGauss;
void
Init(const MED::PElemInfo& theElemInfo,
- MED::EVersion theVersion);
+ MED::EVersion theVersion);
void
Init(const MED::PGrilleInfo& theGrilleInfo);
//---------------------------------------------------------------
typedef std::map<vtkIdType,vtkIdType> TFamilyID2CellsSize;
+ typedef std::map<vtkIdType,vtkIdType> TElemID2FamilyID;
+ typedef std::map<MED::EGeometrieElement,TElemID2FamilyID> TGeom2ElemID2FamilyID;
+
struct VISU_CONVERTOR_EXPORT TMEDMeshOnEntity: virtual TMeshOnEntityImpl
{
TFamilyID2CellsSize myFamilyID2CellsSize;
+ TGeom2ElemID2FamilyID myGeom2ElemID2FamilyID;
MED::TGeom2Size myGeom2Size;
};
typedef MED::SharedPtr<TMEDMeshOnEntity> PMEDMeshOnEntity;
virtual
int
LoadMeshOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity);
+ VISU::PMeshOnEntityImpl theMeshOnEntity);
virtual
int
LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFamilyImpl theFamily);
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFamilyImpl theFamily);
virtual
int
LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilySet& theFamilySet);
+ const VISU::TFamilySet& theFamilySet);
virtual
int
LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime);
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime);
virtual
int
LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime);
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime);
int
LoadPoints(const MED::PWrapper& theMed,
- const VISU::PMEDMesh theMesh);
+ const VISU::PMEDMesh theMesh);
int
LoadPointsOnFamily(const MED::PWrapper& theMed,
- const VISU::PMEDMesh theMesh,
- const VISU::PMEDFamily theFamily);
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDFamily theFamily);
int
LoadCellsOnEntity(const MED::PWrapper& theMed,
- const VISU::PMEDMesh theMesh,
- const VISU::PMEDMeshOnEntity theMeshOnEntity);
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDMeshOnEntity theMeshOnEntity);
int
LoadCellsOnFamily(const MED::PWrapper& theMed,
- const VISU::PMEDMesh theMesh,
- const VISU::PMEDMeshOnEntity theMeshOnEntity,
- const VISU::PMEDFamily theFamily);
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDMeshOnEntity theMeshOnEntity,
+ const VISU::PMEDFamily theFamily);
int
LoadValForTimeOnMesh(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- VISU::PMEDMeshOnEntity theMeshOnEntity,
- VISU::PMEDField theField,
- VISU::PMEDValForTime theValForTime);
+ VISU::PMEDMesh theMesh,
+ VISU::PMEDMeshOnEntity theMeshOnEntity,
+ VISU::PMEDField theField,
+ VISU::PMEDValForTime theValForTime);
int
LoadValForTimeOnGaussPts(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- VISU::PMEDMeshOnEntity theMeshOnEntity,
- VISU::PMEDField theField,
- VISU::PMEDValForTime theValForTime);
+ VISU::PMEDMesh theMesh,
+ VISU::PMEDMeshOnEntity theMeshOnEntity,
+ VISU::PMEDField theField,
+ VISU::PMEDValForTime theValForTime);
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
int
VISU_MergeFilter
::RequestData(vtkInformation *theRequest,
- vtkInformationVector **theInputVector,
- vtkInformationVector *theOutputVector)
+ vtkInformationVector **theInputVector,
+ vtkInformationVector *theOutputVector)
{
if(vtkUnstructuredGrid *anInput = dynamic_cast<vtkUnstructuredGrid*>(this->GetInput())){
vtkUnstructuredGrid *anOutput = dynamic_cast<vtkUnstructuredGrid*>(this->GetOutput());
return VISU::Execute(anInput,
- anOutput,
- this->GetScalars(),
- this->GetVectors(),
- this->GetNormals(),
- this->GetTCoords(),
- this->GetTensors(),
- this->FieldList,
- IsMergingInputs());
+ anOutput,
+ this->GetScalars(),
+ this->GetVectors(),
+ this->GetNormals(),
+ this->GetTCoords(),
+ this->GetTensors(),
+ this->FieldList,
+ IsMergingInputs());
}else if(vtkPolyData *anInput = dynamic_cast<vtkPolyData*>(this->GetInput())){
vtkPolyData *anOutput = dynamic_cast<vtkPolyData*>(this->GetOutput());
return VISU::Execute(anInput,
- anOutput,
- this->GetScalars(),
- this->GetVectors(),
- this->GetNormals(),
- this->GetTCoords(),
- this->GetTensors(),
- this->FieldList,
- IsMergingInputs());
+ anOutput,
+ this->GetScalars(),
+ this->GetVectors(),
+ this->GetNormals(),
+ this->GetTCoords(),
+ this->GetTensors(),
+ this->FieldList,
+ IsMergingInputs());
}
return Superclass::RequestData(theRequest,
- theInputVector,
- theOutputVector);
+ theInputVector,
+ theOutputVector);
}
//----------------------------------------------------------------------------
int
VISU_MergeFilter
::RequestUpdateExtent(vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *vtkNotUsed(outputVector))
+ vtkInformationVector **inputVector,
+ vtkInformationVector *vtkNotUsed(outputVector))
{
vtkInformation *inputInfo;
int idx;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
// $Header$
//
#include "VISU_MergeFilterUtilities.hxx"
+#include "VISU_ConvertorUtils.hxx"
#include <vtkCellData.h>
#include <vtkObjectFactory.h>
#include <set>
#include <map>
+#if !defined(VTK_XVERSION)
+#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION)
+#endif
+
namespace
{
using namespace VISU;
+ void CopyVectorsOnCells(vtkDataSet *theVectorsDataSet,
+ vtkDataSet *theOutput)
+ {
+ vtkDataArray *anInputVectors = theVectorsDataSet->GetCellData()->GetVectors();
+ vtkDataArray *anOutputVectors = vtkDataArray::CreateDataArray(anInputVectors->GetDataType());
+
+ //Clear output vector data
+ theOutput->GetCellData()->SetVectors(NULL);
+
+ //Copy vectors data
+ vtkIntArray* anOutputIDMapper = GetIDMapper(theOutput,
+ TGetCellData(),
+ "VISU_CELLS_MAPPER");
+
+ vtkIntArray* anInputIDMapper = GetIDMapper(theVectorsDataSet,
+ TGetCellData(),
+ "VISU_CELLS_MAPPER");
+
+ TObjectIdArray anIntersection;
+ GetIntersection(anOutputIDMapper,
+ anInputIDMapper,
+ anIntersection);
+
+ vtkIdType aNbTuples = anIntersection.size();
+ anOutputVectors->SetNumberOfComponents(anInputVectors->GetNumberOfComponents());
+ anOutputVectors->SetNumberOfTuples(aNbTuples);
+ theOutput->GetCellData()->SetVectors(anOutputVectors);
+ anOutputVectors->Delete();
+
+ TObjectId2TupleIdMap anOutputObjectId2TupleIdMap;
+ GetObjectId2TupleIdMap(anOutputIDMapper, anOutputObjectId2TupleIdMap);
+
+ TObjectId2TupleIdMap anInputObjectId2TupleIdMap;
+ GetObjectId2TupleIdMap(anInputIDMapper, anInputObjectId2TupleIdMap);
+
+ for(vtkIdType iTupleId = 0; iTupleId < aNbTuples; iTupleId++ ){
+ TObjectId &anObjectId = anIntersection[iTupleId];
+ vtkIdType anOutputCellId = anOutputObjectId2TupleIdMap[anObjectId];
+ vtkIdType anInputCellId = anInputObjectId2TupleIdMap[anObjectId];
+ anOutputVectors->SetTuple(anOutputCellId,anInputVectors->GetTuple(anInputCellId));
+ }
+ }
+
+ void CopyVectorsOnPoints(vtkDataSet *theVectorsDataSet,
+ vtkDataSet *theOutput)
+ {
+ vtkDataArray *anInputVectors = theVectorsDataSet->GetPointData()->GetVectors();
+
+ //Clear output vector data
+ theOutput->GetPointData()->SetVectors(NULL);
+
+ vtkDataArray *anOutputVectors = vtkDataArray::CreateDataArray(anInputVectors->GetDataType());
+
+ //Copy vectors data
+ vtkIntArray* anOutputIDMapper = GetIDMapper(theOutput,
+ TGetPointData(),
+ "VISU_POINTS_MAPPER");
+
+ vtkIntArray* anInputIDMapper = GetIDMapper(theVectorsDataSet,
+ TGetPointData(),
+ "VISU_POINTS_MAPPER");
+ TObjectIdArray anIntersection;
+
+ GetIntersection(anOutputIDMapper,
+ anInputIDMapper,
+ anIntersection);
+
+ vtkIdType aNbTuples = anIntersection.size();
+ anOutputVectors->SetNumberOfComponents(anInputVectors->GetNumberOfComponents());
+ anOutputVectors->SetNumberOfTuples(aNbTuples);
+
+
+
+ TObjectId2TupleIdMap anOutputObjectId2TupleIdMap;
+ GetObjectId2TupleIdMap(anOutputIDMapper, anOutputObjectId2TupleIdMap);
+
+ TObjectId2TupleIdMap anInputObjectId2TupleIdMap;
+ GetObjectId2TupleIdMap(anInputIDMapper, anInputObjectId2TupleIdMap);
+
+ for(vtkIdType iTupleId = 0; iTupleId < aNbTuples; iTupleId++ ){
+ TObjectId& anObjectId = anIntersection[iTupleId];
+ vtkIdType anOutputPointId = anOutputObjectId2TupleIdMap[anObjectId];
+ vtkIdType anInputPointId = anInputObjectId2TupleIdMap[anObjectId];
+ anOutputVectors->SetTuple(anOutputPointId,anInputVectors->GetTuple(anInputPointId));
+ }
+
+ theOutput->GetPointData()->SetVectors(anOutputVectors);
+ anOutputVectors->Delete();
+ }
+
+
//---------------------------------------------------------------
template<class TDataSet>
-
void
CopyDataOnCells(TDataSet *theInput,
- vtkIntArray *theGeometryCellMapper,
- vtkIntArray *theDataCellMapper,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- VISU::TFieldList* theFieldList,
- TDataSet *theOutput)
+ vtkIntArray *theGeometryCellMapper,
+ vtkIntArray *theDataCellMapper,
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ VISU::TFieldList* theFieldList,
+ TDataSet *theOutput)
{
if(IsDifferent(theGeometryCellMapper, theDataCellMapper)){
TObjectIdArray anIntersection;
GetIntersection(theGeometryCellMapper,
- theDataCellMapper,
- anIntersection);
+ theDataCellMapper,
+ anIntersection);
TObjectId2TupleIdMap aGeomObjectId2TupleIdMap;
GetObjectId2TupleIdMap(theGeometryCellMapper, aGeomObjectId2TupleIdMap);
theOutput->Allocate(aNbTuples);
vtkIdList *aCellIds = vtkIdList::New();
for(int aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
- TObjectId& anObjectId = anIntersection[aTupleId];
- vtkIdType aCellId = aGeomObjectId2TupleIdMap[anObjectId];
- vtkCell *aCell = theInput->GetCell(aCellId);
- aCellIds->Reset();
- vtkIdType aNbPointIds = aCell->PointIds->GetNumberOfIds();
- for(vtkIdType anId = 0; anId < aNbPointIds; anId++)
- aCellIds->InsertNextId(aCell->GetPointIds()->GetId(anId));
- vtkIdType aCellType = theInput->GetCellType(aCellId);
- vtkIdType aNewCellId = theOutput->InsertNextCell(aCellType, aCellIds);
- vtkIdType aDataCellId = aDataObjectId2TupleIdMap[anObjectId];
- anOutputCellData->CopyData(aCellData, aDataCellId, aNewCellId);
+ TObjectId& anObjectId = anIntersection[aTupleId];
+ vtkIdType aCellId = aGeomObjectId2TupleIdMap[anObjectId];
+ vtkCell *aCell = theInput->GetCell(aCellId);
+ aCellIds->Reset();
+ vtkIdType aNbPointIds = aCell->PointIds->GetNumberOfIds();
+ for(vtkIdType anId = 0; anId < aNbPointIds; anId++)
+ aCellIds->InsertNextId(aCell->GetPointIds()->GetId(anId));
+ vtkIdType aCellType = theInput->GetCellType(aCellId);
+ vtkIdType aNewCellId = theOutput->InsertNextCell(aCellType, aCellIds);
+ vtkIdType aDataCellId = aDataObjectId2TupleIdMap[anObjectId];
+ anOutputCellData->CopyData(aCellData, aDataCellId, aNewCellId);
}
aCellIds->Delete();
}
}
- void CopyVectorsOnCells(vtkDataSet *theVectorsDataSet,
- vtkDataSet *theOutput)
- {
- vtkDataArray *anInputVectors = theVectorsDataSet->GetCellData()->GetVectors();
- vtkDataArray *anOutputVectors = vtkDataArray::CreateDataArray(anInputVectors->GetDataType());
-
- //Clear output vector data
- theOutput->GetCellData()->SetVectors(NULL);
-
- //Copy vectors data
- vtkIntArray* anOutputIDMapper = GetIDMapper(theOutput,
- TGetCellData(),
- "VISU_CELLS_MAPPER");
-
- vtkIntArray* anInputIDMapper = GetIDMapper(theVectorsDataSet,
- TGetCellData(),
- "VISU_CELLS_MAPPER");
-
- TObjectIdArray anIntersection;
- GetIntersection(anOutputIDMapper,
- anInputIDMapper,
- anIntersection);
-
- vtkIdType aNbTuples = anIntersection.size();
- anOutputVectors->SetNumberOfComponents(anInputVectors->GetNumberOfComponents());
- anOutputVectors->SetNumberOfTuples(aNbTuples);
- theOutput->GetCellData()->SetVectors(anOutputVectors);
- anOutputVectors->Delete();
-
- TObjectId2TupleIdMap anOutputObjectId2TupleIdMap;
- GetObjectId2TupleIdMap(anOutputIDMapper, anOutputObjectId2TupleIdMap);
-
- TObjectId2TupleIdMap anInputObjectId2TupleIdMap;
- GetObjectId2TupleIdMap(anInputIDMapper, anInputObjectId2TupleIdMap);
-
- for(vtkIdType iTupleId = 0; iTupleId < aNbTuples; iTupleId++ ){
- TObjectId &anObjectId = anIntersection[iTupleId];
- vtkIdType anOutputCellId = anOutputObjectId2TupleIdMap[anObjectId];
- vtkIdType anInputCellId = anInputObjectId2TupleIdMap[anObjectId];
- anOutputVectors->SetTuple(anOutputCellId,anInputVectors->GetTuple(anInputCellId));
- }
- }
-
//---------------------------------------------------------------
template<class TDataSet>
void
CopyDataOnPoints(TDataSet *theInput,
- vtkIntArray *theGeometryPointMapper,
- vtkIntArray *theDataPointMapper,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- VISU::TFieldList* theFieldList,
- TDataSet *theOutput)
+ vtkIntArray *theGeometryPointMapper,
+ vtkIntArray *theDataPointMapper,
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ VISU::TFieldList* theFieldList,
+ TDataSet *theOutput)
{
if(IsDifferent(theGeometryPointMapper, theDataPointMapper)){
TObjectId2TupleIdMap aDataObjectId2PointIdMap;
vtkIdList *aCellIds = vtkIdList::New();
int aNbCells = theInput->GetNumberOfCells();
theOutput->Allocate(aNbCells);
- for(int aCellId = 0; aCellId < aNbCells; aCellId++){
- aCellIds->Reset();
- vtkCell *aCell = theInput->GetCell(aCellId);
- vtkIdType aNbPointIds = aCell->PointIds->GetNumberOfIds();
- for(vtkIdType anId = 0; anId < aNbPointIds; anId++){
- vtkIdType aPointId = aCell->GetPointIds()->GetId(anId);
- int* aPointer = theGeometryPointMapper->GetPointer(aPointId * 2);
- TCellId aCellId = *aPointer;
- TEntityId anEntityId = *(aPointer + 1);
- TObjectId anObjectId(aCellId, anEntityId);
- TObjectId2TupleIdMap::iterator anIter = aDataObjectId2PointIdMap.find(anObjectId);
- if(anIter != aDataObjectId2PointIdMap.end()){
- aPointId = anIter->second;
- aCellIds->InsertNextId(aPointId);
- }else
- goto PASS_INSERT_NEXT_CELL;
- }
- {
- vtkIdType aCellType = theInput->GetCellType(aCellId);
- vtkIdType aNewCellId = theOutput->InsertNextCell(aCellType, aCellIds);
- anOutputCellData->CopyData(aCellData, aCellId, aNewCellId);
- }
- PASS_INSERT_NEXT_CELL:
- continue;
- }
- aCellIds->Delete();
+ if(!VISU::IsElnoData(theScalarsDataSet)) {
+ for(int aCellId = 0; aCellId < aNbCells; aCellId++){
+ aCellIds->Reset();
+ vtkCell *aCell = theInput->GetCell(aCellId);
+ vtkIdType aNbPointIds = aCell->PointIds->GetNumberOfIds();
+ for(vtkIdType anId = 0; anId < aNbPointIds; anId++){
+ vtkIdType aPointId = aCell->GetPointIds()->GetId(anId);
+ int* aPointer = theGeometryPointMapper->GetPointer(aPointId * 2);
+ TCellId aCellId = *aPointer;
+ TEntityId anEntityId = *(aPointer + 1);
+ TObjectId anObjectId(aCellId, anEntityId);
+ TObjectId2TupleIdMap::iterator anIter = aDataObjectId2PointIdMap.find(anObjectId);
+ if(anIter != aDataObjectId2PointIdMap.end()){
+ aPointId = anIter->second;
+ aCellIds->InsertNextId(aPointId);
+ }else
+ goto PASS_INSERT_NEXT_CELL;
+ }
+ {
+ vtkIdType aCellType = theInput->GetCellType(aCellId);
+ vtkIdType aNewCellId = theOutput->InsertNextCell(aCellType, aCellIds);
+ anOutputCellData->CopyData(aCellData, aCellId, aNewCellId);
+ }
+ PASS_INSERT_NEXT_CELL:
+ continue;
+ }
+ aCellIds->Delete();
+ } else {
+ vtkIntArray* anInputCellIDMapper = GetIDMapper(theInput,
+ TGetCellData(),
+ "VISU_CELLS_MAPPER");
+
+ vtkIntArray* anScalarsCellIDMapper = GetIDMapper(theScalarsDataSet,
+ TGetCellData(),
+ "VISU_CELLS_MAPPER");
+
+ vtkIntArray *anInputArray = dynamic_cast<vtkIntArray*>(anInputCellIDMapper);
+ int aNbComp = anInputArray->GetNumberOfComponents();
+ TCellId inCellObjId = -1;
+ TEntityId inEntityId = -1;
+ TCellId scalarCellVtkId = -1;
+ vtkCell* inputCell = NULL;
+ vtkCell* scalarCell = NULL;
+
+ for(int aCellId = 0; aCellId < aNbCells; aCellId++) {
+ aCellIds->Reset();
+ int* anInPointer = anInputArray->GetPointer(aCellId*aNbComp);
+ inCellObjId = *anInPointer;
+ inEntityId = *(anInPointer+1);
+ if(inCellObjId == -1) continue;
+ scalarCellVtkId = VISU::GetVTKID(anScalarsCellIDMapper,inCellObjId,inEntityId);
+ if(scalarCellVtkId == -1) continue;
+ scalarCell = theScalarsDataSet->GetCell(scalarCellVtkId);
+ inputCell = theInput->GetCell(aCellId);
+ vtkIdType aCellType = inputCell->GetCellType();
+ if(scalarCell->GetCellType() == aCellType) {
+ aCellIds->DeepCopy(scalarCell->PointIds);
+ vtkIdType aNewCellId = theOutput->InsertNextCell(aCellType, aCellIds);
+ anOutputCellData->CopyData(aCellData, aCellId, aNewCellId);
+ }
+ }
+ }
// Copy geometry points
// 1. Create vtkPoints instance of the same data type
int aNbDataPoints = theDataPointMapper->GetNumberOfTuples();
anOutputPoints->SetNumberOfPoints(aNbDataPoints);
for(int aPointId = 0; aPointId < aNbDataPoints; aPointId++){
- int* aPointer = theDataPointMapper->GetPointer(aPointId * 2);
- TCellId aCellId = *aPointer;
- TEntityId anEntityId = *(aPointer + 1);
- TObjectId anObjectId(aCellId, anEntityId);
- TObjectId2TupleIdMap::iterator anIter = aGeomObjectId2TupleIdMap.find(anObjectId);
- if(anIter != aGeomObjectId2TupleIdMap.end()){
- // If the point exists in the geometry put it to output
- int aGeometryPointId = anIter->second;
- vtkFloatingPointType aCoords[3];
- anGeometryPoints->GetPoint(aGeometryPointId, aCoords);
- anOutputPoints->SetPoint(aPointId, aCoords);
- }else{
- // If no, the point from data should be used
- vtkFloatingPointType aCoords[3];
- aDataPoints->GetPoint(aPointId, aCoords);
- anOutputPoints->SetPoint(aPointId, aCoords);
- }
+ int* aPointer = theDataPointMapper->GetPointer(aPointId * 2);
+ TCellId aCellId = *aPointer;
+ TEntityId anEntityId = *(aPointer + 1);
+ TObjectId anObjectId(aCellId, anEntityId);
+ TObjectId2TupleIdMap::iterator anIter = aGeomObjectId2TupleIdMap.find(anObjectId);
+ if(anIter != aGeomObjectId2TupleIdMap.end()){
+ // If the point exists in the geometry put it to output
+ int aGeometryPointId = anIter->second;
+ vtkFloatingPointType aCoords[3];
+ anGeometryPoints->GetPoint(aGeometryPointId, aCoords);
+ anOutputPoints->SetPoint(aPointId, aCoords);
+ }else{
+ // If no, the point from data should be used
+ vtkFloatingPointType aCoords[3];
+ aDataPoints->GetPoint(aPointId, aCoords);
+ anOutputPoints->SetPoint(aPointId, aCoords);
+ }
}
}else{
theOutput->CopyStructure(theInput);
}
}
}
-
- void CopyVectorsOnPoints(vtkDataSet *theVectorsDataSet,
- vtkDataSet *theOutput)
- {
- vtkDataArray *anInputVectors = theVectorsDataSet->GetPointData()->GetVectors();
-
- //Clear output vector data
- theOutput->GetPointData()->SetVectors(NULL);
-
- vtkDataArray *anOutputVectors = vtkDataArray::CreateDataArray(anInputVectors->GetDataType());
-
- //Copy vectors data
- vtkIntArray* anOutputIDMapper = GetIDMapper(theOutput,
- TGetPointData(),
- "VISU_POINTS_MAPPER");
-
- vtkIntArray* anInputIDMapper = GetIDMapper(theVectorsDataSet,
- TGetPointData(),
- "VISU_POINTS_MAPPER");
- TObjectIdArray anIntersection;
-
- GetIntersection(anOutputIDMapper,
- anInputIDMapper,
- anIntersection);
-
- vtkIdType aNbTuples = anIntersection.size();
- anOutputVectors->SetNumberOfComponents(anInputVectors->GetNumberOfComponents());
- anOutputVectors->SetNumberOfTuples(aNbTuples);
-
-
-
- TObjectId2TupleIdMap anOutputObjectId2TupleIdMap;
- GetObjectId2TupleIdMap(anOutputIDMapper, anOutputObjectId2TupleIdMap);
-
- TObjectId2TupleIdMap anInputObjectId2TupleIdMap;
- GetObjectId2TupleIdMap(anInputIDMapper, anInputObjectId2TupleIdMap);
-
- for(vtkIdType iTupleId = 0; iTupleId < aNbTuples; iTupleId++ ){
- TObjectId& anObjectId = anIntersection[iTupleId];
- vtkIdType anOutputPointId = anOutputObjectId2TupleIdMap[anObjectId];
- vtkIdType anInputPointId = anInputObjectId2TupleIdMap[anObjectId];
- anOutputVectors->SetTuple(anOutputPointId,anInputVectors->GetTuple(anInputPointId));
- }
-
- theOutput->GetPointData()->SetVectors(anOutputVectors);
- anOutputVectors->Delete();
- }
-
//---------------------------------------------------------------
typedef vtkDataArray* (vtkDataSetAttributes::* TGetAttribute)();
+#if (VTK_XVERSION < 0x050100)
typedef int (vtkDataSetAttributes::* TSetAttribute)(vtkDataArray*);
+#else
+ typedef int (vtkDataSetAttributes::* TSetAttribute)(vtkAbstractArray*);
+ typedef int (vtkDataSetAttributes::* TSetDataAttribute)(vtkDataArray*);
+#endif
+
+#if (VTK_XVERSION >= 0x050100)
inline
void
CopyArray(vtkDataArray* theDataArray,
- vtkDataSetAttributes* theOutput,
- TSetAttribute theSetAttribute,
- vtkIdType theFixedNbTuples)
+ vtkDataSetAttributes* theOutput,
+ TSetDataAttribute theSetAttribute,
+ vtkIdType theFixedNbTuples)
{
if(theDataArray){
vtkIdType aNbTuples = theDataArray->GetNumberOfTuples();
if(theFixedNbTuples == aNbTuples)
- (theOutput->*theSetAttribute)(theDataArray);
+ (theOutput->*theSetAttribute)(theDataArray);
+ }
+ }
+#endif
+
+ inline
+ void
+ CopyArray(vtkDataArray* theDataArray,
+ vtkDataSetAttributes* theOutput,
+ TSetAttribute theSetAttribute,
+ vtkIdType theFixedNbTuples)
+ {
+ if(theDataArray){
+ vtkIdType aNbTuples = theDataArray->GetNumberOfTuples();
+ if(theFixedNbTuples == aNbTuples)
+ (theOutput->*theSetAttribute)(theDataArray);
}
}
inline
void
CopyAttribute(vtkDataSetAttributes* theInput,
- TGetAttribute theGetAttribute,
- vtkDataSetAttributes* theOutput,
- TSetAttribute theSetAttribute,
- vtkIdType theFixedNbTuples)
+ TGetAttribute theGetAttribute,
+ vtkDataSetAttributes* theOutput,
+#if (VTK_XVERSION < 0x050100)
+ TSetAttribute theSetAttribute,
+#else
+ TSetDataAttribute theSetAttribute,
+#endif
+ vtkIdType theFixedNbTuples)
{
CopyArray((theInput->*theGetAttribute)(),
- theOutput, theSetAttribute,
- theFixedNbTuples);
+ theOutput, theSetAttribute,
+ theFixedNbTuples);
}
inline
void
CopyDataSetAttribute(vtkDataSet *theInput,
- TGetAttribute theGetAttribute,
- vtkDataSet *theOutput,
- TSetAttribute theSetAttribute,
- vtkIdType theNbPoints,
- vtkIdType theNbCells)
+ TGetAttribute theGetAttribute,
+ vtkDataSet *theOutput,
+#if (VTK_XVERSION < 0x050100)
+ TSetAttribute theSetAttribute,
+#else
+ TSetDataAttribute theSetAttribute,
+#endif
+ vtkIdType theNbPoints,
+ vtkIdType theNbCells)
{
CopyAttribute(theInput->GetPointData(),
- theGetAttribute,
- theOutput->GetPointData(),
- theSetAttribute,
- theNbPoints);
+ theGetAttribute,
+ theOutput->GetPointData(),
+ theSetAttribute,
+ theNbPoints);
CopyAttribute(theInput->GetCellData(),
- theGetAttribute,
- theOutput->GetCellData(),
- theSetAttribute,
- theNbCells);
+ theGetAttribute,
+ theOutput->GetCellData(),
+ theSetAttribute,
+ theNbCells);
}
inline
void
CopyField(vtkDataSetAttributes* theInput,
- const char* theFieldName,
- vtkDataSetAttributes* theOutput,
- vtkIdType theFixedNbTuples)
+ const char* theFieldName,
+ vtkDataSetAttributes* theOutput,
+ vtkIdType theFixedNbTuples)
{
CopyArray(theInput->GetArray(theFieldName),
- theOutput,
- &vtkDataSetAttributes::AddArray,
- theFixedNbTuples);
+ theOutput,
+#if (VTK_XVERSION < 0x050100)
+ &vtkDataSetAttributes::AddArray,
+#else
+ &vtkFieldData::AddArray,
+#endif
+ theFixedNbTuples);
}
inline
void
CopyDataSetField(vtkDataSet* theInput,
- const char* theFieldName,
- vtkDataSet* theOutput,
- vtkIdType theNbPoints,
- vtkIdType theNbCells)
+ const char* theFieldName,
+ vtkDataSet* theOutput,
+ vtkIdType theNbPoints,
+ vtkIdType theNbCells)
{
if(theInput){
CopyField(theInput->GetPointData(),
- theFieldName,
- theOutput->GetPointData(),
- theNbPoints);
+ theFieldName,
+ theOutput->GetPointData(),
+ theNbPoints);
CopyField(theInput->GetCellData(),
- theFieldName,
- theOutput->GetCellData(),
- theNbCells);
+ theFieldName,
+ theOutput->GetCellData(),
+ theNbCells);
}
}
//---------------------------------------------------------------
void
BasicExecute(vtkDataSet *theInput,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- VISU::TFieldList* theFieldList,
- vtkDataSet *theOutput)
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ VISU::TFieldList* theFieldList,
+ vtkDataSet *theOutput)
{
theOutput->CopyStructure(theInput);
// merge data only if it is consistent
if(theScalarsDataSet)
CopyDataSetAttribute(theScalarsDataSet,
- &vtkDataSetAttributes::GetScalars,
- theOutput,
- &vtkDataSetAttributes::SetScalars,
- aNbPoints,
- aNbCells);
+ &vtkDataSetAttributes::GetScalars,
+ theOutput,
+ &vtkDataSetAttributes::SetScalars,
+ aNbPoints,
+ aNbCells);
if(theVectorsDataSet)
CopyDataSetAttribute(theVectorsDataSet,
- &vtkDataSetAttributes::GetVectors,
- theOutput,
- &vtkDataSetAttributes::SetVectors,
- aNbPoints,
- aNbCells);
+ &vtkDataSetAttributes::GetVectors,
+ theOutput,
+ &vtkDataSetAttributes::SetVectors,
+ aNbPoints,
+ aNbCells);
if(theNormalsDataSet)
CopyDataSetAttribute(theNormalsDataSet,
- &vtkDataSetAttributes::GetNormals,
- theOutput,
- &vtkDataSetAttributes::SetNormals,
- aNbPoints,
- aNbCells);
+ &vtkDataSetAttributes::GetNormals,
+ theOutput,
+ &vtkDataSetAttributes::SetNormals,
+ aNbPoints,
+ aNbCells);
if(theTCoordsDataSet)
CopyDataSetAttribute(theTCoordsDataSet,
- &vtkDataSetAttributes::GetTCoords,
- theOutput,
- &vtkDataSetAttributes::SetTCoords,
- aNbPoints,
- aNbCells);
+ &vtkDataSetAttributes::GetTCoords,
+ theOutput,
+ &vtkDataSetAttributes::SetTCoords,
+ aNbPoints,
+ aNbCells);
if(theTensorsDataSet)
CopyDataSetAttribute(theTensorsDataSet,
- &vtkDataSetAttributes::GetTensors,
- theOutput,
- &vtkDataSetAttributes::SetTensors,
- aNbPoints,
- aNbCells);
+ &vtkDataSetAttributes::GetTensors,
+ theOutput,
+ &vtkDataSetAttributes::SetTensors,
+ aNbPoints,
+ aNbCells);
VISU::TFieldListIterator anIter(theFieldList);
for(anIter.Begin(); !anIter.End() ; anIter.Next()){
vtkDataSet *aDataSet = anIter.Get()->Ptr;
const char* aFieldName = anIter.Get()->GetName();
CopyDataSetField(aDataSet,
- aFieldName,
- theOutput,
- aNbPoints,
- aNbCells);
+ aFieldName,
+ theOutput,
+ aNbPoints,
+ aNbCells);
}
}
template<class TDataSet>
bool
Execute(TDataSet *theInput,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- VISU::TFieldList* theFieldList,
- bool theIsMergingInputs,
- TDataSet *theOutput)
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ VISU::TFieldList* theFieldList,
+ bool theIsMergingInputs,
+ TDataSet *theOutput)
{
if(theIsMergingInputs){
vtkCellData *aCellData = theInput->GetCellData();
if(vtkDataArray *aCellMapper = aCellData->GetArray("VISU_CELLS_MAPPER")){
- bool anIsDataOnCells = false;
- if(vtkDataSet* aDataSet = theScalarsDataSet)
- if(vtkCellData* aCellData = aDataSet->GetCellData())
- anIsDataOnCells = (aCellData->GetArray("VISU_FIELD") != NULL);
- if(anIsDataOnCells){
- vtkIntArray *aGeometryCellMapper = dynamic_cast<vtkIntArray*>(aCellMapper);
- vtkIntArray* aDataCellMapper = GetIDMapper(theFieldList,
- TGetCellData(),
- "VISU_CELLS_MAPPER");
- CopyDataOnCells(theInput,
- aGeometryCellMapper,
- aDataCellMapper,
- theScalarsDataSet,
- theVectorsDataSet,
- theNormalsDataSet,
- theTCoordsDataSet,
- theTensorsDataSet,
- theFieldList,
- theOutput);
- }else{
- vtkPointData *aPointData = theInput->GetPointData();
- vtkDataArray *aPointMapper = aPointData->GetArray("VISU_POINTS_MAPPER");
- vtkIntArray *aGeometryPointMapper = dynamic_cast<vtkIntArray*>(aPointMapper);
- vtkIntArray* aDataPointMapper = GetIDMapper(theFieldList,
- TGetPointData(),
- "VISU_POINTS_MAPPER");
- CopyDataOnPoints(theInput,
- aGeometryPointMapper,
- aDataPointMapper,
- theScalarsDataSet,
- theVectorsDataSet,
- theNormalsDataSet,
- theTCoordsDataSet,
- theTensorsDataSet,
- theFieldList,
- theOutput);
- }
+ bool anIsDataOnCells = false;
+ if(vtkDataSet* aDataSet = theScalarsDataSet)
+ if(vtkCellData* aCellData = aDataSet->GetCellData())
+ anIsDataOnCells = (aCellData->GetArray("VISU_FIELD") != NULL);
+ if(anIsDataOnCells){
+ vtkIntArray *aGeometryCellMapper = dynamic_cast<vtkIntArray*>(aCellMapper);
+ vtkIntArray* aDataCellMapper = GetIDMapper(theFieldList,
+ TGetCellData(),
+ "VISU_CELLS_MAPPER");
+ CopyDataOnCells(theInput,
+ aGeometryCellMapper,
+ aDataCellMapper,
+ theScalarsDataSet,
+ theVectorsDataSet,
+ theNormalsDataSet,
+ theTCoordsDataSet,
+ theTensorsDataSet,
+ theFieldList,
+ theOutput);
+ }else{
+ vtkPointData *aPointData = theInput->GetPointData();
+ vtkDataArray *aPointMapper = aPointData->GetArray("VISU_POINTS_MAPPER");
+ vtkIntArray *aGeometryPointMapper = dynamic_cast<vtkIntArray*>(aPointMapper);
+ vtkIntArray* aDataPointMapper = GetIDMapper(theFieldList,
+ TGetPointData(),
+ "VISU_POINTS_MAPPER");
+ CopyDataOnPoints(theInput,
+ aGeometryPointMapper,
+ aDataPointMapper,
+ theScalarsDataSet,
+ theVectorsDataSet,
+ theNormalsDataSet,
+ theTCoordsDataSet,
+ theTensorsDataSet,
+ theFieldList,
+ theOutput);
+ }
}
}else{
BasicExecute(theInput,
- theScalarsDataSet,
- theVectorsDataSet,
- theNormalsDataSet,
- theTCoordsDataSet,
- theTensorsDataSet,
- theFieldList,
- theOutput);
+ theScalarsDataSet,
+ theVectorsDataSet,
+ theNormalsDataSet,
+ theTCoordsDataSet,
+ theTensorsDataSet,
+ theFieldList,
+ theOutput);
}
return true;
}
//---------------------------------------------------------------
void
GetObjectIdSet(vtkIntArray *theArray,
- TObjectIdSet& theObjectIdSet)
+ TObjectIdSet& theObjectIdSet)
{
theObjectIdSet.clear();
int aMaxId = theArray->GetMaxId();
//---------------------------------------------------------------
void
GetObjectId2TupleIdMap(vtkIntArray *theArray,
- TObjectId2TupleIdMap& theObjectId2TupleIdMap)
+ TObjectId2TupleIdMap& theObjectId2TupleIdMap)
{
theObjectId2TupleIdMap.clear();
int* aPointer = theArray->GetPointer(0);
template<class TGetFieldData>
vtkIntArray*
GetIDMapper(VISU::TFieldList* theFieldList,
- TGetFieldData theGetFieldData,
- const char* theFieldName)
+ TGetFieldData theGetFieldData,
+ const char* theFieldName)
{
VISU::TFieldListIterator anIter(theFieldList);
for(anIter.Begin(); !anIter.End() ; anIter.Next()){
const char* aFieldName = anIter.Get()->GetName();
if(strcmp(aFieldName, theFieldName) == 0){
- vtkDataSet* aDataSet = anIter.Get()->Ptr;
- vtkFieldData *aFieldData = theGetFieldData(aDataSet);
- vtkDataArray *anIDMapper = aFieldData->GetArray(theFieldName);
- return dynamic_cast<vtkIntArray*>(anIDMapper);
+ vtkDataSet* aDataSet = anIter.Get()->Ptr;
+ vtkFieldData *aFieldData = theGetFieldData(aDataSet);
+ vtkDataArray *anIDMapper = aFieldData->GetArray(theFieldName);
+ return dynamic_cast<vtkIntArray*>(anIDMapper);
}
}
return NULL;
}
-
+ // Explicit symbol export when compiling with g++ and optimizations,
+ // needed by VISUConvertor during linking
+ #if (__GNUG__ && __OPTIMIZE__)
+ template vtkIntArray*
+ GetIDMapper<TGetPointData>(TFieldList*, TGetPointData, const char* );
+ #endif
//---------------------------------------------------------------
template<class TGetFieldData>
vtkIntArray*
GetIDMapper(vtkDataSet* theIDMapperDataSet,
- TGetFieldData theGetFieldData,
- const char* theFieldName)
+ TGetFieldData theGetFieldData,
+ const char* theFieldName)
{
vtkFieldData *aFieldData = theGetFieldData(theIDMapperDataSet);
vtkDataArray *anIDMapper = aFieldData->GetArray(theFieldName);
//---------------------------------------------------------------
bool
IsDifferent(vtkIntArray *theFirstIDMapper,
- vtkIntArray *theSecondIDMapper)
+ vtkIntArray *theSecondIDMapper)
{
vtkIdType aFirstNbTuples = theFirstIDMapper->GetNumberOfTuples();
vtkIdType aSecondNbTuples = theSecondIDMapper->GetNumberOfTuples();
int* aSecondPointer = theSecondIDMapper->GetPointer(0);
for(int anId = 0; anId <= aMaxId; anId++){
if(*aFirstPointer++ != *aSecondPointer++)
- return true;
+ return true;
}
return false;
//---------------------------------------------------------------
void
GetIntersection(vtkIntArray *theFirstIDMapper,
- vtkIntArray *theSecondIDMapper,
- TObjectIdArray& theResult)
+ vtkIntArray *theSecondIDMapper,
+ TObjectIdArray& theResult)
{
TObjectIdSet aFirstObjectIdSet;
GetObjectIdSet(theFirstIDMapper, aFirstObjectIdSet);
theResult.resize(aMaxLength);
TObjectIdArray::iterator anArrayIter = theResult.begin();
anArrayIter = std::set_intersection(aFirstObjectIdSet.begin(),
- aFirstObjectIdSet.end(),
- aSecondObjectIdSet.begin(),
- aSecondObjectIdSet.end(),
- anArrayIter);
+ aFirstObjectIdSet.end(),
+ aSecondObjectIdSet.begin(),
+ aSecondObjectIdSet.end(),
+ anArrayIter);
theResult.erase(anArrayIter, theResult.end());
}
//---------------------------------------------------------------
bool
Execute(vtkUnstructuredGrid *theInput,
- vtkUnstructuredGrid *theOutput,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- TFieldList* theFieldList,
- bool theIsMergingInputs)
+ vtkUnstructuredGrid *theOutput,
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ TFieldList* theFieldList,
+ bool theIsMergingInputs)
{
return ::Execute(theInput,
- theScalarsDataSet,
- theVectorsDataSet,
- theNormalsDataSet,
- theTCoordsDataSet,
- theTensorsDataSet,
- theFieldList,
- theIsMergingInputs,
- theOutput);
+ theScalarsDataSet,
+ theVectorsDataSet,
+ theNormalsDataSet,
+ theTCoordsDataSet,
+ theTensorsDataSet,
+ theFieldList,
+ theIsMergingInputs,
+ theOutput);
}
//---------------------------------------------------------------
bool
Execute(vtkPolyData *theInput,
- vtkPolyData *theOutput,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- TFieldList* theFieldList,
- bool theIsMergingInputs)
+ vtkPolyData *theOutput,
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ TFieldList* theFieldList,
+ bool theIsMergingInputs)
{
return ::Execute(theInput,
- theScalarsDataSet,
- theVectorsDataSet,
- theNormalsDataSet,
- theTCoordsDataSet,
- theTensorsDataSet,
- theFieldList,
- theIsMergingInputs,
- theOutput);
+ theScalarsDataSet,
+ theVectorsDataSet,
+ theNormalsDataSet,
+ theTCoordsDataSet,
+ theTensorsDataSet,
+ theFieldList,
+ theIsMergingInputs,
+ theOutput);
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
void
GetObjectId2TupleIdMap(vtkIntArray *theArray,
- TObjectId2TupleIdMap& theObjectId2TupleIdMap);
+ TObjectId2TupleIdMap& theObjectId2TupleIdMap);
void
GetObjectId2TupleGaussIdArray(vtkIntArray *theArray,
template<class TGetFieldData>
vtkIntArray*
GetIDMapper(VISU::TFieldList* theFieldList,
- TGetFieldData theGetFieldData,
- const char* theFieldName);
+ TGetFieldData theGetFieldData,
+ const char* theFieldName);
template<class TGetFieldData>
vtkIntArray*
GetIDMapper(vtkDataSet* theIDMapperDataSet,
- TGetFieldData theGetFieldData,
- const char* theFieldName);
+ TGetFieldData theGetFieldData,
+ const char* theFieldName);
bool
IsDifferent(vtkIntArray *theFirstIDMapper,
- vtkIntArray *theSecondIDMapper);
+ vtkIntArray *theSecondIDMapper);
void
GetIntersection(vtkIntArray *theFirstIDMapper,
- vtkIntArray *theSecondIDMapper,
- TObjectIdArray& theResult);
+ vtkIntArray *theSecondIDMapper,
+ TObjectIdArray& theResult);
//---------------------------------------------------------------
bool
Execute(vtkUnstructuredGrid *theInput,
- vtkUnstructuredGrid *theOutput,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- TFieldList* theFieldList,
- bool theIsMergingInputs);
+ vtkUnstructuredGrid *theOutput,
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ TFieldList* theFieldList,
+ bool theIsMergingInputs);
//---------------------------------------------------------------
bool
Execute(vtkPolyData *theInput,
- vtkPolyData *theOutput,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- TFieldList* theFieldList,
- bool theIsMergingInputs);
+ vtkPolyData *theOutput,
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ TFieldList* theFieldList,
+ bool theIsMergingInputs);
//---------------------------------------------------------------
class TFieldNode
{
int length = static_cast<int>(strlen(name));
if (length > 0) {
- this->Name = new char[length+1];
- strcpy(this->Name, name);
+ this->Name = new char[length+1];
+ strcpy(this->Name, name);
} else {
this->Name = 0;
}
{
TFieldNode* newNode = new TFieldNode(name, ptr);
if (!this->First) {
- this->First = newNode;
- this->Last = newNode;
+ this->First = newNode;
+ this->Last = newNode;
} else {
this->Last->Next = newNode;
this->Last = newNode;
void Next()
{
if (this->Position) {
- this->Position = this->Position->Next;
+ this->Position = this->Position->Next;
}
}
int End()
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File:
// Author:
#include <vtkIntArray.h>
#include <vtkUnsignedIntArray.h>
#include <vtkLongArray.h>
-#include <vtkUnsignedLongArray.h>
-#include <vtkFloatArray.h>
-#include <vtkDoubleArray.h>
+#include <vtkUnsignedLongArray.h>
+#include <vtkFloatArray.h>
+#include <vtkDoubleArray.h>
#include <string>
#include <algorithm>
//---------------------------------------------------------------
std::string
GenerateFieldName(const PFieldImpl& theField,
- const PValForTimeImpl& theValForTime)
+ const PValForTimeImpl& theValForTime)
{
const VISU::TTime& aTime = theValForTime->myTime;
- std::string aFieldName = theField->myMeshName + ", " + theField->myName + ": " +
+ std::string aFieldName = theField->myMeshName + ", " + theField->myName + ": " +
VISU_Convertor::GenerateName(aTime);
return aFieldName;
}
void
TMeshValueBase
::Init(vtkIdType theNbElem,
- vtkIdType theNbGauss,
- vtkIdType theNbComp)
+ vtkIdType theNbGauss,
+ vtkIdType theNbComp)
{
myNbElem = theNbElem;
myNbGauss = theNbGauss;
myStep = theNbComp*theNbGauss;
}
- vtkIdType
+ vtkIdType
TMeshValueBase
::GetNbElem() const
{
return myNbElem;
}
- vtkIdType
+ vtkIdType
TMeshValueBase
::GetNbComp() const
{
return myNbComp;
}
- vtkIdType
+ vtkIdType
TMeshValueBase
::GetNbGauss() const
{
return myNbGauss;
}
- size_t
+ size_t
TMeshValueBase
::size() const
{
//----------------------------------------------------------------------------
template<int EDataType>
- void
+ void
InitTimeStampOnProfile(const PUnstructuredGrid& theSource,
- const PFieldImpl& theField,
- const PValForTimeImpl& theValForTime,
- const VISU::TEntity& theEntity);
+ const PFieldImpl& theField,
+ const PValForTimeImpl& theValForTime,
+ const VISU::TEntity& theEntity);
//----------------------------------------------------------------------------
- void
+ void
GetTimeStampOnProfile(const PUnstructuredGrid& theSource,
- const PFieldImpl& theField,
- const PValForTimeImpl& theValForTime,
- const VISU::TEntity& theEntity)
+ const PFieldImpl& theField,
+ const PValForTimeImpl& theValForTime,
+ const VISU::TEntity& theEntity)
{
vtkIdType aDataType = theField->GetDataType();
switch(aDataType){
break;
default:
EXCEPTION(std::runtime_error,
- "GetTimeStampOnProfile - handling unsupported data type - "<<aDataType);
+ "GetTimeStampOnProfile - handling unsupported data type - "<<aDataType);
}
}
TDataArrayHolder(TVTKDataArray* theDataArray):
myDataArray(theDataArray)
{}
-
+
void
WritePointer(TVTKDataArray* theDataArray,
- vtkIdType theTupleId,
- TVTKBasicType* thePointer)
+ vtkIdType theTupleId,
+ TVTKBasicType* thePointer)
{
vtkIdType aNumberOfComponents = theDataArray->GetNumberOfComponents();
vtkIdType aPosition = theTupleId * aNumberOfComponents;
TVTKBasicType *aPtr = theDataArray->WritePointer(aPosition, aNumberOfComponents);
for(vtkIdType anId = 0; anId < aNumberOfComponents; anId++)
- *aPtr++ = *thePointer++;
+ *aPtr++ = *thePointer++;
}
virtual
void
- SetTuple(vtkIdType theTupleId,
- TVTKBasicType* thePointer)
+ SetTuple(vtkIdType theTupleId,
+ TVTKBasicType* thePointer)
{
this->WritePointer(myDataArray, theTupleId, thePointer);
}
TVTKDataArray* myDataArray2;
TDataArrayHolder2(TVTKDataArray* theDataArray,
- TVTKDataArray* theDataArray2):
+ TVTKDataArray* theDataArray2):
TSuperClass(theDataArray),
myDataArray2(theDataArray2)
{}
-
+
virtual
void
- SetTuple(vtkIdType theTupleId,
- TVTKBasicType* thePointer)
+ SetTuple(vtkIdType theTupleId,
+ TVTKBasicType* thePointer)
{
this->WritePointer(this->myDataArray, theTupleId, thePointer);
this->WritePointer(this->myDataArray2, theTupleId, thePointer);
TTimeStampOnProfileInitArray(const PDataArrayHolder& theDataArrayHolder):
myDataArrayHolder(theDataArrayHolder)
{}
-
+
void
Execute(const PFieldImpl& theField,
- const PValForTimeImpl& theValForTime)
+ const PValForTimeImpl& theValForTime,
+ const TGaussMetric theGaussMetric = VISU::AVERAGE_METRIC)
{
vtkIdType aNbComp = theField->myNbComp;
vtkIdType aSize = std::max(vtkIdType(3), aNbComp);
- TVector<TVTKBasicType> aDataValues(aSize);
-
+ TVector<TVTKBasicType> aDataValues (aSize);
+
const TGeom2MeshValue& aGeom2MeshValue = theValForTime->GetGeom2MeshValue();
TGeom2MeshValue::const_iterator anIter = aGeom2MeshValue.begin();
- for(int aTupleId = 0; anIter != aGeom2MeshValue.end(); anIter++){
- EGeometry aEGeom = anIter->first;
- const TMeshValuePtr aMeshValue = anIter->second;
-
- vtkIdType aNbElem = aMeshValue->GetNbElem();
- vtkIdType aNbGauss = aMeshValue->GetNbGauss();
-
- INITMSG(MYDEBUG,
- "- aEGeom = "<<aEGeom<<
- "; aNbElem = "<<aNbElem<<
- "; aNbGauss = "<<aNbGauss<<
- std::endl);
-
- for(vtkIdType iElem = 0; iElem < aNbElem; iElem++, aTupleId++){
- typename TMeshValue::TCValueSliceArr aValueSliceArr = aMeshValue->GetCompValueSliceArr(iElem);
- for(vtkIdType iComp = 0; iComp < aNbComp; iComp++){
- const typename TMeshValue::TCValueSlice& aValueSlice = aValueSliceArr[iComp];
- aDataValues[iComp] = TVTKBasicType();
- for(vtkIdType iGauss = 0; iGauss < aNbGauss; iGauss++){
- aDataValues[iComp] += aValueSlice[iGauss];
- }
- aDataValues[iComp] /= aNbGauss;
- }
- this->myDataArrayHolder->SetTuple(aTupleId, &aDataValues[0]);
- }
+ for (int aTupleId = 0; anIter != aGeom2MeshValue.end(); anIter++) {
+ EGeometry aEGeom = anIter->first;
+ const TMeshValuePtr aMeshValue = anIter->second;
+
+ vtkIdType aNbElem = aMeshValue->GetNbElem();
+ vtkIdType aNbGauss = aMeshValue->GetNbGauss();
+
+ INITMSG(MYDEBUG,
+ "- aEGeom = "<<aEGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; aNbGauss = "<<aNbGauss<<
+ std::endl);
+
+ for (vtkIdType iElem = 0; iElem < aNbElem; iElem++, aTupleId++) {
+ typename TMeshValue::TCValueSliceArr aValueSliceArr = aMeshValue->GetCompValueSliceArr(iElem);
+
+ for (vtkIdType iComp = 0; iComp < aNbComp; iComp++) {
+ const typename TMeshValue::TCValueSlice& aValueSlice = aValueSliceArr[iComp];
+ //jfa//aDataValues[iComp] = TVTKBasicType();
+ for (vtkIdType iGauss = 0; iGauss < aNbGauss; iGauss++) {
+ TVTKBasicType aValue = aValueSlice[iGauss];
+ //jfa//if (iGauss == 0 && theGaussMetric != VISU::AVERAGE_METRIC) {
+ if (iGauss == 0) {
+ aDataValues[iComp] = aValue; // init
+ }
+ else {
+ switch (theGaussMetric) {
+ case VISU::AVERAGE_METRIC:
+ aDataValues[iComp] += aValue; break;
+ case VISU::MINIMUM_METRIC:
+ aDataValues[iComp] = std::min( aValue, aDataValues[iComp] ); break;
+ case VISU::MAXIMUM_METRIC:
+ aDataValues[iComp] = std::max( aValue, aDataValues[iComp] ); break;
+ }
+ }
+ }
+ if (theGaussMetric == VISU::AVERAGE_METRIC)
+ aDataValues[iComp] /= aNbGauss;
+ }
+
+ this->myDataArrayHolder->SetTuple(aTupleId, &aDataValues[0]);
+ }
+ }
+ }
+ };
+
+ template<int EDataType>
+ struct TTimeStampOnProfileInitModulus
+ {
+ typedef typename TL::TEnum2VTKArrayType<EDataType>::TResult TVTKDataArray;
+ typedef typename TL::TEnum2VTKBasicType<EDataType>::TResult TVTKBasicType;
+ typedef TTMeshValue<TVTKBasicType> TMeshValue;
+ typedef MED::SharedPtr<TMeshValue> TMeshValuePtr;
+
+ typedef TDataArrayHolder<EDataType> TTDataArrayHolder;
+ typedef MED::SharedPtr<TTDataArrayHolder> PDataArrayHolder;
+ PDataArrayHolder myDataArrayHolder;
+
+ TTimeStampOnProfileInitModulus(const PDataArrayHolder& theDataArrayHolder):
+ myDataArrayHolder(theDataArrayHolder)
+ {}
+
+ void
+ Execute(const PFieldImpl& theField, const PValForTimeImpl& theValForTime)
+ {
+ vtkIdType aNbComp = theField->myNbComp;
+ vtkIdType aSize = vtkIdType(3); // Minimum, Maximum and Average modulus
+ TVector<TVTKBasicType> aDataValues (aSize);
+
+ const TGeom2MeshValue& aGeom2MeshValue = theValForTime->GetGeom2MeshValue();
+ TGeom2MeshValue::const_iterator anIter = aGeom2MeshValue.begin();
+ for (int aTupleId = 0; anIter != aGeom2MeshValue.end(); anIter++) {
+ EGeometry aEGeom = anIter->first;
+ const TMeshValuePtr aMeshValue = anIter->second;
+
+ vtkIdType aNbElem = aMeshValue->GetNbElem();
+ vtkIdType aNbGauss = aMeshValue->GetNbGauss();
+
+ INITMSG(MYDEBUG,
+ "- aEGeom = "<<aEGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; aNbGauss = "<<aNbGauss<<
+ std::endl);
+
+ for (vtkIdType iElem = 0; iElem < aNbElem; iElem++, aTupleId++) {
+ typename TMeshValue::TCValueSliceArr aValueSliceArr = aMeshValue->GetCompValueSliceArr(iElem);
+
+ // modules of all gauss points
+ TVector<TVTKBasicType> aModules (aNbGauss);
+
+ for (vtkIdType iComp = 0; iComp < aNbComp; iComp++) {
+ const typename TMeshValue::TCValueSlice& aValueSlice = aValueSliceArr[iComp];
+ for (vtkIdType iGauss = 0; iGauss < aNbGauss; iGauss++) {
+ TVTKBasicType aValue = aValueSlice[iGauss];
+
+ // modules of all gauss points
+ if (iComp == 0)
+ aModules[iGauss] = aValue * aValue; // init
+ else
+ aModules[iGauss] += aValue * aValue;
+ }
+ }
+
+ TVTKBasicType aModule = (TVTKBasicType)sqrt((double)aModules[0]);
+ aDataValues[0] = aModule; // init Min
+ aDataValues[1] = aModule; // init Max
+ aDataValues[2] = 0.0; // init Average
+
+ for (vtkIdType ig = 0; ig < aNbGauss; ig++) {
+ aModule = (TVTKBasicType)sqrt((double)aModules[ig]);
+
+ aDataValues[0] = std::min(TVTKBasicType(aModule), aDataValues[0]); // Min
+ aDataValues[1] = std::max(TVTKBasicType(aModule), aDataValues[1]); // Max
+ aDataValues[2] += aModule; // Average
+ }
+ aDataValues[2] /= aNbGauss; // Average
+
+ this->myDataArrayHolder->SetTuple(aTupleId, &aDataValues[0]);
+ }
}
}
};
//----------------------------------------------------------------------------
template<int EDataType>
- void
+ void
InitTimeStampOnProfile(const PUnstructuredGrid& theSource,
- const PFieldImpl& theField,
- const PValForTimeImpl& theValForTime,
- const VISU::TEntity& theEntity)
+ const PFieldImpl& theField,
+ const PValForTimeImpl& theValForTime,
+ const VISU::TEntity& theEntity)
{
vtkIdType aNbTuples = theField->myDataSize / theField->myNbComp;
std::string aFieldName = VISU::GenerateFieldName(theField, theValForTime);
-
+
vtkDataSetAttributes* aDataSetAttributes;
switch ( theEntity ) {
- case VISU::NODE_ENTITY :
+ case VISU::NODE_ENTITY :
aDataSetAttributes = theSource->GetPointData();
break;
- default:
+ default:
aDataSetAttributes = theSource->GetCellData();
}
aDataSetAttributes->AddArray( aFullDataArray );
INITMSG(MYDEBUG,"InitTimeStampOnProfile "<<
- "- theEntity = "<<theEntity<<
- "; aNbTuples = "<<aNbTuples<<
- "; aNbComp = "<<aNbComp<<
- std::endl);
+ "- theEntity = "<<theEntity<<
+ "; aNbTuples = "<<aNbTuples<<
+ "; aNbComp = "<<aNbComp<<
+ std::endl);
TTimerLog aTimerLog(MYDEBUG,"InitTimeStampOnProfile");
-
+
const TGeom2MeshValue& aGeom2MeshValue = theValForTime->GetGeom2MeshValue();
typedef typename TL::TEnum2VTKBasicType< EDataType >::TResult TVTKBasicType;
typedef TTMeshValue< TVTKBasicType > TMeshValue;
TMeshValuePtr aMeshValue = theValForTime->GetFirstMeshValue();
if ( aGeom2MeshValue.size() == 1 && aMeshValue->GetNbGauss() == 1 ) {
aFullDataArray->SetVoidArray(aMeshValue->GetPointer(),
- aMeshValue->size(),
- true);
+ aMeshValue->size(),
+ true);
INITMSG(MYDEBUG,"InitTimeStampOnProfile - aFullDataArray->SetVoidArray()"<<std::endl);
if ( aNbComp == 1 ) {
- aSelectedDataArray->SetVoidArray( aMeshValue->GetPointer(),
- aMeshValue->size(),
- true );
- INITMSG(MYDEBUG,"InitTimeStampOnProfile - aSelectedDataArray->SetVoidArray()"<<std::endl);
+ aSelectedDataArray->SetVoidArray( aMeshValue->GetPointer(),
+ aMeshValue->size(),
+ true );
+ INITMSG(MYDEBUG,"InitTimeStampOnProfile - aSelectedDataArray->SetVoidArray()"<<std::endl);
}else{
- PDataArrayHolder aDataArrayHolder(new TTDataArrayHolder(aSelectedDataArray));
- TTimeStampOnProfileInitArray<EDataType>(aDataArrayHolder).Execute(theField, theValForTime);
+ PDataArrayHolder aDataArrayHolder(new TTDataArrayHolder(aSelectedDataArray));
+ TTimeStampOnProfileInitArray<EDataType>(aDataArrayHolder).Execute(theField, theValForTime);
}
- }else{
+ }
+ else {
typedef TDataArrayHolder2<EDataType> TTDataArrayHolder2;
PDataArrayHolder aDataArrayHolder(new TTDataArrayHolder2(aSelectedDataArray, aFullDataArray));
TTimeStampOnProfileInitArray<EDataType>(aDataArrayHolder).Execute(theField, theValForTime);
+
+ if ( theValForTime->GetMaxNbGauss() > 1 ) { // at least one of geometry contains multiple gauss points
+ TVTKDataArray *aGaussMinDataArray = TVTKDataArray::New();
+ aGaussMinDataArray->SetNumberOfComponents( aNbComp );
+ aGaussMinDataArray->SetNumberOfTuples( aNbTuples );
+ aGaussMinDataArray->SetName( "VISU_FIELD_GAUSS_MIN" );
+ aDataSetAttributes->AddArray( aGaussMinDataArray );
+
+ PDataArrayHolder aGaussMinDataArrayHolder(new TTDataArrayHolder(aGaussMinDataArray));
+ TTimeStampOnProfileInitArray<EDataType>(aGaussMinDataArrayHolder).Execute
+ (theField, theValForTime, VISU::MINIMUM_METRIC);
+ aGaussMinDataArray->Delete();
+
+ TVTKDataArray *aGaussMaxDataArray = TVTKDataArray::New();
+ aGaussMaxDataArray->SetNumberOfComponents( aNbComp );
+ aGaussMaxDataArray->SetNumberOfTuples( aNbTuples );
+ aGaussMaxDataArray->SetName( "VISU_FIELD_GAUSS_MAX" );
+ aDataSetAttributes->AddArray( aGaussMaxDataArray );
+
+ PDataArrayHolder aGaussMaxDataArrayHolder(new TTDataArrayHolder(aGaussMaxDataArray));
+ TTimeStampOnProfileInitArray<EDataType>(aGaussMaxDataArrayHolder).Execute
+ (theField, theValForTime, VISU::MAXIMUM_METRIC);
+ aGaussMaxDataArray->Delete();
+
+ TVTKDataArray *aGaussModulusDataArray = TVTKDataArray::New();
+ aGaussModulusDataArray->SetNumberOfComponents( 3 ); // Min, Max and Average
+ aGaussModulusDataArray->SetNumberOfTuples( aNbTuples );
+ aGaussModulusDataArray->SetName( "VISU_FIELD_GAUSS_MOD" );
+ aDataSetAttributes->AddArray( aGaussModulusDataArray );
+
+ PDataArrayHolder aGaussModulusDataArrayHolder(new TTDataArrayHolder(aGaussModulusDataArray));
+ TTimeStampOnProfileInitModulus<EDataType>(aGaussModulusDataArrayHolder).Execute
+ (theField, theValForTime);
+ aGaussModulusDataArray->Delete();
+ }
}
aSelectedDataArray->Delete();
vtkIdType aEffectNbTuples = 0;
TGeom2MeshValue::const_iterator anIter = aGeom2MeshValue.begin();
for ( ; anIter != aGeom2MeshValue.end(); anIter++ ) {
- const PMeshValue& aMeshValue = anIter->second;
- aEffectNbTuples += aMeshValue->GetNbElem() * aMeshValue->GetNbGauss();
+ const PMeshValue& aMeshValue = anIter->second;
+ aEffectNbTuples += aMeshValue->GetNbElem() * aMeshValue->GetNbGauss();
}
vtkIdType anEffectNbComp = ( aEffectNbTuples * aNbComp ) / aNbTuples + 1;
-
+
// To create corresponding VTK representation for the ELNO data
TSetElnoNodeData< EDataType > aSetElnoNodeData( anEffectNbComp,
- aNbComp,
- aNbTuples,
- "ELNO_FIELD",
- "ELNO_COMPONENT_MAPPER" );
+ aNbComp,
+ aNbTuples,
+ "ELNO_FIELD",
+ "ELNO_COMPONENT_MAPPER" );
std::vector< TVTKBasicType > aDataValues( aNbComp ); // To reserve a temproary value holder
// To initilize these VTK representation for the ELNO data from the MED
anIter = aGeom2MeshValue.begin();
for ( ; anIter != aGeom2MeshValue.end(); anIter++ ) {
- EGeometry aEGeom = anIter->first;
- const TMeshValuePtr aMeshValue = anIter->second;
-
- vtkIdType aNbElem = aMeshValue->GetNbElem();
- vtkIdType aNbGauss = aMeshValue->GetNbGauss();
-
- INITMSG(MYDEBUG,
- "- aEGeom = "<<aEGeom<<
- "; aNbElem = "<<aNbElem<<
- "; aNbGauss = "<<aNbGauss<<
- std::endl);
+ EGeometry aEGeom = anIter->first;
+ const TMeshValuePtr aMeshValue = anIter->second;
+
+ vtkIdType aNbElem = aMeshValue->GetNbElem();
+ vtkIdType aNbGauss = aMeshValue->GetNbGauss();
+
+ INITMSG(MYDEBUG,
+ "- aEGeom = "<<aEGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; aNbGauss = "<<aNbGauss<<
+ std::endl);
std::vector<int> med2visu(aNbGauss);
InitMed2VisuArray(med2visu,aEGeom);
- for ( vtkIdType iElem = 0; iElem < aNbElem; iElem++ ) {
- const typename TMeshValue::TValueSliceArr& aValueSliceArr = aMeshValue->GetGaussValueSliceArr( iElem );
+ for ( vtkIdType iElem = 0; iElem < aNbElem; iElem++ ) {
+ const typename TMeshValue::TValueSliceArr& aValueSliceArr =
+ aMeshValue->GetGaussValueSliceArr( iElem );
for( vtkIdType iGauss = 0; iGauss < aNbGauss; iGauss++ ) {
const typename TMeshValue::TCValueSlice& aValueSlice = aValueSliceArr[ med2visu[iGauss] ];
aDataValues[ iComp ] = aValueSlice[ iComp ];
}
- aSetElnoNodeData.AddNextPointData( &aDataValues[ 0 ] );
+ aSetElnoNodeData.AddNextPointData( &aDataValues[ 0 ] );
}
- aSetElnoNodeData.InsertNextCellData();
- }
+ aSetElnoNodeData.InsertNextCellData();
+ }
}
-
- // Assign the ELNO data on the corresponding VTK data set attribute
+
+ // Assign the ELNO data on the corresponding VTK data set attribute
aSetElnoNodeData.AddData( aDataSetAttributes );
}
//-------------------------------
//----------------------------------------------------------------------------
template<int EDataType>
- void
+ void
InitTimeStampOnGaussMesh(const PPolyData& theSource,
- const PFieldImpl& theField,
- const PValForTimeImpl& theValForTime);
+ const PFieldImpl& theField,
+ const PValForTimeImpl& theValForTime);
- void
+ void
GetTimeStampOnGaussMesh(const PPolyData& theSource,
- const PFieldImpl& theField,
- const PValForTimeImpl& theValForTime)
+ const PFieldImpl& theField,
+ const PValForTimeImpl& theValForTime)
{
vtkIdType aDataType = theField->GetDataType();
switch(aDataType){
break;
default:
EXCEPTION(std::runtime_error,
- "GetTimeStampOnGaussMesh - handling unsupported data type - "<<aDataType);
+ "GetTimeStampOnGaussMesh - handling unsupported data type - "<<aDataType);
}
}
TTimeStampOnGaussMeshInitArray(const PDataArrayHolder& theDataArrayHolder):
myDataArrayHolder(theDataArrayHolder)
{}
-
+
void
Execute(const PFieldImpl& theField,
- const PValForTimeImpl& theValForTime)
+ const PValForTimeImpl& theValForTime)
{
vtkIdType aNbComp = theField->myNbComp;
vtkIdType aSize = std::max(vtkIdType(3), aNbComp);
const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.begin();
for(int aTupleId = 0; anIter != aGeom2GaussSubMesh.end(); anIter++){
- EGeometry aEGeom = anIter->first;
-
- PGaussSubMeshImpl aGaussSubMesh = anIter->second;
- if(!aGaussSubMesh->myIsDone)
- continue;
-
- TGeom2MeshValue::const_iterator anIter2 = aGeom2MeshValue.find(aEGeom);
- if(anIter2 == aGeom2MeshValue.end()){
- EXCEPTION(std::runtime_error,
- "TTimeStampOnGaussMeshInitArray >> Can't find values for corresponding Gauss Points SubMesh");
- }
- TMeshValuePtr aMeshValue = anIter2->second;
- vtkIdType aNbGauss = aMeshValue->GetNbGauss();
- vtkIdType aNbElem = aMeshValue->GetNbElem();
-
- if(aNbGauss < 1)
- continue;
-
- const TPointCoords& aCoords = aGaussSubMesh->myPointCoords;
-
- INITMSG(MYDEBUG,
- "- aEGeom = "<<aEGeom<<
- "; aNbElem = "<<aNbElem<<
- "; aNbGauss = "<<aNbGauss<<
- "; aCoords.GetNbPoints() = "<<aCoords.GetNbPoints()<<
- std::endl);
-
- if(aCoords.GetNbPoints() == aNbElem*aNbGauss){
- for(int iElem = 0; iElem < aNbElem; iElem++){
- typename TMeshValue::TCValueSliceArr aValueSliceArr = aMeshValue->GetGaussValueSliceArr(iElem);
- for(int iGauss = 0; iGauss < aNbGauss; iGauss++, aTupleId++){
- const typename TMeshValue::TCValueSlice& aValueSlice = aValueSliceArr[iGauss];
- for(int iComp = 0; iComp < aNbComp; iComp++){
- aDataValues[iComp] = aValueSlice[iComp];
- }
- this->myDataArrayHolder->SetTuple(aTupleId, &aDataValues[0]);
- }
- }
- }else{
- for(int iElem = 0; iElem < aNbElem; iElem++, aTupleId++){
- typename TMeshValue::TCValueSliceArr aValueSliceArr = aMeshValue->GetCompValueSliceArr(iElem);
- for(int iComp = 0; iComp < aNbComp; iComp++){
- const typename TMeshValue::TCValueSlice& aValueSlice = aValueSliceArr[iComp];
- aDataValues[iComp] = TVTKBasicType();
- for(int iGauss = 0; iGauss < aNbGauss; iGauss++){
- aDataValues[iComp] += aValueSlice[iGauss];
- }
- aDataValues[iComp] /= aNbGauss;
- }
- this->myDataArrayHolder->SetTuple(aTupleId, &aDataValues[0]);
- }
- }
+ EGeometry aEGeom = anIter->first;
+
+ PGaussSubMeshImpl aGaussSubMesh = anIter->second;
+ if(!aGaussSubMesh->myIsDone)
+ continue;
+
+ TGeom2MeshValue::const_iterator anIter2 = aGeom2MeshValue.find(aEGeom);
+ if(anIter2 == aGeom2MeshValue.end()){
+ EXCEPTION(std::runtime_error,
+ "TTimeStampOnGaussMeshInitArray >> Can't find values for corresponding Gauss Points SubMesh");
+ }
+ TMeshValuePtr aMeshValue = anIter2->second;
+ vtkIdType aNbGauss = aMeshValue->GetNbGauss();
+ vtkIdType aNbElem = aMeshValue->GetNbElem();
+
+ if(aNbGauss < 1)
+ continue;
+
+ const TPointCoords& aCoords = aGaussSubMesh->myPointCoords;
+
+ INITMSG(MYDEBUG,
+ "- aEGeom = "<<aEGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; aNbGauss = "<<aNbGauss<<
+ "; aCoords.GetNbPoints() = "<<aCoords.GetNbPoints()<<
+ std::endl);
+
+ if(aCoords.GetNbPoints() == aNbElem*aNbGauss){
+ for(int iElem = 0; iElem < aNbElem; iElem++){
+ typename TMeshValue::TCValueSliceArr aValueSliceArr = aMeshValue->GetGaussValueSliceArr(iElem);
+ for(int iGauss = 0; iGauss < aNbGauss; iGauss++, aTupleId++){
+ const typename TMeshValue::TCValueSlice& aValueSlice = aValueSliceArr[iGauss];
+ for(int iComp = 0; iComp < aNbComp; iComp++){
+ aDataValues[iComp] = aValueSlice[iComp];
+ }
+ this->myDataArrayHolder->SetTuple(aTupleId, &aDataValues[0]);
+ }
+ }
+ }else{
+ for(int iElem = 0; iElem < aNbElem; iElem++, aTupleId++){
+ typename TMeshValue::TCValueSliceArr aValueSliceArr = aMeshValue->GetCompValueSliceArr(iElem);
+ for(int iComp = 0; iComp < aNbComp; iComp++){
+ const typename TMeshValue::TCValueSlice& aValueSlice = aValueSliceArr[iComp];
+ aDataValues[iComp] = TVTKBasicType();
+ for(int iGauss = 0; iGauss < aNbGauss; iGauss++){
+ aDataValues[iComp] += aValueSlice[iGauss];
+ }
+ aDataValues[iComp] /= aNbGauss;
+ }
+ this->myDataArrayHolder->SetTuple(aTupleId, &aDataValues[0]);
+ }
+ }
}
}
};
template<int EDataType>
- void
+ void
InitTimeStampOnGaussMesh(const PPolyData& theSource,
- const PFieldImpl& theField,
- const PValForTimeImpl& theValForTime)
+ const PFieldImpl& theField,
+ const PValForTimeImpl& theValForTime)
{
vtkIdType aNbTuples = theSource->GetNumberOfPoints();
std::string aFieldName = VISU::GenerateFieldName(theField, theValForTime);
aDataSetAttributes->AddArray(aFullDataArray);
INITMSG(MYDEBUG,"InitTimeStampOnGaussMesh "<<
- "- aNbTuples = "<<aNbTuples<<
- "; aNbComp = "<<aNbComp<<
- std::endl);
+ "- aNbTuples = "<<aNbTuples<<
+ "; aNbComp = "<<aNbComp<<
+ std::endl);
TTimerLog aTimerLog(MYDEBUG,"InitTimeStampOnGaussMesh");
-
+
const TGeom2MeshValue& aGeom2MeshValue = theValForTime->GetGeom2MeshValue();
typedef typename TL::TEnum2VTKBasicType<EDataType>::TResult TVTKBasicType;
typedef TTMeshValue<TVTKBasicType> TMeshValue;
TMeshValuePtr aMeshValue = theValForTime->GetFirstMeshValue();
if(aGeom2MeshValue.size() == 1){
aFullDataArray->SetVoidArray(aMeshValue->GetPointer(),
- aMeshValue->size(),
- true);
+ aMeshValue->size(),
+ true);
INITMSG(MYDEBUG,"InitTimeStampOnGaussMesh - aFullDataArray->SetVoidArray()"<<std::endl);
if(aNbComp == 1 || aNbComp == 3){
- aSelectedDataArray->SetVoidArray(aMeshValue->GetPointer(),
- aMeshValue->size(),
- true);
- INITMSG(MYDEBUG,"InitTimeStampOnGaussMesh - aSelectedDataArray->SetVoidArray()"<<std::endl);
+ aSelectedDataArray->SetVoidArray(aMeshValue->GetPointer(),
+ aMeshValue->size(),
+ true);
+ INITMSG(MYDEBUG,"InitTimeStampOnGaussMesh - aSelectedDataArray->SetVoidArray()"<<std::endl);
}else{
- PDataArrayHolder aDataArrayHolder(new TTDataArrayHolder(aSelectedDataArray));
- TTimeStampOnGaussMeshInitArray<EDataType>(aDataArrayHolder).Execute(theField, theValForTime);
+ PDataArrayHolder aDataArrayHolder(new TTDataArrayHolder(aSelectedDataArray));
+ TTimeStampOnGaussMeshInitArray<EDataType>(aDataArrayHolder).Execute(theField, theValForTime);
}
}else{
typedef TDataArrayHolder2<EDataType> TTDataArrayHolder2;
aFullDataArray->Delete();
}
-
+
//----------------------------------------------------------------------------
void InitMed2VisuArray(std::vector<int>& anArray, EGeometry aEGeom){
switch(aEGeom){
-#if !(defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+#if !(defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
case eSEG3:
anArray[0] = 0;
- anArray[2] = 1;
+ anArray[2] = 1;
anArray[1] = 2;
break;
#endif
-#if !(defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+#if !(defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
case eTRIA6:
anArray[0] = 0;
- anArray[2] = 1;
- anArray[4] = 2;
-
+ anArray[2] = 1;
+ anArray[4] = 2;
+
anArray[1] = 3;
- anArray[3] = 4;
+ anArray[3] = 4;
anArray[5] = 5;
break;
#endif
-#if !(defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+#if !(defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
case eQUAD8:
anArray[0] = 0;
- anArray[2] = 1;
- anArray[4] = 2;
- anArray[6] = 3;
-
+ anArray[2] = 1;
+ anArray[4] = 2;
+ anArray[6] = 3;
+
anArray[1] = 4;
- anArray[3] = 5;
- anArray[5] = 6;
+ anArray[3] = 5;
+ anArray[5] = 6;
anArray[7] = 7;
break;
+#endif
+#if !(defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+ case eQUAD9:
+ anArray[0] = 0;
+ anArray[2] = 1;
+ anArray[4] = 2;
+ anArray[6] = 3;
+
+ anArray[1] = 4;
+ anArray[3] = 5;
+ anArray[5] = 6;
+ anArray[7] = 7;
+ anArray[8] = 8;
+ break;
#endif
case eTETRA4:
anArray[0] = 0;
anArray[1] = 2;
- anArray[2] = 1;
+ anArray[2] = 1;
anArray[3] = 3;
break;
case ePYRA5:
anArray[0] = 0;
- anArray[1] = 3;
+ anArray[1] = 3;
anArray[2] = 2;
- anArray[3] = 1;
+ anArray[3] = 1;
anArray[4] = 4;
break;
-#if (defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+#if (defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
case eTETRA10:
anArray[0] = 0;
anArray[1] = 2;
- anArray[2] = 1;
- anArray[3] = 3;
-
+ anArray[2] = 1;
+ anArray[3] = 3;
+
anArray[4] = 6;
anArray[5] = 5;
- anArray[6] = 4;
-
- anArray[7] = 7;
- anArray[8] = 9;
+ anArray[6] = 4;
+
+ anArray[7] = 7;
+ anArray[8] = 9;
anArray[9] = 8;
break;
#endif
-#if (defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+#if (defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
case ePYRA13:
anArray[0] = 0;
anArray[1] = 3;
- anArray[2] = 2;
- anArray[3] = 1;
+ anArray[2] = 2;
+ anArray[3] = 1;
anArray[4] = 4;
-
+
anArray[5] = 8;
- anArray[6] = 7;
- anArray[7] = 6;
- anArray[8] = 5;
-
- anArray[9] = 9;
- anArray[10] = 12;
- anArray[11] = 11;
- anArray[12] = 10;
+ anArray[6] = 7;
+ anArray[7] = 6;
+ anArray[8] = 5;
+
+ anArray[9] = 9;
+ anArray[10] = 12;
+ anArray[11] = 11;
+ anArray[12] = 10;
+ break;
+#endif
+#if (defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+ case eHEXA27:
+ anArray[0] = 0;
+ anArray[1] = 3;
+ anArray[2] = 2;
+ anArray[3] = 1;
+
+ anArray[4] = 4;
+ anArray[5] = 7;
+ anArray[6] = 6;
+ anArray[7] = 5;
+
+ anArray[8] = 11;
+ anArray[9] = 10;
+ anArray[10] = 9;
+ anArray[11] = 8;
+
+ anArray[12] = 15;
+ anArray[13] = 14;
+ anArray[14] = 13;
+ anArray[15] = 12;
+
+ anArray[16] = 16;
+ anArray[17] = 19;
+ anArray[18] = 18;
+ anArray[19] = 17;
+
+ anArray[20] = 21;
+ anArray[21] = 23;
+ anArray[22] = 24;
+ anArray[23] = 22;
+
+ anArray[24] = 20;
+ anArray[25] = 25;
+ anArray[26] = 26;
break;
#endif
default:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU CONVERTOR :
// File : VISU_Convertor.hxx
// Author : Alexey PETROV
//! To intitilize the data strucutre
void
Init(vtkIdType theNbElem,
- vtkIdType theNbGauss,
- vtkIdType theNbComp);
+ vtkIdType theNbGauss,
+ vtkIdType theNbComp);
//! Gets memory size used by the instance (bytes).
virtual
TCValueSliceArr aValueSliceArr(this->myNbGauss);
vtkIdType anId = theElemId * this->myStep;
for(vtkIdType aGaussId = 0; aGaussId < this->myNbGauss; aGaussId++){
- aValueSliceArr[aGaussId] =
- TCValueSlice(this->GetPointer(),
- this->size(),
- std::slice(anId, this->myNbComp, 1));
- anId += this->myNbComp;
+ aValueSliceArr[aGaussId] =
+ TCValueSlice(this->GetPointer(),
+ this->size(),
+ std::slice(anId, this->myNbComp, 1));
+ anId += this->myNbComp;
}
return aValueSliceArr;
}
TValueSliceArr aValueSliceArr(this->myNbGauss);
vtkIdType anId = theElemId * this->myStep;
for(vtkIdType aGaussId = 0; aGaussId < this->myNbGauss; aGaussId++){
- aValueSliceArr[aGaussId] =
- TValueSlice(this->GetPointer(),
- this->size(),
- std::slice(anId, this->myNbComp, 1));
- anId += this->myNbComp;
+ aValueSliceArr[aGaussId] =
+ TValueSlice(this->GetPointer(),
+ this->size(),
+ std::slice(anId, this->myNbComp, 1));
+ anId += this->myNbComp;
}
return aValueSliceArr;
}
TCValueSliceArr aValueSliceArr(this->myNbComp);
vtkIdType anId = theElemId * this->myStep;
for(vtkIdType aCompId = 0; aCompId < this->myNbComp; aCompId++){
- aValueSliceArr[aCompId] =
- TCValueSlice(this->GetPointer(),
- this->size(),
- std::slice(anId, this->myNbGauss, this->myNbComp));
- anId += 1;
+ aValueSliceArr[aCompId] =
+ TCValueSlice(this->GetPointer(),
+ this->size(),
+ std::slice(anId, this->myNbGauss, this->myNbComp));
+ anId += 1;
}
return aValueSliceArr;
}
TValueSliceArr aValueSliceArr(this->myNbComp);
vtkIdType anId = theElemId * this->myStep;
for(vtkIdType aCompId = 0; aCompId < this->myNbComp; aCompId++){
- aValueSliceArr[aCompId] =
- TValueSlice(this->GetPointer(),
- this->size(),
- std::slice(anId, this->myNbGauss, this->myNbComp));
- anId += 1;
+ aValueSliceArr[aCompId] =
+ TValueSlice(this->GetPointer(),
+ this->size(),
+ std::slice(anId, this->myNbGauss, this->myNbComp));
+ anId += 1;
}
return aValueSliceArr;
}
//! To initilize the class instance
void
Init(vtkIdType theNbElem,
- vtkIdType theNbGauss,
- vtkIdType theNbComp,
- const TContainerType& theContainer)
+ vtkIdType theNbGauss,
+ vtkIdType theNbComp,
+ const TContainerType& theContainer)
{
TMeshValueBase::Init(theNbElem, theNbGauss, theNbComp);
myContainer = theContainer;
// Initilize corresponding vtkDataSetAttributes for TValForTime
void
GetTimeStampOnProfile(const PUnstructuredGrid& theSource,
- const PFieldImpl& theField,
- const PValForTimeImpl& theValForTime,
- const VISU::TEntity& theEntity);
+ const PFieldImpl& theField,
+ const PValForTimeImpl& theValForTime,
+ const VISU::TEntity& theEntity);
//---------------------------------------------------------------
// Initilize corresponding vtkDataSetAttributes for TValForTime
void
GetTimeStampOnGaussMesh(const PPolyData& theSource,
- const PFieldImpl& theField,
- const PValForTimeImpl& theValForTime);
+ const PFieldImpl& theField,
+ const PValForTimeImpl& theValForTime);
void
InitMed2VisuArray(std::vector<int>& anArray, EGeometry aEGeom);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File:
// Author:
void
TCoordHolderBase
::Init(vtkIdType theNbPoints,
- vtkIdType theDim)
+ vtkIdType theDim)
{
myDim = theDim;
myNbPoints = theNbPoints;
vtkIdType aDim = GetDim();
INITMSG(MYDEBUG,"TPointCoords::GetPoints - aNbPoints = "<<aNbPoints<<
- "; aDim = "<<aDim<<
- endl);
+ "; aDim = "<<aDim<<
+ endl);
if(GetDim() == 3){
- INITMSG(MYDEBUG,"TPointCoords::GetPoints - SetVoidArray()"<<endl);
- SetVoidArray();
+ INITMSG(MYDEBUG,"TPointCoords::GetPoints - SetVoidArray()"<<endl);
+ SetVoidArray();
}else{
- vtkPoints* aPoints = myPointSet->GetPoints();
- for(vtkIdType aPointId = 0; aPointId < aNbPoints; aPointId++){
- TCCoordSlice aSlice = GetCoordSlice(aPointId);
+ vtkPoints* aPoints = myPointSet->GetPoints();
+ for(vtkIdType aPointId = 0; aPointId < aNbPoints; aPointId++){
+ TCCoordSlice aSlice = GetCoordSlice(aPointId);
- vtkFloatingPointType aCoords[3] = {0.0, 0.0, 0.0};
- for(vtkIdType aDimId = 0; aDimId < aDim; aDimId++)
- aCoords[aDimId] = aSlice[aDimId];
+ vtkFloatingPointType aCoords[3] = {0.0, 0.0, 0.0};
+ for(vtkIdType aDimId = 0; aDimId < aDim; aDimId++)
+ aCoords[aDimId] = aSlice[aDimId];
- aPoints->SetPoint(aPointId, aCoords);
- }
+ aPoints->SetPoint(aPointId, aCoords);
+ }
}
myIsVTKDone = true;
VISU::TCoord
GetCoord(VISU::TCCoordSlice& theCoordSlice,
- int theCoordId)
+ int theCoordId)
{
return (*myGetCoord[theCoordId])(theCoordSlice);
}
// 1D - always along X
// 2D - always in XOY plane
anIsDimPresent[iDim] = iDim < GetDim();
-// std::string aName = GetName(iDim);
-// if ( aName.size() > 1 ) // PAL13021 (PAL12148), aName has size 8 or 16
-// aName = aName.substr(0,1);
-// if(aName == "x" || aName == "X")
-// anIsDimPresent[eX] = true;
-// else if(aName == "y" || aName == "Y")
-// anIsDimPresent[eY] = true;
-// else if(aName == "z" || aName == "Z")
-// anIsDimPresent[eZ] = true;
+// std::string aName = GetName(iDim);
+// if ( aName.size() > 1 ) // PAL13021 (PAL12148), aName has size 8 or 16
+// aName = aName.substr(0,1);
+// if(aName == "x" || aName == "X")
+// anIsDimPresent[eX] = true;
+// else if(aName == "y" || aName == "Y")
+// anIsDimPresent[eY] = true;
+// else if(aName == "z" || aName == "Z")
+// anIsDimPresent[eZ] = true;
}
switch(GetDim()){
case 3:
- aCoordHelperPtr.reset(new TCoordHelper(aXYZGetCoord));
- break;
+ aCoordHelperPtr.reset(new TCoordHelper(aXYZGetCoord));
+ break;
case 2:
- if(anIsDimPresent[eY] && anIsDimPresent[eZ])
- aCoordHelperPtr.reset(new TCoordHelper(aYZGetCoord));
- else if(anIsDimPresent[eX] && anIsDimPresent[eZ])
- aCoordHelperPtr.reset(new TCoordHelper(aXZGetCoord));
- else
- aCoordHelperPtr.reset(new TCoordHelper(aXYGetCoord));
- break;
+ if(anIsDimPresent[eY] && anIsDimPresent[eZ])
+ aCoordHelperPtr.reset(new TCoordHelper(aYZGetCoord));
+ else if(anIsDimPresent[eX] && anIsDimPresent[eZ])
+ aCoordHelperPtr.reset(new TCoordHelper(aXZGetCoord));
+ else
+ aCoordHelperPtr.reset(new TCoordHelper(aXYGetCoord));
+ break;
case 1:
- if(anIsDimPresent[eY])
- aCoordHelperPtr.reset(new TCoordHelper(aYGetCoord));
- else if(anIsDimPresent[eZ])
- aCoordHelperPtr.reset(new TCoordHelper(aZGetCoord));
- else
- aCoordHelperPtr.reset(new TCoordHelper(aXGetCoord));
- break;
+ if(anIsDimPresent[eY])
+ aCoordHelperPtr.reset(new TCoordHelper(aYGetCoord));
+ else if(anIsDimPresent[eZ])
+ aCoordHelperPtr.reset(new TCoordHelper(aZGetCoord));
+ else
+ aCoordHelperPtr.reset(new TCoordHelper(aXGetCoord));
+ break;
}
INITMSG(MYDEBUG,"TNamedPointCoords::GetPoints - aNbPoints = "<<GetNbPoints()<<
- "; aDim = "<<GetDim()<<
- endl);
+ "; aDim = "<<GetDim()<<
+ endl);
if(anIsDimPresent[eX] && anIsDimPresent[eY] && anIsDimPresent[eZ]){
- INITMSG(MYDEBUG,"TNamedPointCoords::GetPoints - SetVoidArray()"<<endl);
- SetVoidArray();
+ INITMSG(MYDEBUG,"TNamedPointCoords::GetPoints - SetVoidArray()"<<endl);
+ SetVoidArray();
}else{
- vtkPoints* aPoints = myPointSet->GetPoints();
- for(vtkIdType aNodeId = 0; aNodeId < GetNbPoints(); aNodeId++){
- TCCoordSlice aCoordSlice = GetCoordSlice(aNodeId);
- aPoints->SetPoint(aNodeId,
- aCoordHelperPtr->GetCoord(aCoordSlice,eX),
- aCoordHelperPtr->GetCoord(aCoordSlice,eY),
- aCoordHelperPtr->GetCoord(aCoordSlice,eZ));
- }
+ vtkPoints* aPoints = myPointSet->GetPoints();
+ for(vtkIdType aNodeId = 0; aNodeId < GetNbPoints(); aNodeId++){
+ TCCoordSlice aCoordSlice = GetCoordSlice(aNodeId);
+ aPoints->SetPoint(aNodeId,
+ aCoordHelperPtr->GetCoord(aCoordSlice,eX),
+ aCoordHelperPtr->GetCoord(aCoordSlice,eY),
+ aCoordHelperPtr->GetCoord(aCoordSlice,eZ));
+ }
}
{
- vtkIdType aNbTuples = GetNbPoints();
- int anEntity = int(VISU::NODE_ENTITY);
- vtkIntArray *aDataArray = vtkIntArray::New();
- aDataArray->SetName("VISU_POINTS_MAPPER");
- aDataArray->SetNumberOfComponents(2);
- aDataArray->SetNumberOfTuples(aNbTuples);
- int *aPtr = aDataArray->GetPointer(0);
- for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
- vtkIdType anObjID = GetObjID(aTupleId);
- *aPtr++ = anObjID;
- *aPtr++ = anEntity;
- }
- myPointSet->GetPointData()->AddArray(aDataArray);
- aDataArray->Delete();
+ vtkIdType aNbTuples = GetNbPoints();
+ int anEntity = int(VISU::NODE_ENTITY);
+ vtkIntArray *aDataArray = vtkIntArray::New();
+ aDataArray->SetName("VISU_POINTS_MAPPER");
+ aDataArray->SetNumberOfComponents(2);
+ aDataArray->SetNumberOfTuples(aNbTuples);
+ int *aPtr = aDataArray->GetPointer(0);
+ for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
+ vtkIdType anObjID = GetObjID(aTupleId);
+ *aPtr++ = anObjID;
+ *aPtr++ = anEntity;
+ }
+ myPointSet->GetPointData()->AddArray(aDataArray);
+ aDataArray->Delete();
}
myIsVTKDone = true;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU CONVERTOR :
// File : VISU_Convertor.hxx
// Author : Alexey PETROV
//! To initilize the instance
void
Init(vtkIdType theNbPoints,
- vtkIdType theDim);
+ vtkIdType theDim);
vtkIdType
GetNbPoints() const;
//! To initilize the class instance
void
Init(vtkIdType theNbPoints,
- vtkIdType theDim,
- const TContainerType& theCoord)
+ vtkIdType theDim,
+ const TContainerType& theCoord)
{
TCoordHolderBase::Init(theNbPoints, theDim);
myCoord = theCoord;
GetCoordSlice(vtkIdType theNodeId) const
{
return TCCoordSlice(this->GetPointer(),
- this->size(),
- std::slice(theNodeId * this->GetDim(), this->GetDim(), 1));
+ this->size(),
+ std::slice(theNodeId * this->GetDim(), this->GetDim(), 1));
}
//! Get slice of coordinates for defined node
GetCoordSlice(vtkIdType theNodeId)
{
return TCoordSlice(this->GetPointer(),
- this->size(),
- std::slice(theNodeId * this->GetDim(), this->GetDim(), 1));
+ this->size(),
+ std::slice(theNodeId * this->GetDim(), this->GetDim(), 1));
}
virtual
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File:
// Author: Alexey PETROV
// Module : VISU
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File :
// Author : Alexey PETROV
// Module : VISU
typedef std::map<TName, PFamily> TFamilyMap;
typedef std::map<TName, PField> TFieldMap;
+ typedef std::map<vtkIdType, PFamily> TFamilyIDMap;
+
//! Define a basic class which corresponds to MED ENTITY
/*!
This class in its turn contains map of TGaussMesh and TProfile substructures,
TProfileMap myProfileMap; //!< Contains map of Profile mesh which exist on it
TFamilyMap myFamilyMap; //!< Contains map of MED FAMILIES which belongs to it
+ TFamilyIDMap myFamilyIDMap; //!< Contains map of MED FAMILIES which belongs to it
+
TFieldMap myFieldMap; //!< Contains map of MED FIELDS which belongs to it
TName myMeshName; //!< Contains name of the MED MESH where the it belongs to.
//---------------------------------------------------------------
//! Define a basic class for MED FAMILY entity
struct VISU_CONVERTOR_EXPORT TFamily: virtual TIntId,
- virtual TUnstructuredGridIDMapper
+ virtual TUnstructuredGridIDMapper
{
TEntity myEntity; //!< Referes to MED ENTITY where the TFamily belongs to.
TName myName; //!< Contains name of the corresponding MED FAMILY
bool VISU_CONVERTOR_EXPORT
operator<(const PFamily& theLeft, const PFamily& theRight);
- typedef std::set<PFamily> TFamilySet;
+ typedef std::pair<TEntity, PFamily> TEnity2Family;
+ typedef std::set<TEnity2Family> TFamilySet;
//! Define a basic class for MED GROUP entity
struct VISU_CONVERTOR_EXPORT TGroup: virtual TUnstructuredGridIDMapper
*/
virtual
TMinMax
- GetMinMax(vtkIdType theCompID) = 0;
+ GetMinMax(vtkIdType theCompID,
+ const TNames& theGroupNames,
+ TGaussMetric theGaussMetric = VISU::AVERAGE_METRIC) = 0;
//! Calculate average min/max values for each of the MED FIELD components among all its timestamps
virtual
TMinMax
- GetAverageMinMax(vtkIdType theCompID) = 0;
-
+ GetAverageMinMax(vtkIdType theCompID,
+ const TNames& theGroupNames,
+ TGaussMetric theGaussMetric = VISU::AVERAGE_METRIC) = 0;
+
bool myIsMinMaxInitilized; //!< Is the min / max values are calculated
TField();
PProfile myProfile; //!< Contains corresponding MED PROFILE where the MED TIEMSTMAP attached to
PGaussMesh myGaussMesh;
+
+ //! Get maximum number of Gauss Points among all geometrical types (provided for convenience)
+ virtual
+ int
+ GetMaxNbGauss() const = 0;
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File:
+
+// File:
// Author: Alexey PETROV
// Module : VISU
//
{
/* vtkIdType
VISUGeom2NbNodes(EGeometry theGeom)
- {
+ {
switch(theGeom){
#ifndef VISU_ENABLE_QUADRATIC
- case VISU::eSEG3:
+ case VISU::eSEG3:
return 2;
- case VISU::eTRIA6:
+ case VISU::eTRIA6:
return 3;
- case VISU::eQUAD8:
+ case VISU::eQUAD8:
return 4;
- case VISU::eTETRA10:
+ case VISU::eTETRA10:
return 4;
- case VISU::eHEXA20:
+ case VISU::eHEXA20:
return 8;
- case VISU::ePENTA15:
+ case VISU::ePENTA15:
return 6;
- case VISU::ePYRA13:
+ case VISU::ePYRA13:
return 5;
#endif
- case VISU::ePOLYGONE:
- case VISU::ePOLYEDRE:
+ case VISU::ePOLYGONE:
+ case VISU::ePOLYEDRE:
return -1;
default:
return theGeom % 100;
vtkIdType
VISUGeom2VTK(EGeometry theGeom)
- {
+ {
switch(theGeom){
- case VISU::ePOINT1:
+ case VISU::ePOINT1:
return VTK_VERTEX;
- case VISU::eSEG2:
+ case VISU::eSEG2:
return VTK_LINE;
- case VISU::eTRIA3:
+ case VISU::eTRIA3:
return VTK_TRIANGLE;
- case VISU::eQUAD4:
+ case VISU::eQUAD4:
return VTK_QUAD;
- case VISU::eTETRA4:
+ case VISU::eTETRA4:
return VTK_TETRA;
- case VISU::eHEXA8:
+ case VISU::eHEXA8:
return VTK_HEXAHEDRON;
- case VISU::ePENTA6:
+ case VISU::ePENTA6:
return VTK_WEDGE;
- case VISU::ePYRA5:
+ case VISU::ePYRA5:
return VTK_PYRAMID;
- case VISU::ePOLYGONE:
+ case VISU::ePOLYGONE:
return VTK_POLYGON;
- case VISU::ePOLYEDRE:
+ case VISU::ePOLYEDRE:
return VTK_CONVEX_POINT_SET;
#ifndef VISU_ENABLE_QUADRATIC
- case VISU::eSEG3:
+ case VISU::eSEG3:
return VTK_LINE;
- case VISU::eTRIA6:
+ case VISU::eTRIA6:
return VTK_TRIANGLE;
- case VISU::eQUAD8:
+ case VISU::eQUAD8:
return VTK_QUAD;
- case VISU::eTETRA10:
+ case VISU::eTETRA10:
return VTK_TETRA;
- case VISU::eHEXA20:
+ case VISU::eHEXA20:
return VTK_HEXAHEDRON;
- case VISU::ePENTA15:
+ case VISU::ePENTA15:
return VTK_WEDGE;
- case VISU::ePYRA13:
+ case VISU::ePYRA13:
return VTK_PYRAMID;
#else
- case VISU::eSEG3:
+ case VISU::eSEG3:
#if defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_EDGE;
#else
return VTK_POLY_LINE;
#endif
- case VISU::eTRIA6:
+ case VISU::eTRIA6:
#if defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_TRIANGLE;
#else
return VTK_POLYGON;
#endif
- case VISU::eQUAD8:
+ case VISU::eQUAD8:
#if defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_QUAD;
#else
return VTK_POLYGON;
#endif
- case VISU::eTETRA10:
+ case VISU::eTETRA10:
#if defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_TETRA;
#else
return VTK_CONVEX_POINT_SET;
#endif
- case VISU::eHEXA20:
+ case VISU::eHEXA20:
#if defined(VTK_QUADRATIC_HEXAHEDRON) && defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_HEXAHEDRON;
#else
return VTK_CONVEX_POINT_SET;
#endif
- case VISU::ePENTA15:
+ case VISU::ePENTA15:
#if defined(VTK_QUADRATIC_WEDGE) && defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_WEDGE;
#else
return VTK_CONVEX_POINT_SET;
#endif
- case VISU::ePYRA13:
+ case VISU::ePYRA13:
#if defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_PYRAMID;
#else
EGeometry
VTKGeom2VISU(vtkIdType theGeom)
- {
+ {
switch(theGeom){
- case VTK_VERTEX:
+ case VTK_VERTEX:
return VISU::ePOINT1;
- case VTK_LINE:
+ case VTK_LINE:
return VISU::eSEG2;
- case VTK_TRIANGLE:
+ case VTK_TRIANGLE:
return VISU::eTRIA3;
- case VTK_QUAD:
+ case VTK_QUAD:
return VISU::eQUAD4;
- case VTK_TETRA:
+ case VTK_TETRA:
return VISU::eTETRA4;
- case VTK_HEXAHEDRON:
+ case VTK_HEXAHEDRON:
return VISU::eHEXA8;
- case VTK_WEDGE:
+ case VTK_WEDGE:
return VISU::ePENTA6;
- case VTK_PYRAMID:
+ case VTK_PYRAMID:
return VISU::ePYRA5;
+ case VTK_HEXAGONAL_PRISM:
+ return VISU::eOCTA12;
- case VTK_POLYGON:
+
+ case VTK_POLYGON:
return VISU::ePOLYGONE;
- case VTK_CONVEX_POINT_SET:
+ case VTK_CONVEX_POINT_SET:
return VISU::ePOLYEDRE;
#if defined(VISU_ENABLE_QUADRATIC) && defined(VISU_USE_VTK_QUADRATIC)
- #if defined(VTK_QUADRATIC_EDGE)
- case VTK_QUADRATIC_EDGE:
+
+ case VTK_QUADRATIC_EDGE:
return VISU::eSEG3;
- #endif
- #if defined(VTK_QUADRATIC_TRIANGLE)
- case VTK_QUADRATIC_TRIANGLE:
+ case VTK_QUADRATIC_TRIANGLE:
return VISU::eTRIA6;
- #endif
- #if defined(VTK_QUADRATIC_QUAD)
- case VTK_QUADRATIC_QUAD:
+ case VTK_QUADRATIC_QUAD:
return VISU::eQUAD8;
- #endif
- #if defined(VTK_QUADRATIC_TETRA)
- case VTK_QUADRATIC_TETRA:
+ case VTK_BIQUADRATIC_QUAD:
+ return VISU::eQUAD9;
+
+ case VTK_QUADRATIC_TETRA:
return VISU::eTETRA10;
- #endif
- #if defined(VTK_QUADRATIC_HEXAHEDRON)
- case VTK_QUADRATIC_HEXAHEDRON:
+ case VTK_QUADRATIC_HEXAHEDRON:
return VISU::eHEXA20;
- #endif
- #if defined(VTK_QUADRATIC_WEDGE)
- case VTK_QUADRATIC_WEDGE:
+ case VTK_TRIQUADRATIC_HEXAHEDRON:
+ return VISU::eHEXA27;
+
+ case VTK_QUADRATIC_WEDGE:
return VISU::ePENTA15;
- #endif
- #if defined(VTK_QUADRATIC_PYRAMID)
- case VTK_QUADRATIC_PYRAMID:
+ case VTK_QUADRATIC_PYRAMID:
return VISU::ePYRA13;
- #endif
-
+
#endif //VISU_ENABLE_QUADRATIC
default:
*/
size_t
GetDataSetSize(size_t theNbOfPoints,
- size_t theNbOfCells,
- size_t theCellsSize,
- bool theComputeLinks)
+ size_t theNbOfCells,
+ size_t theCellsSize,
+ bool theComputeLinks)
{
size_t aPointsSize = 3*theNbOfPoints*sizeof(VISU::TCoord);
size_t aConnectivityAndTypesSize = theCellsSize*sizeof(vtkIdType);
::TPolyDataHolder()
{}
- const PPolyData&
+ const PPolyData&
TPolyDataHolder
::GetSource() const
{
return mySource;
}
- vtkPolyData*
+ vtkPolyData*
TPolyDataHolder
::GetPolyDataOutput()
{
::TUnstructuredGridHolder()
{}
- const PUnstructuredGrid&
+ const PUnstructuredGrid&
TUnstructuredGridHolder
::GetSource() const
{
return mySource;
}
- vtkUnstructuredGrid*
+ vtkUnstructuredGrid*
TUnstructuredGridHolder
::GetUnstructuredGridOutput()
{
{
if(myIsVTKDone){
if(vtkDataSet* anOutput = GetOutput()){
- anOutput->Update();
- return anOutput->GetActualMemorySize() * 1024;
+ anOutput->Update();
+ return anOutput->GetActualMemorySize() * 1024;
}
}
throw std::runtime_error("TMemoryCheckIDMapper::GetMemorySize - myIsVTKDone == false !!!");
::TAppendFilterHolder()
{}
- const PAppendFilter&
+ const PAppendFilter&
TAppendFilterHolder
::GetFilter() const
{
return myFilter;
}
- vtkUnstructuredGrid*
+ vtkUnstructuredGrid*
TAppendFilterHolder
::GetUnstructuredGridOutput()
{
::TAppendPolyDataHolder()
{}
- const PAppendPolyData&
+ const PAppendPolyData&
TAppendPolyDataHolder
::GetFilter() const
{
return myFilter;
}
- vtkPolyData*
+ vtkPolyData*
TAppendPolyDataHolder
::GetPolyDataOutput()
{
::TMergeFilterHolder()
{}
- const PMergeFilter&
+ const PMergeFilter&
TMergeFilterHolder
::GetFilter() const
{
return myFilter;
}
- vtkDataSet*
+ vtkDataSet*
TMergeFilterHolder
::GetOutput()
{
//---------------------------------------------------------------
TMeshImpl
- ::TMeshImpl():
+ ::TMeshImpl():
myNbPoints(0)
{}
{
return myNbPoints;
}
-
+
vtkIdType
TMeshImpl::
GetDim() const
{
return myDim;
}
-
+
vtkPointSet*
TMeshImpl::
GetPointSet()
{
if ( !mySubMeshID.empty() )
return mySubMeshID[theID];
-
+
return theID;
}
::GetElemVTKID(vtkIdType theID) const
{
if ( !mySubMeshID.empty() )
- for ( size_t anId = 0; anId < mySubMeshID.size(); anId++ )
- if ( mySubMeshID[ anId ] == theID )
- return anId;
+ for ( size_t anId = 0; anId < mySubMeshID.size(); anId++ )
+ if ( mySubMeshID[ anId ] == theID )
+ return anId;
return theID;
}
return aSize;
}
-
+ bool
+ TSubProfileImpl
+ ::isDefault() const
+ {
+ return strcmp(myName.c_str(),"") == 0;
+ }
+
//---------------------------------------------------------------
bool
operator<(const PSubProfile& theLeft, const PSubProfile& theRight)
{
return myNamedPointCoords->GetObjID(theID);
}
-
+
vtkIdType
TProfileImpl
::GetNodeVTKID(vtkIdType theID) const
return myNamedPointCoords->GetVTKID(theID);
}
- vtkFloatingPointType*
+ vtkFloatingPointType*
TProfileImpl
::GetNodeCoord(vtkIdType theObjID)
{
return VISU::GetElemVTKID(GetFilter()->GetOutput(), theID);
}
- vtkCell*
+ vtkCell*
TProfileImpl
::GetElemCell(vtkIdType theObjID)
{
vtkIdType aVtkID = GetElemVTKID(theObjID);
return GetFilter()->GetOutput()->GetCell(aVtkID);
}
-
- vtkUnstructuredGrid*
+
+ vtkUnstructuredGrid*
TProfileImpl
::GetUnstructuredGridOutput()
{
return aSize;
}
- std::string
+ std::string
TProfileImpl
::GetNodeName(vtkIdType theObjID) const
{
return myNamedPointCoords->GetNodeName(theObjID);
}
- std::string
+ std::string
TProfileImpl
::GetElemName(vtkIdType theObjID) const
{
{
return myIDMapper->GetNodeObjID(theID);
}
-
+
vtkIdType
TUnstructuredGridIDMapperImpl
::GetNodeVTKID(vtkIdType theID) const
return myIDMapper->GetNodeVTKID(theID);
}
- vtkFloatingPointType*
+ vtkFloatingPointType*
TUnstructuredGridIDMapperImpl
::GetNodeCoord(vtkIdType theObjID)
{
return myIDMapper->GetElemVTKID(theID);
}
- vtkCell*
+ vtkCell*
TUnstructuredGridIDMapperImpl
::GetElemCell(vtkIdType theObjID)
{
return myIDMapper->GetElemCell(theObjID);
}
-
- void
+
+ void
TUnstructuredGridIDMapperImpl
::SetReferencedMesh( const PNamedIDMapper& theNamedIDMapper )
{
myCommonCellsFilter->SetCellsUG( theNamedIDMapper->GetUnstructuredGridOutput() );
}
- void
+ void
TUnstructuredGridIDMapperImpl
::Build()
{
aFilter->SetScalars( aDataSet );
aFilter->SetVectors( aDataSet );
aFilter->AddField( "VISU_FIELD", aDataSet );
+ aFilter->AddField( "VISU_FIELD_GAUSS_MIN", aDataSet );
+ aFilter->AddField( "VISU_FIELD_GAUSS_MAX", aDataSet );
+ aFilter->AddField( "VISU_FIELD_GAUSS_MOD", aDataSet );
aFilter->AddField( "VISU_CELLS_MAPPER", aDataSet );
aFilter->AddField( "ELNO_FIELD", aDataSet );
aFilter->AddField( "ELNO_COMPONENT_MAPPER", aDataSet );
aFilter->AddField( "VISU_POINTS_MAPPER", aDataSet );
-
+
myCommonCellsFilter->SetProfileUG( aFilter->GetUnstructuredGridOutput() );
- }
+ }
}
- vtkUnstructuredGrid*
+ vtkUnstructuredGrid*
TUnstructuredGridIDMapperImpl
::GetUnstructuredGridOutput()
{
return myCommonCellsFilter->GetOutput();
}
- vtkDataSet*
+ vtkDataSet*
TUnstructuredGridIDMapperImpl
::GetOutput()
{
return GetUnstructuredGridOutput();
}
- PUnstructuredGrid
+ PUnstructuredGrid
TUnstructuredGridIDMapperImpl
::GetSource()
{
{
return myIDMapper->GetNodeObjID(theID);
}
-
+
vtkIdType
TPolyDataIDMapperImpl
::GetNodeVTKID(vtkIdType theID) const
return myIDMapper->GetNodeVTKID(theID);
}
- vtkFloatingPointType*
+ vtkFloatingPointType*
TPolyDataIDMapperImpl
::GetNodeCoord(vtkIdType theObjID)
{
return myIDMapper->GetElemVTKID(theID);
}
- vtkCell*
+ vtkCell*
TPolyDataIDMapperImpl
::GetElemCell(vtkIdType theObjID)
{
return myIDMapper->GetElemCell(theObjID);
}
-
- void
+
+ void
TPolyDataIDMapperImpl
::Build()
{
if ( !myFilter.GetPointer() ) {
const PAppendPolyData& anAppendFilter = myIDMapper->GetFilter();
vtkPolyData* aGeometry = anAppendFilter->GetOutput();
-
+
const PPolyData& aSource = mySource.GetSource();
vtkPolyData* aDataSet = aSource.GetPointer();
aDataSet->ShallowCopy( aGeometry );
-
+
const PMergeFilter& aFilter = GetFilter();
aFilter->SetGeometry( aGeometry );
aFilter->SetScalars( aDataSet );
aFilter->SetVectors( aDataSet );
aFilter->AddField( "VISU_FIELD", aDataSet );
+ aFilter->AddField( "VISU_FIELD_GAUSS_MIN", aDataSet );
+ aFilter->AddField( "VISU_FIELD_GAUSS_MAX", aDataSet );
+ aFilter->AddField( "VISU_FIELD_GAUSS_MOD", aDataSet );
aFilter->AddField( "VISU_CELLS_MAPPER", aDataSet );
aFilter->AddField( "VISU_POINTS_MAPPER", aDataSet );
}
}
- vtkPolyData*
+ vtkPolyData*
TPolyDataIDMapperImpl
::GetPolyDataOutput()
{
return myFilter->GetPolyDataOutput();
}
- vtkDataSet*
+ vtkDataSet*
TPolyDataIDMapperImpl
::GetOutput()
{
return GetPolyDataOutput();
}
- PPolyData
+ PPolyData
TPolyDataIDMapperImpl
::GetSource()
{
myGeom(EGeometry(-1)),
myNbPoints(0)
{}
-
+
void
TGaussImpl
::LessThan(const PGaussImpl& theGauss,
- bool& theResult) const
+ bool& theResult) const
{
theResult = false;
}
myStatus(eNone),
myStartID(0)
{}
-
+
TGaussPointID
TGaussSubMeshImpl
::GetObjID(vtkIdType theID) const
{
TCellID aCellID = myStartID + theID / myGauss->myNbPoints;
TLocalPntID aLocalPntID = theID % myGauss->myNbPoints;
-
+
return TGaussPointID(aCellID, aLocalPntID);
}
TCellID aCellID = theID.first;
TLocalPntID aLocalPntID = theID.second;
-
+
vtkIdType aNbPoints = myGauss->myNbPoints;
if ( aLocalPntID >= aNbPoints )
return aResult;
{
return mySubProfile->GetElemObjID( theID );
}
-
-
+
+
vtkIdType
VISU::TGaussSubMeshImpl
::GetElemVTKID(vtkIdType theID) const
return mySubProfile->GetElemVTKID( theID );
}
- vtkIdType
+ vtkIdType
TGaussSubMeshImpl
::GetGlobalID(vtkIdType theID) const
{
PGaussSubMeshImpl aLeft(theLeft), aRight(theRight);
const PGaussImpl& aGaussLeft = aLeft->myGauss;
const PGaussImpl& aGaussRight = aRight->myGauss;
-
+
if(aGaussLeft->myGeom != aGaussRight->myGeom)
return aGaussLeft->myGeom < aGaussRight->myGeom;
myParent(NULL)
{}
- TGaussPointID
+ TGaussPointID
TGaussMeshImpl
::GetObjID(vtkIdType theID) const
{
return VISU::GetObjID(aFilter->GetOutput(), theID);
}
- vtkIdType
+ vtkIdType
TGaussMeshImpl
::GetVTKID(const TGaussPointID& theID) const
{
TCellID aCellID = theID.first;
vtkIdType aVTKCellId = GetParent()->GetElemVTKID( aCellID );
- if ( aVTKCellId < 0 )
+ if ( aVTKCellId < 0 )
return aResult;
-
+
vtkCell* aCell = GetParent()->GetElemCell( aCellID );
if ( !aCell )
return aResult;
EGeometry aVGeom = VISU::VTKGeom2VISU( aCell->GetCellType() );
- if ( aVGeom < EGeometry(0) )
+ if ( aVGeom < EGeometry(0) )
return aResult;
-
+
TGeom2GaussSubMesh::const_iterator anIter = myGeom2GaussSubMesh.find( aVGeom );
if ( anIter == myGeom2GaussSubMesh.end() )
return aResult;
-
+
size_t aSubMeshEnd = myGaussSubMeshArr.size();
const PGaussSubMeshImpl& aGaussSubMesh = anIter->second;
for ( size_t aSubMeshId = 0; aSubMeshId < aSubMeshEnd; aSubMeshId++ ) {
const PGaussSubMeshImpl& aSubMesh = myGaussSubMeshArr[aSubMeshId];
if ( aGaussSubMesh.get() == aSubMesh.get() ) {
- return aGaussSubMesh->GetVTKID(theID);
+ return aGaussSubMesh->GetVTKID(theID);
}
}
return aResult;
}
- vtkPolyData*
+ vtkPolyData*
TGaussMeshImpl
::GetPolyDataOutput()
{
return aSize;
}
- TNamedIDMapper*
+ TNamedIDMapper*
TGaussMeshImpl
::GetParent() const
{
//---------------------------------------------------------------
- TGaussPointID
+ TGaussPointID
TGaussPtsIDFilter
::GetObjID(vtkIdType theID) const
{
return myGaussPtsIDMapper->GetObjID(theID);
}
- vtkIdType
+ vtkIdType
TGaussPtsIDFilter
::GetVTKID(const TGaussPointID& theID) const
{
return myGaussPtsIDMapper->GetVTKID(theID);
}
-
- TNamedIDMapper*
+
+ TNamedIDMapper*
TGaussPtsIDFilter
::GetParent() const
{
return myGaussPtsIDMapper->GetParent();
}
- vtkPolyData*
+ vtkPolyData*
TGaussPtsIDFilter
::GetPolyDataOutput()
{
return TPolyDataIDMapperImpl::GetPolyDataOutput();
}
- vtkDataSet*
+ vtkDataSet*
TGaussPtsIDFilter
::GetOutput()
{
{
TStructured::CopyStructure( theStructured );
- if ( PMeshImpl aMesh = theStructured )
- GetSource()->ShallowCopy( aMesh->GetPointSet() );
+ if ( PMeshImpl aMesh = theStructured )
+ GetSource()->ShallowCopy( aMesh->GetPointSet() );
}
vtkIdType
return myStartID + theID;
}
- std::string
+ std::string
TSubMeshImpl
::GetElemName(vtkIdType theObjID) const
{
{
TStructured::CopyStructure( theStructured );
- if ( PMeshImpl aMesh = theStructured )
- myNamedPointCoords = aMesh->myNamedPointCoords;
+ if ( PMeshImpl aMesh = theStructured )
+ myNamedPointCoords = aMesh->myNamedPointCoords;
}
vtkIdType
return VISU::GetElemObjID(GetFilter()->GetOutput(), theID);
}
- std::string
+ std::string
TMeshOnEntityImpl
::GetNodeName(vtkIdType theObjID) const
{
return myNamedPointCoords->GetNodeName(theObjID);
}
- std::string
+ std::string
TMeshOnEntityImpl
::GetElemName(vtkIdType theObjID) const
{
return aSubMesh->GetElemName(anInputCellID.second);
}
- vtkUnstructuredGrid*
+ vtkUnstructuredGrid*
TMeshOnEntityImpl
::GetUnstructuredGridOutput()
{
else{
TID2ID::const_iterator anIter = myElemObj2VTKID.find(theID);
if(anIter != myElemObj2VTKID.end())
- return anIter->second;
+ return anIter->second;
}
return -1;
}
return myMeshID[theID];
}
- vtkIdType
+ vtkIdType
TFamilyImpl
- ::GetNodeObjID(vtkIdType theID) const
+ ::GetNodeObjID(vtkIdType theID) const
{
return myNamedPointCoords->GetObjID(theID);
}
vtkIdType
TFamilyImpl
- ::GetNodeVTKID(vtkIdType theID) const
+ ::GetNodeVTKID(vtkIdType theID) const
{
return myNamedPointCoords->GetVTKID(theID);
}
- vtkUnstructuredGrid*
+ vtkUnstructuredGrid*
TFamilyImpl
::GetUnstructuredGridOutput()
{
{
TStructured::CopyStructure( theStructured );
- if ( PMeshImpl aMesh = theStructured )
+ if ( PMeshImpl aMesh = theStructured )
myNamedPointCoords = aMesh->myNamedPointCoords;
}
- TNbASizeCells
+ TNbASizeCells
TGroupImpl
::GetNbASizeCells() const
{
vtkIdType aNbCells = 0, aCellsSize = 0;
TFamilySet::const_iterator anIter = myFamilySet.begin();
for(; anIter != myFamilySet.end(); anIter++){
- PFamilyImpl aFamily = *anIter;
+ PFamilyImpl aFamily = (*anIter).second;
aNbCells += aFamily->myNbCells;
aCellsSize += aFamily->myCellsSize;
}
else{
TID2ID::const_iterator anIter = myElemObj2VTKID.find(theID);
if(anIter != myElemObj2VTKID.end())
- return anIter->second;
+ return anIter->second;
}
return -1;
}
return VISU::GetElemObjID(GetFilter()->GetOutput(), theID);
}
- vtkIdType
+ vtkIdType
TGroupImpl
- ::GetNodeObjID(vtkIdType theID) const
+ ::GetNodeObjID(vtkIdType theID) const
{
return myNamedPointCoords->GetObjID(theID);
}
vtkIdType
TGroupImpl
- ::GetNodeVTKID(vtkIdType theID) const
+ ::GetNodeVTKID(vtkIdType theID) const
{
return myNamedPointCoords->GetVTKID(theID);
}
- vtkUnstructuredGrid*
+ vtkUnstructuredGrid*
TGroupImpl
::GetUnstructuredGridOutput()
{
}
-
+
//---------------------------------------------------------------
TFieldImpl
::TFieldImpl()
, myDataType( 0 )
{}
- void
+ void
TFieldImpl
::Init(vtkIdType theNbComp,
- vtkIdType theDataType)
+ vtkIdType theDataType)
{
myNbComp = theNbComp;
myDataType = theDataType;
myCompNames.resize(theNbComp);
myUnitNames.resize(theNbComp);
- myMinMaxArr.resize(theNbComp + 1);
- myAverageMinMaxArr.resize(theNbComp + 1);
- for(vtkIdType iComp = 0; iComp <= theNbComp; iComp++){
- TMinMax& aMinMax = myMinMaxArr[iComp];
- aMinMax.first = VTK_LARGE_FLOAT;
- aMinMax.second = -VTK_LARGE_FLOAT;
- TMinMax& anAverageMinMax = myAverageMinMaxArr[iComp];
- anAverageMinMax.first = VTK_LARGE_FLOAT;
- anAverageMinMax.second = -VTK_LARGE_FLOAT;
+
+ myMetric2Comp2MinMax.resize(3);
+ myMetric2Comp2AverageMinMax.resize(3);
+ myMetric2Comp2Group2MinMax.resize(3);
+ myMetric2Comp2Group2AverageMinMax.resize(3);
+ for(int aGaussMetric = (int)VISU::AVERAGE_METRIC; aGaussMetric <= (int)VISU::MAXIMUM_METRIC; aGaussMetric++){
+ TComp2MinMax& aComp2MinMax = myMetric2Comp2MinMax[aGaussMetric];
+ TComp2MinMax& aComp2AverageMinMax = myMetric2Comp2AverageMinMax[aGaussMetric];
+ TComp2Group2MinMax& aComp2Group2MinMax = myMetric2Comp2Group2MinMax[aGaussMetric];
+ TComp2Group2MinMax& aComp2Group2AverageMinMax = myMetric2Comp2Group2AverageMinMax[aGaussMetric];
+
+ aComp2MinMax.resize(theNbComp + 1);
+ aComp2AverageMinMax.resize(theNbComp + 1);
+ aComp2Group2MinMax.resize(theNbComp + 1);
+ aComp2Group2AverageMinMax.resize(theNbComp + 1);
+ for(vtkIdType iComp = 0; iComp <= theNbComp; iComp++){
+ TMinMax& aMinMax = aComp2MinMax[iComp];
+ aMinMax.first = VTK_LARGE_FLOAT;
+ aMinMax.second = -VTK_LARGE_FLOAT;
+ TMinMax& anAverageMinMax = aComp2AverageMinMax[iComp];
+ anAverageMinMax.first = VTK_LARGE_FLOAT;
+ anAverageMinMax.second = -VTK_LARGE_FLOAT;
+ }
}
}
- vtkIdType
+ vtkIdType
TFieldImpl
::GetDataType() const
{
return myDataType;
}
- TMinMax
+ TMinMax
TFieldImpl
- ::GetMinMax(vtkIdType theCompID)
+ ::GetMinMax(vtkIdType theCompID, const TNames& theGroupNames, TGaussMetric theGaussMetric)
{
- return myMinMaxArr[theCompID];
+ TMinMax aMinMax;
+ bool anIsMinMaxInitialized = false;
+ if( !theGroupNames.empty() ) {
+ aMinMax.first = VTK_LARGE_FLOAT;
+ aMinMax.second = -VTK_LARGE_FLOAT;
+
+ const TGroup2MinMax& aGroup2MinMax = myMetric2Comp2Group2MinMax[theGaussMetric][theCompID];
+ TNames::const_iterator aNameIter = theGroupNames.begin();
+ for( ; aNameIter != theGroupNames.end(); aNameIter++ ) {
+ TGroup2MinMax::const_iterator aGroup2MinMaxIter = aGroup2MinMax.find( *aNameIter );
+ if( aGroup2MinMaxIter != aGroup2MinMax.end() ) {
+ const TMinMax& aGroupMinMax = aGroup2MinMaxIter->second;
+ aMinMax.first = std::min( aMinMax.first, aGroupMinMax.first );
+ aMinMax.second = std::max( aMinMax.second, aGroupMinMax.second );
+ anIsMinMaxInitialized = true;
+ }
+ }
+ }
+
+ if( !anIsMinMaxInitialized )
+ aMinMax = myMetric2Comp2MinMax[theGaussMetric][theCompID];
+
+ return aMinMax;
}
- TMinMax
+ TMinMax
TFieldImpl
- ::GetAverageMinMax(vtkIdType theCompID)
+ ::GetAverageMinMax(vtkIdType theCompID, const TNames& theGroupNames, TGaussMetric theGaussMetric)
{
- return myAverageMinMaxArr[theCompID];
+ TMinMax aMinMax;
+ bool anIsMinMaxInitialized = false;
+ if( !theGroupNames.empty() ) {
+ aMinMax.first = VTK_LARGE_FLOAT;
+ aMinMax.second = -VTK_LARGE_FLOAT;
+
+ const TGroup2MinMax& aGroup2MinMax = myMetric2Comp2Group2AverageMinMax[theGaussMetric][theCompID];
+ TNames::const_iterator aNameIter = theGroupNames.begin();
+ for( ; aNameIter != theGroupNames.end(); aNameIter++ ) {
+ TGroup2MinMax::const_iterator aGroup2MinMaxIter = aGroup2MinMax.find( *aNameIter );
+ if( aGroup2MinMaxIter != aGroup2MinMax.end() ) {
+ const TMinMax& aGroupMinMax = aGroup2MinMaxIter->second;
+ aMinMax.first = std::min( aMinMax.first, aGroupMinMax.first );
+ aMinMax.second = std::max( aMinMax.second, aGroupMinMax.second );
+ anIsMinMaxInitialized = true;
+ }
+ }
+ }
+
+ if( !anIsMinMaxInitialized )
+ aMinMax = myMetric2Comp2AverageMinMax[theGaussMetric][theCompID];
+
+ return aMinMax;
}
-
+
//----------------------------------------------------------------------------
- const PMeshValue&
+ const PMeshValue&
TGeom2Value
::GetMeshValue(EGeometry theGeom) const
{
EXCEPTION(std::runtime_error,"TGeom2Value::GetMeshValue - myGeom2MeshValue.find(theGeom) fails");
return anIter->second;
}
-
- PMeshValue&
+
+ PMeshValue&
TGeom2Value
::GetMeshValue(EGeometry theGeom)
{
//----------------------------------------------------------------------------
- TGeom2MeshValue&
+ TGeom2MeshValue&
TGeom2Value
::GetGeom2MeshValue()
{
return myGeom2MeshValue;
}
-
- const TGeom2MeshValue&
+
+ const TGeom2MeshValue&
TGeom2Value
::GetGeom2MeshValue() const
{
return myGeom2MeshValue;
}
- PMeshValue
+ PMeshValue
TGeom2Value
::GetFirstMeshValue() const
{
TValForTimeImpl
::TValForTimeImpl():
myGaussPtsIDFilter(new TGaussPtsIDFilter()),
- myUnstructuredGridIDMapper(new TUnstructuredGridIDMapperImpl())
+ myUnstructuredGridIDMapper(new TUnstructuredGridIDMapperImpl()),
+ myIsFilled(false)
{}
- const PMeshValue&
+ const PMeshValue&
TValForTimeImpl
::GetMeshValue(EGeometry theGeom) const
{
return myGeom2Value.GetMeshValue(theGeom);
}
-
- PMeshValue&
+
+ PMeshValue&
TValForTimeImpl
::GetMeshValue(EGeometry theGeom)
{
return myGeom2Value.GetMeshValue(theGeom);
}
- TGeom2MeshValue&
+ TGeom2MeshValue&
TValForTimeImpl
::GetGeom2MeshValue()
{
return myGeom2Value.GetGeom2MeshValue();
}
- const TGeom2MeshValue&
+ const TGeom2MeshValue&
TValForTimeImpl
::GetGeom2MeshValue() const
{
return myGeom2Value.GetGeom2MeshValue();
}
- PMeshValue
+ PMeshValue
TValForTimeImpl
::GetFirstMeshValue() const
{
}
return anIter->second;
}
-
+
+ int
+ TValForTimeImpl
+ ::GetMaxNbGauss() const
+ {
+ int aNbGauss = 1;
+ TGeom2NbGauss::const_iterator anIter = myGeom2NbGauss.begin();
+ for(; anIter != myGeom2NbGauss.end(); anIter++){
+ aNbGauss = std::max<int>(aNbGauss, anIter->second);
+ }
+ return aNbGauss;
+ }
+
unsigned long int
TValForTimeImpl
::GetMemorySize()
return aSize;
}
-
//---------------------------------------------------------------
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File :
// Author : Alexey PETROV
// Module : VISU
//---------------------------------------------------------------
//! Define an intermediate class which unifies memory size calculation
struct VISU_CONVERTOR_EXPORT TMemoryCheckIDMapper: public virtual TIsVTKDone,
- public virtual TIDMapper
+ public virtual TIDMapper
{
//! Gets memory size used by the instance (bytes).
virtual
//---------------------------------------------------------------
//! Specialize TMesh to provide VTK mapping for nodes
struct VISU_CONVERTOR_EXPORT TMeshImpl: virtual TMesh,
- virtual TIsVTKDone
+ virtual TIsVTKDone
{
PNamedPointCoords myNamedPointCoords; //!< Keeps intermediate representation of the nodes
vtkIdType myNbPoints; //!< Keeps number of the nodes
//! Specialize TSubProfile to provide VTK mapping
struct VISU_CONVERTOR_EXPORT TSubProfileImpl: virtual TSubProfile,
- virtual TUnstructuredGridHolder
+ virtual TUnstructuredGridHolder
{
TSubProfileImpl();
virtual
vtkIdType
GetElemVTKID(vtkIdType theID) const;
+
+ //! Return true in case if it is default profile,
+ //! i.e myName == "" (MED_NOPFL, see med.h)
+ virtual
+ bool
+ isDefault() const;
//! Gets memory size used by the instance (bytes).
virtual
//! Specialize TProfile to provide VTK mapping for MED TIMESTAMP mesh
struct VISU_CONVERTOR_EXPORT TProfileImpl: virtual TProfile,
- virtual TAppendFilterHolder
+ virtual TAppendFilterHolder
{
TProfileImpl();
bool myIsAll; //!< Say, whether the MED TIMESTAMP defined on all MED ENTITY or not
//---------------------------------------------------------------
//! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh
struct TUnstructuredGridIDMapperImpl: virtual TMergeFilterHolder,
- virtual TUnstructuredGridIDMapper
+ virtual TUnstructuredGridIDMapper
{
PAppendFilterHolder myIDMapper; //!< Responsible for numbering
PCommonCellsFilter myCommonCellsFilter;
//---------------------------------------------------------------
//! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh
struct TPolyDataIDMapperImpl: virtual TMergeFilterHolder,
- virtual TPolyDataIDMapper
+ virtual TPolyDataIDMapper
{
PAppendPolyDataHolder myIDMapper; //!< Responsible for numbering
virtual
void
LessThan(const PGaussImpl& theGauss,
- bool& theResult) const;
+ bool& theResult) const;
};
//---------------------------------------------------------------
//! Specialize TGaussSubMesh to provide VTK mapping for the entity
struct VISU_CONVERTOR_EXPORT TGaussSubMeshImpl: virtual TGaussSubMesh,
- virtual TPolyDataHolder
+ virtual TPolyDataHolder
{
TGaussSubMeshImpl();
//! Specialize TGaussMesh to provide VTK mapping for the entity
struct VISU_CONVERTOR_EXPORT TGaussMeshImpl: virtual TGaussMesh,
- virtual TAppendPolyDataHolder
+ virtual TAppendPolyDataHolder
{
TGaussMeshImpl();
//---------------------------------------------------------------
//! Specialize TGaussPtsIDMapper to provide VTK mapping for MED TIMESTAMP mesh
struct VISU_CONVERTOR_EXPORT TGaussPtsIDFilter: virtual TPolyDataIDMapperImpl,
- virtual TGaussPtsIDMapper
+ virtual TGaussPtsIDMapper
{
PGaussPtsIDMapper myGaussPtsIDMapper;
//! Specialize TMeshOnEntity to provide VTK mapping for the entity
struct VISU_CONVERTOR_EXPORT TMeshOnEntityImpl: virtual TMeshOnEntity,
- virtual TAppendFilterHolder,
- virtual TSizeCounter
+ virtual TAppendFilterHolder,
+ virtual TSizeCounter
{
TMeshOnEntityImpl();
//! Specialize TFamily to provide VTK mapping for the entity
struct VISU_CONVERTOR_EXPORT TFamilyImpl: virtual TFamily,
- virtual TUnstructuredGridHolder
+ virtual TUnstructuredGridHolder
{
//! Reimplements the TStructured::CopyStructure
virtual
TSubMeshID myMeshID; //!< Keeps numbers of mesh elements that belongs to the MED FAMILY
TGeom2SubMeshID myGeom2SubMeshID; //!< Keeps TSubMeshID according to their geometrical type
+
+ TNames myGroupNames; //!< Keeps names of groups that refer to the family
};
//! Specialize TGroup to provide VTK mapping for the entity
struct VISU_CONVERTOR_EXPORT TGroupImpl: virtual TGroup,
- virtual TAppendFilterHolder
+ virtual TAppendFilterHolder
{
//! Reimplements the TStructured::CopyStructure
virtual
//---------------------------------------------------------------
- typedef TVector<TMinMax> TMinMaxArr;
+ typedef TVector<TMinMax> TComp2MinMax;
+ typedef TVector<TComp2MinMax> TMetric2Comp2MinMax;
+
+ typedef std::map<TName,TMinMax> TGroup2MinMax;
+ typedef TVector<TGroup2MinMax> TComp2Group2MinMax;
+ typedef TVector<TComp2Group2MinMax> TMetric2Comp2Group2MinMax;
//! Specialize TField to provide VTK mapping for the entity
struct VISU_CONVERTOR_EXPORT TFieldImpl: virtual TField
//! To initialize the data structure
void
Init(vtkIdType theNbComp,
- vtkIdType theDataType);
+ vtkIdType theDataType);
//! Gets type idetificator of the mesh data.
vtkIdType
//! Implement the TField::GetMinMax
virtual
TMinMax
- GetMinMax(vtkIdType theCompID);
+ GetMinMax(vtkIdType theCompID, const TNames& theGroupNames, TGaussMetric theGaussMetric = VISU::AVERAGE_METRIC);
//! Implement the TField::GetAverageMinMax
virtual
TMinMax
- GetAverageMinMax(vtkIdType theCompID);
+ GetAverageMinMax(vtkIdType theCompID, const TNames& theGroupNames, TGaussMetric theGaussMetric = VISU::AVERAGE_METRIC);
vtkIdType myDataSize; //!< Keeps size of the assigned data
vtkIdType myDataType; //!< Keeps type idetificator of the mesh data
- TMinMaxArr myMinMaxArr; //!< Keeps min/max values for each component of the MED FIELD
- TMinMaxArr myAverageMinMaxArr; //!< Keeps average by Gauss Points min/max values for each component of the MED FIELD
- //!< If Nb of Gauss Points <=1 myAverageMinMaxArr equal myMinMaxArr
+ TMetric2Comp2MinMax myMetric2Comp2MinMax; //!< Keeps min/max values for each component of the MED FIELD
+ TMetric2Comp2MinMax myMetric2Comp2AverageMinMax; //!< Keeps average by Gauss Points min/max values for each component of the MED FIELD
+ //!< If Nb of Gauss Points <=1 myAverageMinMaxArr equal myMinMaxArr
+
+ TMetric2Comp2Group2MinMax myMetric2Comp2Group2MinMax;
+ TMetric2Comp2Group2MinMax myMetric2Comp2Group2AverageMinMax;
};
PUnstructuredGridIDMapperImpl myUnstructuredGridIDMapper; //!< Keep VTK representation for ordinary mesh and data
TGeom2Value myGeom2Value; //!< Keep value that is assigned to the mesh
TGeom2NbGauss myGeom2NbGauss; //!< Keep number of Gauss Points
+ bool myIsFilled; //!< Keep the status of the TValForTime (true - already filled, false - not filled);
TValForTimeImpl();
int
GetNbGauss(EGeometry theGeom) const;
+ //! Get maximum number of Gauss Points among all geometrical types (provided for convenience)
+ virtual
+ int
+ GetMaxNbGauss() const;
+
//! Gets memory size used by the instance (bytes).
virtual
unsigned long int
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File:
// Author:
#include <fstream>
#include <iostream>
-#include <strstream>
+#include <sstream>
#include <vtkPoints.h>
#include <vtkDoubleArray.h>
#include <vtkStructuredGrid.h>
#include <vtkStructuredGridGeometryFilter.h>
+#include <Basics_Utils.hxx>
+
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
int getLine( std::ifstream& theStmIn, QString& theString )
{
char tmp;
- std::ostrstream aStrOut;
+ std::ostringstream aStrOut;
while ( theStmIn.get( tmp ) ) {
aStrOut<<tmp;
if ( tmp == '\n' )
- break;
+ break;
}
aStrOut<<std::ends;
- theString = aStrOut.str();
+ theString = aStrOut.str().c_str();
return !theStmIn.eof();
}
+
+ //=======================================================================
+ //function : findNextCell
+ //purpose : auxilary for ImportCSVTable
+ //=======================================================================
+ bool findNextCell(std::ifstream& aStmIn, QString& aStr,
+ QString& aCell, const char theSeparator)
+ {
+ aCell = "";
+ int index, tmpind = 0;
+ if( aStr.at(0) == theSeparator ) {
+ aStr.remove(0,1);
+ aStr = aStr.trimmed();
+ if(aStr.size()==0) return true;
+ }
+ QString aTmp = aStr;
+ if( aTmp.at(0) == '"' ) {
+ // find closed "
+ while( !aStmIn.eof() ) {
+ tmpind = aTmp.indexOf('"',1);
+ if( tmpind < 0 ) {
+ while( !aStmIn.eof() ) {
+ aCell.push_back(aTmp);
+ aCell.push_back('\n');
+ getLine( aStmIn, aTmp );
+ tmpind = aTmp.indexOf('"',1);
+ if( tmpind >= 0 ) {
+ break;
+ }
+ }
+ }
+ if(tmpind < 0)
+ return false;
+ // read next symbol
+ if( aTmp.at(tmpind+1) == '"' ) {
+ // "" is found => need to continue
+ aCell.push_back(aTmp.left(tmpind+1));
+ aTmp = aTmp.mid(tmpind+2);
+ }
+ else if( aTmp.at(tmpind+1) == theSeparator ) {
+ index = tmpind+1;
+ break;
+ }
+ else {
+ return false;
+ }
+ }
+ }
+ else {
+ // find index for separator
+ index = aTmp.indexOf( theSeparator );
+ }
+ if( index < 0 ) {
+ aCell += aTmp;
+ aStr = "";
+ }
+ else {
+ if(index>0) aCell += aTmp.left(index);
+ aStr = aTmp.mid(index).trimmed();
+ }
+ if( aCell.size()>0 && aCell.at(0) == '"' ) {
+ // remove first and last symbols
+ int last = aCell.size()-1;
+ aCell.remove(last,1);
+ aCell.remove(0,1);
+ }
+ // replace "" to " in aCell
+ QChar ctmp = '"';
+ QString tmp(ctmp);
+ tmp += ctmp;
+ index = aCell.indexOf(tmp);
+ while(index>=0) {
+ aCell.remove(index,1);
+ index = aCell.indexOf(tmp);
+ }
+ return true;
+ }
+
}
//---------------------------------------------------------------
void
-VISU::ImportTables( const char* theFileName, TTableContainer& theContainer )
+VISU::ImportTables( const char* theFileName, TTableContainer& theContainer,
+ bool theFirstStrAsTitle)
{
std::ifstream aStmIn;
QFileInfo aFileInfo( theFileName );
if( !aFileInfo.isFile() || !aFileInfo.isReadable() || !aFileInfo.size() )
return;
+ QString tmp(theFileName);
+ tmp = tmp.trimmed();
+ tmp = tmp.right(3).trimmed();
+
+ if( tmp == QString("csv") ) {
+ const char separator = ',';
+ ImportCSVTable(theFileName, theContainer, theFirstStrAsTitle, separator);
+ return;
+ }
+
aStmIn.open( theFileName );
QString aTmp;
do {
// find beginning of table (tables are separated by empty lines)
- while( ::getLine( aStmIn, aTmp ) && aTmp.trimmed() == "");
+ while( getLine( aStmIn, aTmp ) && aTmp.trimmed() == "" );
PTableIDMapper aTableIDMapper( new TTableIDMapper() );
TTable2D& aTable2D = *aTableIDMapper;
if(MYDEBUG) std::cout << "New table is found" << std::endl;
+ bool IsFirst = true;
while( !aStmIn.eof() && aTmp.trimmed() != "" ){
QString data = aTmp.trimmed();
QString cmt = "";
// split string to data and comment (comment starts from '#' symbol)
int index = aTmp.indexOf( "#" );
if ( index >= 0 ) {
- data = aTmp.left( index ).trimmed();
- cmt = aTmp.mid( index+1 ).trimmed();
+ data = aTmp.left( index ).trimmed();
+ cmt = aTmp.mid( index+1 ).trimmed();
}
// if comment is not empty, try to get keyword from it (separated by ':' symbol)
if ( !cmt.isEmpty() ) {
- int index1 = cmt.indexOf( ":" );
- if ( index1 >= 0 ) {
- QString tmpstr = cmt.left( index1 ).trimmed();
- if ( tmpstr == QString( "TITLE" ) ||
- tmpstr == QString( "COLUMN_TITLES" ) ||
- tmpstr == QString( "COLUMN_UNITS" ) ||
- tmpstr == QString( "COMMENT" ) ) {
- keyword = tmpstr;
- cmt = cmt.mid( index1+1 ).trimmed();
- }
- }
+ int index1 = cmt.indexOf( ":" );
+ if ( index1 >= 0 ) {
+ QString tmpstr = cmt.left( index1 ).trimmed();
+ if ( tmpstr == QString( "TITLE" ) ||
+ tmpstr == QString( "COLUMN_TITLES" ) ||
+ tmpstr == QString( "COLUMN_UNITS" ) ||
+ tmpstr == QString( "COMMENT" ) ) {
+ keyword = tmpstr;
+ cmt = cmt.mid( index1+1 ).trimmed();
+ }
+ }
}
// if data is empty, process only comment
if ( data.isEmpty() ) {
- // if keyword is found, try to process it
- // elsewise it is a simple comment, just ignore it
- if ( !keyword.isEmpty() ) {
- if ( keyword == QString( "TITLE" ) ) {
- QString title = cmt;
- if ( aTable2D.myTitle != "" )
- title = QString( aTable2D.myTitle.c_str() ) + QString( " " ) + title;
- if(MYDEBUG) std::cout << "...Table TITLE is: " << title.toLatin1().constData() << std::endl;
- aTable2D.myTitle = title.toLatin1().constData();
- }
- else if ( keyword == QString( "COLUMN_TITLES" ) ) {
- // comment may contain column headers
- QStringList aStrList = cmt.split( "|", QString::SkipEmptyParts );
- if(MYDEBUG) std::cout << "...Column TITLES are: ";
- for ( int i = 0; i < aStrList.count(); i++ ) {
- QString tmpstr = aStrList[ i ].trimmed();
- if(MYDEBUG) std::cout << tmpstr.toLatin1().constData() << " ";
- aTable2D.myColumnTitles.push_back( tmpstr.toLatin1().constData() );
- }
- if(MYDEBUG) std::cout << std::endl;
- }
- else if ( keyword == QString( "COLUMN_UNITS" ) ) {
- // comment may contain column units
- QStringList aStrList = cmt.split( " ", QString::SkipEmptyParts );
- if(MYDEBUG) std::cout << "...Column UNITS are: ";
- for ( int i = 0; i < aStrList.count(); i++ ) {
- QString tmpstr = aStrList[ i ].trimmed();
- if(MYDEBUG) std::cout << tmpstr.toLatin1().constData() << " ";
- aTable2D.myColumnUnits.push_back( tmpstr.toLatin1().constData() );
- }
- if(MYDEBUG) std::cout << std::endl;
- }
- else if ( keyword == QString( "COMMENT" ) ) {
- // keyword 'COMMENT' processing can be here
- // currently it is ignored
- if(MYDEBUG) std::cout << "...COMMENT: " << cmt.toLatin1().constData() << std::endl;
- }
- }
- else {
- if(MYDEBUG) std::cout << "...comment: " << cmt.toLatin1().constData() << std::endl;
- // simple comment processing can be here
- // currently it is ignored
- }
+ // if keyword is found, try to process it
+ // elsewise it is a simple comment, just ignore it
+ if ( !keyword.isEmpty() ) {
+ if ( keyword == QString( "TITLE" ) ) {
+ QString title = cmt;
+ if ( aTable2D.myTitle != "" )
+ title = QString( aTable2D.myTitle.c_str() ) + QString( " " ) + title;
+ if(MYDEBUG) std::cout << "...Table TITLE is: " << title.toLatin1().constData() << std::endl;
+ aTable2D.myTitle = title.toLatin1().constData();
+ }
+ else if ( keyword == QString( "COLUMN_TITLES" ) ) {
+ // comment may contain column headers
+ QStringList aStrList = cmt.split( "|", QString::SkipEmptyParts );
+ if(MYDEBUG) std::cout << "...Column TITLES are: ";
+ for ( int i = 0; i < aStrList.count(); i++ ) {
+ QString tmpstr = aStrList[ i ].trimmed();
+ if(MYDEBUG) std::cout << tmpstr.toLatin1().constData() << " ";
+ aTable2D.myColumnTitles.push_back( tmpstr.toLatin1().constData() );
+ }
+ if(MYDEBUG) std::cout << std::endl;
+ }
+ else if ( keyword == QString( "COLUMN_UNITS" ) ) {
+ // comment may contain column units
+ QStringList aStrList = cmt.split( " ", QString::SkipEmptyParts );
+ if(MYDEBUG) std::cout << "...Column UNITS are: ";
+ for ( int i = 0; i < aStrList.count(); i++ ) {
+ QString tmpstr = aStrList[ i ].trimmed();
+ if(MYDEBUG) std::cout << tmpstr.toLatin1().constData() << " ";
+ aTable2D.myColumnUnits.push_back( tmpstr.toLatin1().constData() );
+ }
+ if(MYDEBUG) std::cout << std::endl;
+ }
+ else if ( keyword == QString( "COMMENT" ) ) {
+ // keyword 'COMMENT' processing can be here
+ // currently it is ignored
+ if(MYDEBUG) std::cout << "...COMMENT: " << cmt.toLatin1().constData() << std::endl;
+ }
+ }
+ else {
+ if(MYDEBUG) std::cout << "...comment: " << cmt.toLatin1().constData() << std::endl;
+ // simple comment processing can be here
+ // currently it is ignored
+ }
}
// if data is not empty, try to process it
else {
- TTable2D::TRow aRow;
- if(MYDEBUG) std::cout << "...New row is found: " << std::endl;
- if ( !cmt.isEmpty() ) {
- aRow.myTitle = cmt.toLatin1().constData();
- if(MYDEBUG) std::cout << "......ROW TITLE is: " << cmt.toLatin1().constData() << std::endl;
- }
- QString datar1 = data.replace(QRegExp("\t"), " ");
- QStringList aValList = datar1.split( " ", QString::SkipEmptyParts );
- for ( int i = 0; i < aValList.count(); i++ ) {
- if ( aValList[i].trimmed() != "" ) {
- TTable2D::TValue aVal = aValList[i].trimmed().toLatin1().constData();
- aRow.myValues.push_back( aVal );
- }
- }
- if( aRow.myValues.size() > 0 )
- aTable2D.myRows.push_back( aRow );
- // ************** OLD CODE ******************
- /*
- TValue aVal;
- istrstream aStream( data );
- aStream.precision( STRPRECISION );
- while( aStream >> aVal ) {
- aRow.myValues.push_back( aVal );
- }
- if( aRow.myValues.size() > 0 )
- aTable2D.myRows.push_back( aRow );
- */
- // ************** OLD CODE ******************
+ TTable2D::TRow aRow;
+ if(MYDEBUG) std::cout << "...New row is found: " << std::endl;
+ QString datar1 = data.replace(QRegExp("\t"), " ");
+ QStringList aValList = datar1.split( " ", QString::SkipEmptyParts );
+ if( aTable2D.myColumnTitles.size()==0 && IsFirst && theFirstStrAsTitle ) {
+ for ( int i = 0; i < aValList.count(); i++ ) {
+ QString tmpstr = aValList[ i ].trimmed();
+ aTable2D.myColumnTitles.push_back( tmpstr.toLatin1().constData() );
+ }
+ }
+ else {
+ if ( !cmt.isEmpty() ) {
+ aRow.myTitle = cmt.toLatin1().constData();
+ if(MYDEBUG) std::cout << "......ROW TITLE is: " << cmt.toLatin1().constData() << std::endl;
+ }
+ //QString datar1 = data.replace(QRegExp("\t"), " ");
+ //QStringList aValList = datar1.split( " ", QString::SkipEmptyParts );
+ for ( int i = 0; i < aValList.count(); i++ ) {
+ if ( aValList[i].trimmed() != "" ) {
+ TTable2D::TValue aVal = aValList[i].trimmed().toLatin1().constData();
+ aRow.myValues.push_back( aVal );
+ }
+ }
+ if( aRow.myValues.size() > 0 )
+ aTable2D.myRows.push_back( aRow );
+ }
+ IsFirst = false;
+ // ************** OLD CODE ******************
+ /*
+ TValue aVal;
+ istringstream aStream( data );
+ aStream.precision( STRPRECISION );
+ while( aStream >> aVal ) {
+ aRow.myValues.push_back( aVal );
+ }
+ if( aRow.myValues.size() > 0 )
+ aTable2D.myRows.push_back( aRow );
+ */
+ // ************** OLD CODE ******************
+ }
+ getLine( aStmIn, aTmp );
+ }
+ if( aTable2D.Check() ) {
+ if(MYDEBUG) std::cout << "aTable2D is checked OK " << aTable2D.myTitle << std::endl;
+ theContainer.push_back( aTableIDMapper );
+ }
+ } while ( !aStmIn.eof() );
+ aStmIn.close();
+
+ if(MYDEBUG) std::cout << "After close" << std::endl;
+}
+
+
+//=======================================================================
+//function : ImportCSVTable
+//purpose :
+//=======================================================================
+void VISU::ImportCSVTable(const char* theFileName, TTableContainer& theContainer,
+ bool theFirstStrAsTitle, const char theSeparator)
+{
+ std::ifstream aStmIn;
+ QFileInfo aFileInfo( theFileName );
+ if( !aFileInfo.isFile() || !aFileInfo.isReadable() || !aFileInfo.size() )
+ return;
+ aStmIn.open( theFileName );
+ QString aTmp;
+ do {
+ // find beginning of table (tables are separated by empty lines)
+ while( getLine( aStmIn, aTmp ) && aTmp.trimmed() == "" );
+
+ PTableIDMapper aTableIDMapper( new TTableIDMapper() );
+ TTable2D& aTable2D = *aTableIDMapper;
+ if(MYDEBUG) std::cout << "New table is found" << std::endl;
+
+ bool IsFirst = true;
+ QStringList aValList;
+
+ while( !aStmIn.eof() ) {
+ QString aCell = "";
+ if( !( findNextCell(aStmIn, aTmp, aCell, theSeparator)) ) {
+ return;
+ }
+ if( aTmp.size()==0 ) {
+ // make table row
+ aValList.push_back(aCell);
+ if( IsFirst && theFirstStrAsTitle ) {
+ for ( int i = 0; i < aValList.count(); i++ ) {
+ aTable2D.myColumnTitles.push_back( aValList[i].trimmed().toLatin1().constData() );
+ }
+ }
+ else {
+ TTable2D::TRow aRow;
+ for ( int i = 0; i < aValList.count(); i++ ) {
+ if ( aValList[i].trimmed() != "" ) {
+ TTable2D::TValue aVal = aValList[i].trimmed().toLatin1().constData();
+ aRow.myValues.push_back( aVal );
+ }
+ else {
+ aRow.myValues.push_back( "Empty" );
+ }
+ }
+ if( aRow.myValues.size() > 0 ) {
+ aTable2D.myRows.push_back( aRow );
+ }
+ }
+ // clear list of values and read next string
+ aValList.clear();
+ getLine( aStmIn, aTmp );
+ IsFirst = false;
+ }
+ else {
+ // put value to table cell
+ aValList.push_back(aCell);
}
- ::getLine( aStmIn, aTmp );
}
+
if( aTable2D.Check() ) {
if(MYDEBUG) std::cout << "aTable2D is checked OK " << aTable2D.myTitle << std::endl;
theContainer.push_back( aTableIDMapper );
}
+
} while ( !aStmIn.eof() );
aStmIn.close();
VISU::TTableIDMapper
::SetXAxisPosition( vtkIdType theAxisPosition )
{
+ // Set "C" numeric locale to import numbers correctly
+ Kernel_Utils::Localizer loc;
+
if ( myXAxisPosition == theAxisPosition || !Check() )
return;
myOutput->ShallowCopy( aFilter->GetOutput() );
aFilter->Delete();
}
+
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU CONVERTOR :
// File : VISU_TableReader.hxx
// Author : Alexey PETROV
//---------------------------------------------------------------
typedef std::vector<PTableIDMapper> TTableContainer;
VISU_CONVERTOR_EXPORT
- void ImportTables( const char* theFileName, TTableContainer& theContainer );
+ void ImportTables( const char* theFileName, TTableContainer& theContainer,
+ bool theFirstStrAsTitle = false);
+ void ImportCSVTable(const char* theFileName,
+ TTableContainer& theContainer,
+ bool theFirstStrAsTitle,
+ const char theSeparator);
//---------------------------------------------------------------
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_TypeList.hxx
// Author : Oleg UVAROV
typedef typename TSequence< T02, T03, T04, T05, T06, T07, T08, T09, T10,
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20,
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40
- >::TResult
+ T31, T32, T33, T34, T35, T36, T37, T38, T39, T40
+ >::TResult
TailResult;
public:
typedef TList< T01, TailResult > TResult;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU CONVERTOR :
// File : VISU_UsedPointsFilter.cxx
// Author :
vtkIdType anOldId = anOldPointsIds->GetId(i);
TId2IdMap::iterator anIter = aId2IdMap.find(anOldId);
if(anIter == aId2IdMap.end())
- goto NEXT_CELL;
+ goto NEXT_CELL;
vtkIdType aNewId = anIter->second;
aNewPointsIds->InsertNextId(aNewId);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU CONVERTOR :
// File : VISU_UsedPointsFilter.hxx
// Author :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_VTKTypeList.hxx
// Author : Oleg UVAROV
{
//----------------------------------------------------------------------------
typedef TSequence< char,
- unsigned char,
- short,
- unsigned short,
- int,
- unsigned int,
- long,
- unsigned long,
- float,
- double >::TResult TVTKBasicTypeList;
+ unsigned char,
+ short,
+ unsigned short,
+ int,
+ unsigned int,
+ long,
+ unsigned long,
+ float,
+ double >::TResult TVTKBasicTypeList;
//----------------------------------------------------------------------------
typedef TSequence< vtkCharArray,
- vtkUnsignedCharArray,
- vtkShortArray,
- vtkUnsignedShortArray,
- vtkIntArray,
- vtkUnsignedIntArray,
- vtkLongArray,
- vtkUnsignedLongArray,
- vtkFloatArray,
- vtkDoubleArray >::TResult TVTKArrayTypeList;
+ vtkUnsignedCharArray,
+ vtkShortArray,
+ vtkUnsignedShortArray,
+ vtkIntArray,
+ vtkUnsignedIntArray,
+ vtkLongArray,
+ vtkUnsignedLongArray,
+ vtkFloatArray,
+ vtkDoubleArray >::TResult TVTKArrayTypeList;
//----------------------------------------------------------------------------
typedef TSequence< TInt2Type< VTK_CHAR >,
- TInt2Type< VTK_UNSIGNED_CHAR >,
- TInt2Type< VTK_SHORT >,
- TInt2Type< VTK_UNSIGNED_SHORT >,
- TInt2Type< VTK_INT >,
- TInt2Type< VTK_UNSIGNED_INT >,
- TInt2Type< VTK_LONG >,
- TInt2Type< VTK_UNSIGNED_LONG >,
- TInt2Type< VTK_FLOAT >,
- TInt2Type< VTK_DOUBLE > >::TResult TVTKBasicEnumList;
+ TInt2Type< VTK_UNSIGNED_CHAR >,
+ TInt2Type< VTK_SHORT >,
+ TInt2Type< VTK_UNSIGNED_SHORT >,
+ TInt2Type< VTK_INT >,
+ TInt2Type< VTK_UNSIGNED_INT >,
+ TInt2Type< VTK_LONG >,
+ TInt2Type< VTK_UNSIGNED_LONG >,
+ TInt2Type< VTK_FLOAT >,
+ TInt2Type< VTK_DOUBLE > >::TResult TVTKBasicEnumList;
//----------------------------------------------------------------------------
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_Vtk2MedConvertor.cxx
// Author : Eugeny NIKOLAEV, Open CASCADE SAS
//
-
#include "VISU_Vtk2MedConvertor.hxx"
// QT includes
/*
# = dynamic_cast</*
-*>( );define VTK_EMPTY_CELL 0
-#define VTK_VERTEX 1
-#define VTK_POLY_VERTEX 2
-#define VTK_LINE 3
-#define VTK_POLY_LINE 4
-#define VTK_TRIANGLE 5
-#define VTK_TRIANGLE_STRIP 6
-#define VTK_POLYGON 7
-#define VTK_PIXEL 8
-#define VTK_QUAD 9
-#define VTK_TETRA 10
-#define VTK_VOXEL 11
-#define VTK_HEXAHEDRON 12
-#define VTK_WEDGE 13
-#define VTK_PYRAMID 14
-#define VTK_QUADRATIC_EDGE 21
-#define VTK_QUADRATIC_TRiTSIANGLE 22
-#define VTK_QUADRATIC_QUAD 23
-#define VTK_QUADRATIC_TETRA 24
-#define VTK_QUADRATIC_HEXAHEDRON 25
-#define VTK_CONVEX_POINT_SET 41
-#define VTK_PARAMETRIC_CURVE 51
-#define VTK_PARAMETRIC_SURFACE 52
-#define VTK_PARAMETRIC_TRI_SURFACE 53
-#define VTK_PARAMETRIC_QUAD_SURFACE 54
-#define VTK_PARAMETRIC_TETRA_REGION 55
-#define VTK_PARAMETRIC_HEX_REGION 56
+*>( );define VTK_EMPTY_CELL 0
+#define VTK_VERTEX 1
+#define VTK_POLY_VERTEX 2
+#define VTK_LINE 3
+#define VTK_POLY_LINE 4
+#define VTK_TRIANGLE 5
+#define VTK_TRIANGLE_STRIP 6
+#define VTK_POLYGON 7
+#define VTK_PIXEL 8
+#define VTK_QUAD 9
+#define VTK_TETRA 10
+#define VTK_VOXEL 11
+#define VTK_HEXAHEDRON 12
+#define VTK_WEDGE 13
+#define VTK_PYRAMID 14
+#define VTK_QUADRATIC_EDGE 21
+#define VTK_QUADRATIC_TRiTSIANGLE 22
+#define VTK_QUADRATIC_QUAD 23
+#define VTK_QUADRATIC_TETRA 24
+#define VTK_QUADRATIC_HEXAHEDRON 25
+#define VTK_CONVEX_POINT_SET 41
+#define VTK_PARAMETRIC_CURVE 51
+#define VTK_PARAMETRIC_SURFACE 52
+#define VTK_PARAMETRIC_TRI_SURFACE 53
+#define VTK_PARAMETRIC_QUAD_SURFACE 54
+#define VTK_PARAMETRIC_TETRA_REGION 55
+#define VTK_PARAMETRIC_HEX_REGION 56
*/
static MED::EGeometrieElement VTK2MED( const int theGeom )
case VTK_HEXAHEDRON: return MED::eHEXA8;
case VTK_WEDGE: return MED::ePENTA6;
case VTK_PYRAMID: return MED::ePYRA5;
+ case VTK_HEXAGONAL_PRISM: return MED::eOCTA12;
// QUADRATIC elements
case VTK_QUADRATIC_EDGE: return MED::eSEG3;
case VTK_QUADRATIC_TRIANGLE: return MED::eTRIA6;
case VTK_QUADRATIC_QUAD: return MED::eQUAD8;
+ case VTK_BIQUADRATIC_QUAD: return MED::eQUAD9;
case VTK_QUADRATIC_TETRA: return MED::eTETRA10;
case VTK_QUADRATIC_HEXAHEDRON:return MED::eHEXA20;
+ case VTK_TRIQUADRATIC_HEXAHEDRON :return MED::eHEXA27;
case VTK_CONVEX_POINT_SET: return MED::ePOLYEDRE;
}
/*!
\brief Adds field names, which used as specific fields with ids or elements
- (or something else). (Default: \93VISU_CELLS_MAPPER\94,\94VISU_POINTS_MAPPER\94,\94VISU_FILED\94)
+ (or something else). (Default: "VISU_CELLS_MAPPER","VISU_POINTS_MAPPER","VISU_FILED")
\param theFieldName field name
\sa eraseFromIgnoringFieldList()
*/
}
/*!
- \brief Sets output mesh name. (\93vtk2med\94 - default)
+ \brief Sets output mesh name. ("vtk2med" - default)
\param theMeshName mesh name
\sa getMeshName()
*/
}
/*!
- \brief Gets output mesh name. (\93vtk2med\94 - default)
+ \brief Gets output mesh name. ("vtk2med" - default)
\return mesh name
\sa setMeshName()
*/
MED::PWrapper myMed;
MED::PMeshInfo aMeshInfo;
int aMeshDimension = 3;
+ int aSpaceDimension = 3;
myMed = CrWrapper(myMEDFileName.c_str(),myVersion);
- aMeshInfo = myMed->CrMeshInfo(aMeshDimension,myMeshName.c_str());
+ aMeshInfo = myMed->CrMeshInfo(aMeshDimension,aSpaceDimension,myMeshName.c_str());
myMed->SetMeshInfo(aMeshInfo);
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_Vtk2MedConvertor.hxx
// Author : Eugeny NIKOLAEV, Open CASCADE SAS
//
-
#ifndef VISU_VTK2MEDCONVERTOR_H
#define VISU_VTK2MEDCONVERTOR_H
+#include "VISUConvertor.hxx"
+
#include <MED_Common.hxx>
#include <vtkIntArray.h>
#include <vtkDataSet.h>
class vtkUnstructuredGrid;
class vtkIntArray;
-class VISU_Vtk2MedConvertor
+class VISU_CONVERTOR_EXPORT VISU_Vtk2MedConvertor
{
public:
VISU_Vtk2MedConvertor();
VISU_Vtk2MedConvertor( const std::string theMEDFileName,
- const std::string theFirstVTKFileName );
+ const std::string theFirstVTKFileName );
VISU_Vtk2MedConvertor( const std::string theMEDFileName,
- const std::string theFirstVTKFileName,
- const TVectorString theDataVTKFileNames );
+ const std::string theFirstVTKFileName,
+ const TVectorString theDataVTKFileNames );
void setMEDFileName( const std::string theFileName );
// Fill container with indices of cells which match given type.
void
GetIdsOfCellsOfType( vtkDataSet* theInput, // input
- const int type, // input
- vtkIntArray *array ); // output
+ const int type, // input
+ vtkIntArray *array ); // output
// ret value 0 - OK
// ret value 1 - ERROR
int
Geometry2MED( vtkDataSet* aInput,
- MED::PWrapper myMed,
- MED::PMeshInfo aMeshInfo,
- TGeom2CellIds& outGeom2CellIdMap );
+ MED::PWrapper myMed,
+ MED::PMeshInfo aMeshInfo,
+ TGeom2CellIds& outGeom2CellIdMap );
// ret value 0 - OK
// ret value 1 - ERROR
int
Data2MED( std::vector<vtkDataSet*> theListForAdd,
- MED::PWrapper myMed,
- MED::PMeshInfo theMeshInfo,
- TGeom2CellIds& theGeom2CellIdMap );
+ MED::PWrapper myMed,
+ MED::PMeshInfo theMeshInfo,
+ TGeom2CellIds& theGeom2CellIdMap );
// ret value 0 - OK
// ret value 1 - ERROR
int
CreateElements( vtkDataSet* theInput,
- MED::PMeshInfo theMeshInfo,
- MED::PWrapper theMed,
- vtkIntArray* theCellsMapper,
- MED::EEntiteMaillage theEntity,
- int theVTKGeom,
- int nbPointsInGeom,
- std::vector<int>& theNumberingConvertor,
- TGeom2CellIds& theGeom2CellIdMap );
+ MED::PMeshInfo theMeshInfo,
+ MED::PWrapper theMed,
+ vtkIntArray* theCellsMapper,
+ MED::EEntiteMaillage theEntity,
+ int theVTKGeom,
+ int nbPointsInGeom,
+ std::vector<int>& theNumberingConvertor,
+ TGeom2CellIds& theGeom2CellIdMap );
// ret value 0 - OK
// ret value 1 - ERROR
int
CreatePolygons( vtkDataSet* theInput,
- MED::PMeshInfo theMeshInfo,
- MED::PWrapper theMed,
- vtkIntArray* theCellsMapper,
- MED::EEntiteMaillage theEntity,
- TGeom2CellIds& theGeom2CellIdMap );
+ MED::PMeshInfo theMeshInfo,
+ MED::PWrapper theMed,
+ vtkIntArray* theCellsMapper,
+ MED::EEntiteMaillage theEntity,
+ TGeom2CellIds& theGeom2CellIdMap );
// ret value 0 - OK
// ret value 1 - ERROR
int
CreatePolyedres( vtkDataSet* theInput,
- MED::PMeshInfo theMeshInfo,
- MED::PWrapper theMed,
- vtkIntArray* theCellsMapper,
- MED::EEntiteMaillage theEntity,
- TGeom2CellIds& theGeom2CellIdMap );
+ MED::PMeshInfo theMeshInfo,
+ MED::PWrapper theMed,
+ vtkIntArray* theCellsMapper,
+ MED::EEntiteMaillage theEntity,
+ TGeom2CellIds& theGeom2CellIdMap );
};
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Alexey Petrov
# Module : VISU
dist_libVISUEngine_la_SOURCES= VISU_Engine_i.cc
libVISUEngine_la_CPPFLAGS= $(KERNEL_CXXFLAGS) $(MED_CXXFLAGS) $(CORBA_CXXFLAGS) $(CORBA_INCLUDES) \
- -I$(top_builddir)/salome_adm/unix -I$(top_builddir)/idl
+ -I$(top_builddir)/idl
-libVISUEngine_la_LDFLAGS= $(KERNEL_LDFLAGS) -lSalomeContainer $(CORBA_LIBS) \
+libVISUEngine_la_LDFLAGS= $(KERNEL_LDFLAGS) -lSalomeIDLKernel -lSALOMELocalTrace -lSalomeNS -lSalomeContainer $(CORBA_LIBS) \
$(top_builddir)/idl/libSalomeIDLVISU.la
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VISU_Engine_i.hh"
#include "utilities.h"
#endif
#ifdef WNT
-#ifdef VISU_ENGINE_EXPORTS
+#if defined VISU_ENGINE_EXPORTS || defined VISUEngine_EXPORTS
#define VISU_ENGINE_EXPORT __declspec(dllexport)
#else
#define VISU_ENGINE_EXPORT __declspec(dllimport)
extern "C" {
VISU_ENGINE_EXPORT
- PortableServer::ObjectId *
+ PortableServer::ObjectId *
VISUEngine_factory(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId,
- const char *instanceName, const char *interfaceName)
+ const char *instanceName, const char *interfaceName)
{
MESSAGE("VisuEngine_factory : "<<interfaceName);
// Check session: MZN: 24.11.2006 PAL 13948
SALOME::Session_var aSession = SALOME::Session::_narrow(anObject);
if (CORBA::is_nil(aSession))
return NULL;
-
+
VISU::VISU_Gen_i * pVISU_Gen = new VISU::VISU_Gen_i(aSession, orb, poa, contId, instanceName, interfaceName);
return pVISU_Gen->getId() ;
}
namespace VISU{
//===========================================================================
VISU_Gen_i::VISU_Gen_i(SALOME::Session_ptr session,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName) :
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName) :
Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
{
_thisObj = this ;
_id = _poa->activate_object(_thisObj);
#ifndef WIN32
- Engines::Component_var aComponent = session->GetComponent("libVISUEngineImpl.so");
+ Engines::EngineComponent_var aComponent = session->GetComponent("libVISUEngineImpl.so");
#else
- Engines::Component_var aComponent = session->GetComponent("VISUEngineImpl.dll");
+ Engines::EngineComponent_var aComponent = session->GetComponent("VISUEngineImpl.dll");
#endif
myVisuGen = VISU::VISU_Gen::_narrow(aComponent);
- }
+ }
VISU_Gen_i::~VISU_Gen_i(){
if(MYDEBUG) MESSAGE("VISU_Gen_i::~VISU_Gen_i");
//===========================================================================
bool VISU_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
- const SALOMEDS::TMPFile & theStream,
- const char* theURL,
- bool isMultiFile)
+ const SALOMEDS::TMPFile & theStream,
+ const char* theURL,
+ bool isMultiFile)
{
return myVisuGen->Load(theComponent,theStream,theURL,isMultiFile);
}
bool VISU_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
- const SALOMEDS::TMPFile & theStream,
- const char* theURL,
- bool isMultiFile)
+ const SALOMEDS::TMPFile & theStream,
+ const char* theURL,
+ bool isMultiFile)
{
return Load(theComponent, theStream, theURL, isMultiFile);
}
char* VISU_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
- const char* aLocalPersistentID,
- CORBA::Boolean isMultiFile,
- CORBA::Boolean isASCII)
+ const char* aLocalPersistentID,
+ CORBA::Boolean isMultiFile,
+ CORBA::Boolean isASCII)
{
return myVisuGen->LocalPersistentIDToIOR(theSObject, aLocalPersistentID, isMultiFile, isASCII);
}
//===========================================================================
SALOMEDS::TMPFile* VISU_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
- const char* theURL,
- bool isMultiFile)
+ const char* theURL,
+ bool isMultiFile)
{
return myVisuGen->Save(theComponent,theURL,isMultiFile);
}
SALOMEDS::TMPFile* VISU_Gen_i::SaveASCII(SALOMEDS::SComponent_ptr theComponent,
- const char* theURL,
- bool isMultiFile)
+ const char* theURL,
+ bool isMultiFile)
{
return myVisuGen->Save(theComponent,theURL,isMultiFile);
}
char* VISU_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
- const char* IORString,
- CORBA::Boolean isMultiFile,
- CORBA::Boolean isASCII)
+ const char* IORString,
+ CORBA::Boolean isMultiFile,
+ CORBA::Boolean isASCII)
{
return myVisuGen->IORToLocalPersistentID(theSObject, IORString, isMultiFile, isASCII);
}
}
- SALOMEDS::SObject_ptr VISU_Gen_i::ImportTables(const char* theFileName){
- return myVisuGen->ImportTables(theFileName);
+ SALOMEDS::SObject_ptr VISU_Gen_i::ImportTables(const char* theFileName,
+ bool theFirstStrAsTitle)
+ {
+ return myVisuGen->ImportTables(theFileName,theFirstStrAsTitle);
}
CORBA::Boolean VISU_Gen_i::ExportTableToFile(SALOMEDS::SObject_ptr theTable,
- const char* theFileName)
+ const char* theFileName)
{
return myVisuGen->ExportTableToFile(theTable, theFileName);
}
}
- Mesh_ptr VISU_Gen_i::MeshOnEntity(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity)
+ Mesh_ptr VISU_Gen_i::MeshOnEntity(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity)
{
return myVisuGen->MeshOnEntity(theResult,theMeshName,theEntity);
}
- Mesh_ptr VISU_Gen_i::FamilyMeshOnEntity(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFamilyName)
+ Mesh_ptr VISU_Gen_i::FamilyMeshOnEntity(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFamilyName)
{
return myVisuGen->FamilyMeshOnEntity(theResult,theMeshName,theEntity,theFamilyName);
}
- Mesh_ptr VISU_Gen_i::GroupMesh(Result_ptr theResult,
- const char* theMeshName,
- const char* theGroupName)
+ Mesh_ptr VISU_Gen_i::GroupMesh(Result_ptr theResult,
+ const char* theMeshName,
+ const char* theGroupName)
{
return myVisuGen->GroupMesh(theResult,theMeshName,theGroupName);
}
- void VISU_Gen_i::RenameEntityInStudy(Result_ptr theResult, const char* theMeshName,
- VISU::Entity theEntity, const char* theNewName)
+ void VISU_Gen_i::RenameEntityInStudy(Result_ptr theResult, const char* theMeshName,
+ VISU::Entity theEntity, const char* theNewName)
{
myVisuGen->RenameEntityInStudy(theResult,theMeshName,theEntity,theNewName);
}
- void VISU_Gen_i::RenameFamilyInStudy(Result_ptr theResult, const char* theMeshName,
- VISU::Entity theEntity, const char* theFamilyName,
- const char* theNewName)
+ void VISU_Gen_i::RenameFamilyInStudy(Result_ptr theResult, const char* theMeshName,
+ VISU::Entity theEntity, const char* theFamilyName,
+ const char* theNewName)
{
myVisuGen->RenameFamilyInStudy(theResult,theMeshName,theEntity,theFamilyName,theNewName);
}
- void VISU_Gen_i::RenameGroupInStudy(Result_ptr theResult, const char* theMeshName,
- const char* theGroupName, const char* theNewName)
+ void VISU_Gen_i::RenameGroupInStudy(Result_ptr theResult, const char* theMeshName,
+ const char* theGroupName, const char* theNewName)
{
myVisuGen->RenameGroupInStudy(theResult,theMeshName,theGroupName,theNewName);
}
ScalarMap_ptr
VISU_Gen_i
- ::ScalarMapOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ ::ScalarMapOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return myVisuGen->ScalarMapOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
- GaussPoints_ptr
+ GaussPoints_ptr
VISU_Gen_i
- ::GaussPointsOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ ::GaussPointsOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return myVisuGen->GaussPointsOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
- DeformedShape_ptr
+ DeformedShape_ptr
VISU_Gen_i
- ::DeformedShapeOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ ::DeformedShapeOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return myVisuGen->DeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
- DeformedShapeAndScalarMap_ptr
+ DeformedShapeAndScalarMap_ptr
VISU_Gen_i
- ::ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ ::ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return DeformedShapeAndScalarMapOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
- DeformedShapeAndScalarMap_ptr
+ DeformedShapeAndScalarMap_ptr
VISU_Gen_i
- ::DeformedShapeAndScalarMapOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ ::DeformedShapeAndScalarMapOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return myVisuGen->DeformedShapeAndScalarMapOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
- Vectors_ptr
+ Vectors_ptr
VISU_Gen_i
- ::VectorsOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ ::VectorsOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return myVisuGen->VectorsOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
- IsoSurfaces_ptr
+ IsoSurfaces_ptr
VISU_Gen_i
- ::IsoSurfacesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ ::IsoSurfacesOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return myVisuGen->IsoSurfacesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
- StreamLines_ptr
+ StreamLines_ptr
VISU_Gen_i
- ::StreamLinesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ ::StreamLinesOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return myVisuGen->StreamLinesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
- CutPlanes_ptr
+ CutPlanes_ptr
VISU_Gen_i
- ::CutPlanesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ ::CutPlanesOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return myVisuGen->CutPlanesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
- CutLines_ptr
+ CutLines_ptr
VISU_Gen_i
- ::CutLinesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ ::CutLinesOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return myVisuGen->CutLinesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
- Plot3D_ptr
+ CutSegment_ptr
+ VISU_Gen_i
+ ::CutSegmentOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
+ {
+ return myVisuGen->CutSegmentOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
+ }
+
+
+ Plot3D_ptr
VISU_Gen_i
- ::Plot3DOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ ::Plot3DOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return myVisuGen->Plot3DOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
}
- Curve_ptr VISU_Gen_i::CreateCurve(Table_ptr theTable,
- CORBA::Long theHRow,
- CORBA::Long theVRow)
+ Curve_ptr VISU_Gen_i::CreateCurve(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow)
{
return myVisuGen->CreateCurve(theTable,theHRow,theVRow);
}
- Curve_ptr VISU_Gen_i::CreateCurveWithZ(Table_ptr theTable,
- CORBA::Long theHRow,
- CORBA::Long theVRow,
- CORBA::Long theZRow)
+ Curve_ptr VISU_Gen_i::CreateCurveWithZ(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow)
{
return myVisuGen->CreateCurveWithZ(theTable,theHRow,theVRow,theZRow);
}
+ Curve_ptr VISU_Gen_i::CreateCurveWithZExt(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow,
+ CORBA::Boolean theIsV2)
+ {
+ return myVisuGen->CreateCurveWithZExt(theTable,theHRow,theVRow,theZRow,theIsV2);
+ }
Container_ptr VISU_Gen_i::CreateContainer(){
return myVisuGen->CreateContainer();
}
+ Evolution_ptr VISU_Gen_i::CreateEvolution(XYPlot_ptr theXYPlot){
+ return myVisuGen->CreateEvolution(theXYPlot);
+ }
+
+
void VISU_Gen_i::DeleteResult(Result_ptr theResult){
myVisuGen->DeleteResult(theResult);
}
SALOMEDS::SObject_ptr VISU_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject,
- CORBA::Object_ptr theObject,
- const char* theName)
- throw (SALOME::SALOME_Exception)
+ SALOMEDS::SObject_ptr theSObject,
+ CORBA::Object_ptr theObject,
+ const char* theName)
+ throw (SALOME::SALOME_Exception)
{
return myVisuGen->PublishInStudy(theStudy, theSObject, theObject, theName);
}
-
+
CORBA::Boolean VISU_Gen_i::CanCopy(SALOMEDS::SObject_ptr theObject) {
return myVisuGen->CanCopy(theObject);
}
-
+
SALOMEDS::TMPFile* VISU_Gen_i::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID) {
return myVisuGen->CopyFrom(theObject, theObjectID);
}
-
+
CORBA::Boolean VISU_Gen_i::CanPaste(const char* theComponentName, CORBA::Long theObjectID) {
return myVisuGen->CanPaste(theComponentName, theObjectID);
}
-
+
SALOMEDS::SObject_ptr VISU_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream,
- CORBA::Long theObjectID,
- SALOMEDS::SObject_ptr theObject)
+ CORBA::Long theObjectID,
+ SALOMEDS::SObject_ptr theObject)
{
return myVisuGen->PasteInto(theStream,theObjectID,theObject);
}
Engines::TMPFile* VISU_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
CORBA::Boolean theIsPublished,
- CORBA::Boolean& theIsValidScript)
+ CORBA::Boolean theIsMultiFile,
+ CORBA::Boolean& theIsValidScript)
{
- return myVisuGen->DumpPython(theStudy, theIsPublished, theIsValidScript);
- }
+ return myVisuGen->DumpPython(theStudy, theIsPublished, theIsMultiFile, theIsValidScript);
+ }
VISU::ColoredPrs3dCache_ptr
VISU_Gen_i::
- CORBA::Long VISU_Gen_i::CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
- CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
- CORBA::Boolean isAuto, const char* name)
+ CORBA::Long VISU_Gen_i::CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
+ CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
+ CORBA::Boolean isAuto, const char* name)
{
return myVisuGen->CreateClippingPlane(X, Y, Z, dX, dY, dZ, isAuto, name);
}
-
- void VISU_Gen_i::EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
- CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
- CORBA::Boolean isAuto, const char* name)
+
+ void VISU_Gen_i::EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
+ CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
+ CORBA::Boolean isAuto, const char* name)
{
myVisuGen->EditClippingPlane(id, X, Y, Z, dX, dY, dZ, isAuto, name);
}
-
+
/* Returns clipping plane by its Id */
VISU::ClippingPlane* VISU_Gen_i::GetClippingPlane(CORBA::Long id)
{
return myVisuGen->GetClippingPlane(id);
}
-
+
/* Deletes clipping plane by its Id */
CORBA::Boolean VISU_Gen_i::DeleteClippingPlane(CORBA::Long id)
{
return myVisuGen->DeleteClippingPlane(id);
}
-
+
/* Applyes a clipping plane with Id to presentation thePrs */
CORBA::Boolean VISU_Gen_i::ApplyClippingPlane(Prs3d_ptr thePrs, CORBA::Long id)
{
return myVisuGen->ApplyClippingPlane(thePrs, id);
}
-
+
CORBA::Boolean VISU_Gen_i::DetachClippingPlane(Prs3d_ptr thePrs, CORBA::Long id)
{
return myVisuGen->DetachClippingPlane(thePrs, id);
}
-
+
/* Get number of clipping planes */
CORBA::Long VISU_Gen_i::GetClippingPlanesNb()
{
const VISU::double_array& theTStamps )
{
return myVisuGen->VTK2MED(theVTKFiles, theMEDFile, theMeshName, theTStamps);
- }
+ }
+ /* Load texture from file */
+ CORBA::Long VISU_Gen_i::LoadTexture(const char* theTextureFile)
+ {
+ return myVisuGen->LoadTexture(theTextureFile);
+ }
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __VISU_ENGINE_I_H__
#define __VISU_ENGINE_I_H__
virtual ViewManager_ptr GetViewManager();
- virtual SALOMEDS::SObject_ptr ImportTables(const char* theFileName);
- virtual CORBA::Boolean ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName);
+ virtual SALOMEDS::SObject_ptr ImportTables(const char* theFileName,
+ bool theFirstStrAsTitle = false);
+ virtual CORBA::Boolean ExportTableToFile(SALOMEDS::SObject_ptr theTable,
+ const char* theFileName);
//Create Result
virtual Result_ptr ImportFile(const char* theFileName);
virtual Result_ptr ImportMedField(SALOME_MED::FIELD_ptr theField);
//Create Presentation Of Submeshes
- virtual Mesh_ptr MeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity);
+ virtual Mesh_ptr MeshOnEntity(Result_ptr theResult, const char* theMeshName,
+ VISU::Entity theEntity);
virtual Mesh_ptr FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName,
VISU::Entity theEntity, const char* theFamilyName);
- virtual Mesh_ptr GroupMesh(Result_ptr theResult, const char* theMeshName, const char* theGroupName);
+ virtual Mesh_ptr GroupMesh(Result_ptr theResult, const char* theMeshName,
+ const char* theGroupName);
//Rename Presentation Of Submeshes
virtual void RenameEntityInStudy(Result_ptr theResult, const char* theMeshName,
VISU::Entity theEntity, const char* theNewName);
- virtual void RenameFamilyInStudy(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
+ virtual void RenameFamilyInStudy(Result_ptr theResult, const char* theMeshName,
+ VISU::Entity theEntity,
const char* theFamilyName, const char* theNewName);
virtual void RenameGroupInStudy (Result_ptr theResult, const char* theMeshName,
const char* theGroupName, const char* theNewName);
const char* theFieldName,
CORBA::Long theIteration);
+ virtual
+ CutSegment_ptr
+ CutSegmentOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration);
+
virtual
StreamLines_ptr
StreamLinesOnField(Result_ptr theResult,
virtual Table_ptr CreateTable(const char* theTableEntry);
virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
virtual Curve_ptr CreateCurveWithZ(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow);
+ virtual Curve_ptr CreateCurveWithZExt(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow,
+ CORBA::Boolean theIsV2);
virtual Container_ptr CreateContainer();
virtual Animation_ptr CreateAnimation(View3D_ptr theView3d);
+ virtual Evolution_ptr CreateEvolution(XYPlot_ptr theXYPlot);
virtual void DeleteResult(Result_ptr theResult);
virtual void DeletePrs3d(Prs3d_ptr thePrs3d);
// inherited methods from Engines::Component
virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
CORBA::Boolean theIsPublished,
+ CORBA::Boolean theIsMultiFile,
CORBA::Boolean& theIsValidScript);
virtual
const char* theMEDFile,
const char* theMeshName,
const VISU::double_array& theTStamps );
+
+ /* Load texture from file */
+ virtual CORBA::Long LoadTexture(const char* theTextureFile);
};
};
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# VISU VISUGUI : GUI of VISU component
-# File : Makefile.in
-# Author : Marc Tajchman (CEA)
-# Module : VISU
-# $Header$
-#
-include $(top_srcdir)/adm_local/unix/make_common_starter.am
-
-lib_LTLIBRARIES= libVISUGUITOOLS.la
-
-salomeinclude_HEADERS= \
- VisuGUI_TableDlg.h \
- VisuGUITools.h
-
-dist_libVISUGUITOOLS_la_SOURCES= VisuGUI_TableDlg.cxx
-
-MOC_FILES= VisuGUI_TableDlg_moc.cxx
-nodist_libVISUGUITOOLS_la_SOURCES=$(MOC_FILES)
-
-# additionnal information to compil and link file
-libVISUGUITOOLS_la_CPPFLAGS= -ftemplate-depth-32 \
- $(QT_INCLUDES) $(VTK_INCLUDES) @CAS_CPPFLAGS@ @CAS_CXXFLAGS@ \
- $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(QWT_INCLUDES) \
- $(KERNEL_CXXFLAGS) $(GUI_CXXFLAGS) $(BOOST_CPPFLAGS)
-
-libVISUGUITOOLS_la_LDFLAGS= \
- $(KERNEL_LDFLAGS) -lSALOMELocalTrace \
- $(GUI_LDFLAGS) -lCAM \
- $(QWT_LIBS)
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : VisuGUITools.h
-// Author : Oleg UVAROV
-// Module : VISU
-//
-#ifndef _VisuGUITools_H_
-#define _VisuGUITools_H_
-
-#ifdef WNT
- #if defined VISU_GUITOOLS_EXPORTS
- #if defined WIN32
- #define VISU_GUITOOLS_EXPORT __declspec( dllexport )
- #else
- #define VISU_GUITOOLS_EXPORT
- #endif
- #else
- #if defined WIN32
- #define VISU_GUITOOLS_EXPORT __declspec( dllimport )
- #else
- #define VISU_GUITOOLS_EXPORT
- #endif
- #endif
-#else
- #define VISU_GUITOOLS_EXPORT
-#endif
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : VisuGUI_TableDlg.cxx
-// Author : Vadim SANDLER
-// Module : SALOME
-//
-#include "VisuGUI_TableDlg.h"
-
-#include "SUIT_Tools.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-
-#include "LightApp_Application.h"
-
-#include "CAM_Module.h"
-
-#include "SALOMEDSClient_Study.hxx"
-#include "SALOMEDSClient_GenericAttribute.hxx"
-#include "SALOMEDSClient_AttributeTableOfInteger.hxx"
-#include "SALOMEDSClient_AttributeTableOfReal.hxx"
-#include "SALOMEDSClient_StudyBuilder.hxx"
-
-#include <QLayout>
-#include <QValidator>
-#include <QTableWidget>
-#include <QTabWidget>
-#include <QList>
-#include <QVector>
-#include <QInputDialog>
-#include <QLabel>
-#include <QIntValidator>
-#include <QDoubleValidator>
-#include <QKeyEvent>
-#include <QHeaderView>
-
-#include "utilities.h"
-
-using namespace std;
-
-#define MARGIN_SIZE 11
-#define SPACING_SIZE 6
-#define SPACER_SIZE 5
-#define MIN_TABLE_WIDTH 200
-#define MIN_TABLE_HEIGHT 200
-
-NumDelegateItem::NumDelegateItem( QObject* parent, NumValidator mode )
- : QItemDelegate( parent ),
- myMode( mode )
-{
-}
-
-NumDelegateItem::~NumDelegateItem()
-{
-}
-
-QWidget * NumDelegateItem::createEditor( QWidget * parent,
- const QStyleOptionViewItem & option,
- const QModelIndex & index ) const
-{
- QLineEdit *editor = new QLineEdit(parent);
- switch ( myMode )
- {
- case NV_Int:
- editor->setValidator( new QIntValidator( editor ) );
- break;
- case NV_Real:
- editor->setValidator( new QDoubleValidator( editor ) );
- break;
- default:
- editor->setText( "No validator!" );
- }
-
- return editor;
-}
-
-void NumDelegateItem::setEditorData( QWidget * editor,
- const QModelIndex & index ) const
-{
- QLineEdit *aLE = qobject_cast<QLineEdit*>(editor);
- if ( !aLE )
- return;
-
- switch ( myMode )
- {
- case NV_Int:
- {
- int value = index.model()->data(index, Qt::DisplayRole).toInt();
- aLE->setText( QString("%1").arg( value ) );
- break;
- }
- case NV_Real:
- {
- double value = index.model()->data(index, Qt::DisplayRole).toDouble();
- aLE->setText( QString("%1").arg( value ) );
- break;
- }
- default:
- aLE->setText( "No validator!!!" );
- }
-}
-
-
-
-
-
-/*class VisuGUI_Table : public QTableWidget {
-public:
- VisuGUI_Table( Orientation orient, QWidget* parent = 0 )
- : QTableWidget( parent ), myValidator( 0 ), myOrientation( orient ) {}
- VisuGUI_Table( Orientation orient, int numRows, int numCols, QWidget* parent = 0 )
- : QTableWidget( numRows, numCols, parent ), myValidator( 0 ), myOrientation( orient ) {}
-
- void setValidator( QValidator* v = 0 ) { myValidator = v; }
- bool isEditing() const { return QTable::isEditing(); }
-
-protected:
- QWidget* createEditor ( int row, int col, bool initFromCell ) const
- {
- bool testUnits = ( myOrientation == Qt::Horizontal && col == 0 ) || ( myOrientation == Qt::Vertical && row == 0 );
- QWidget* wg = QTable::createEditor( row, col, initFromCell );
- if ( wg && wg->inherits("QLineEdit") && myValidator && !testUnits )
- (( QLineEdit*)wg)->setValidator( myValidator );
- return wg;
- }
-
-protected:
- QValidator* myValidator;
- Orientation myOrientation;
- };*/
-
-/*!
- Constructor
-*/
-VisuGUI_TableDlg::VisuGUI_TableDlg( QWidget* parent,
- _PTR(SObject) obj,
- bool edit,
- int which,
- Qt::Orientation orient,
- bool showColumnTitles )
- : QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
- myIntTable( 0 ), myRealTable( 0 )
-{
- setWindowTitle( edit ? tr( "EDIT_TABLE_TLT" ) : tr( "VIEW_TABLE_TLT" ) );
- setSizeGripEnabled( true );
-
- myObject = obj;
- bool bHasIntTable = false;
- bool bHasRealTable = false;
- if ( myObject ) {
- _PTR(GenericAttribute) anAttr;
- bHasIntTable = myObject->FindAttribute( anAttr, "AttributeTableOfInteger");
- bHasRealTable = myObject->FindAttribute( anAttr, "AttributeTableOfReal");
- }
-
- QVBoxLayout* mainLayout = new QVBoxLayout( this );
- mainLayout->setMargin( MARGIN_SIZE );
- mainLayout->setSpacing( SPACING_SIZE );
-
- bool bDoInt = which == ttInt || which == ttBoth || which == ttAuto && bHasIntTable;
- bool bDoReal = which == ttReal || which == ttBoth || which == ttAuto && bHasRealTable;
-
- QWidget* top;
- QVBoxLayout* tl;
- if ( bDoInt && bDoReal ) {
- top = new QTabWidget( this );
- //( ( QTabWidget* ) top) ->setMargin( MARGIN_SIZE );
- }
- else {
- top = new QWidget( this );
- tl = new QVBoxLayout( top ); tl->setMargin( 0 ); tl->setSpacing( SPACING_SIZE );
- }
-
- if ( bDoInt ) {
- myIntTable = new VisuGUI_TableWidget( top, "myIntTable", edit, orient, showColumnTitles );
- //myIntTable->getTable()->setValidator( new QIntValidator( this ) );
- //QAbstractItemDelegate* item = myIntTable->getTable()->itemDelegate();
- myIntTable->getTable()->setItemDelegate( new NumDelegateItem( myIntTable, NumDelegateItem::NV_Int ) );
- //item->deleteLater();
-
- if ( bDoInt && bDoReal )
- ( ( QTabWidget* )top )->addTab( myIntTable, tr( "TABLE_OF_INTEGER_TLT" ) );
- else
- tl->addWidget( myIntTable );
- }
- if ( bDoReal ) {
- myRealTable = new VisuGUI_TableWidget( top, "myRealTable", edit, orient, showColumnTitles );
- //myRealTable->getTable()->setValidator( new QDoubleValidator( this ) );
- //QAbstractItemDelegate* item = myIntTable->getTable()->itemDelegate();
- myRealTable->getTable()->setItemDelegate( new NumDelegateItem( myRealTable, NumDelegateItem::NV_Real ) );
- //item->deleteLater();
- if ( bDoInt && bDoReal )
- ( ( QTabWidget* )top )->addTab( myRealTable, tr( "TABLE_OF_REAL_TLT" ) );
- else
- tl->addWidget( myRealTable );
- }
- if ( !bDoInt && !bDoReal ) {
- QLabel *dumbLabel = new QLabel( tr( "ERR_TABLE_NOT_AVAILABLE" ), top );
- dumbLabel->setAlignment( Qt::AlignCenter );
- tl->addWidget( dumbLabel );
- }
-
- QHBoxLayout* btnLayout = new QHBoxLayout;
- btnLayout->setMargin( 0 ); btnLayout->setSpacing( SPACING_SIZE );
-
- myOKBtn = new QPushButton( tr( "BUT_OK" ), this );
- myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this );
- if ( edit ) {
- myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this );
- btnLayout->addWidget( myOKBtn );
- btnLayout->addItem( new QSpacerItem( SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
- btnLayout->addWidget( myCancelBtn );
- btnLayout->addWidget( myHelpBtn );
- connect( myOKBtn, SIGNAL( clicked() ), this, SLOT( onOK() ) );
- connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
- }
- else {
- btnLayout->addWidget( myOKBtn );
- btnLayout->addItem( new QSpacerItem( SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
- btnLayout->addWidget( myHelpBtn );
- connect( myOKBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
- }
- connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
-
- mainLayout->addWidget( top );
- mainLayout->addLayout( btnLayout );
-
- initDlg();
- resize( 500, 400 );
- SUIT_Tools::centerWidget( this, parent );
-}
-
-/*!
- Destructor
-*/
-VisuGUI_TableDlg::~VisuGUI_TableDlg()
-{
-}
-
-/*!
- <OK> button slot, saves table(s)
- Called only in create/edit mode ( <edit> parameter for constructor is true )
-*/
-void VisuGUI_TableDlg::onOK()
-{
- myOKBtn->setFocus(); // accept possible changes
- bool done = true;
-
- if ( myObject ) {
- _PTR(Study) study = myObject->GetStudy();
- _PTR(AttributeTableOfInteger) tblIntAttr;
- _PTR(AttributeTableOfReal) tblRealAttr;
-
- if ( study ) {
- _PTR(StudyBuilder) builder = study->NewBuilder();
- builder->NewCommand(); // start transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- try {
- if ( myIntTable ) {
- builder->RemoveAttribute( myObject, "AttributeTableOfInteger" );
- tblIntAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfInteger" );
-
- int i;
- int nbRows = myIntTable->getNumRows();
- int nbCols = myIntTable->getNumCols();
- QString tlt = myIntTable->getTableTitle();
- QStringList rowTitles, colTitles, units;
- myIntTable->getRowTitles( rowTitles );
- myIntTable->getColTitles( colTitles );
- myIntTable->getUnits( units );
-
- if ( nbRows > 0) {
- // data
- int nRow = 0;
- tblIntAttr->SetNbColumns( nbCols );
- for ( i = 0; i < nbRows; i++ ) {
- QStringList data;
- myIntTable->getRowData( i, data );
- bool bEmptyRow = true;
- for ( int j = 0; j < data.count(); j++ ) {
- if ( !data[ j ].isNull() ) {
- tblIntAttr->PutValue( data[ j ].toInt(), nRow+1, j+1 );
- bEmptyRow = false;
- }
- }
- if ( !bEmptyRow ) { // Skip rows with no data !!!
- // set row title
- tblIntAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() );
- // set row unit
- tblIntAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() );
- nRow++;
- }
- }
- if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!!
- // column titles
- for ( i = 0; i < colTitles.count(); i++ )
- tblIntAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() );
- }
- }
- // title
- tblIntAttr->SetTitle( (const char*)myIntTable->getTableTitle().toLatin1() );
- }
- if ( myRealTable ) {
- builder->RemoveAttribute( myObject, "AttributeTableOfReal" );
- tblRealAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfReal" );
-
- int i;
- int nbRows = myRealTable->getNumRows();
- int nbCols = myRealTable->getNumCols();
- QString tlt = myRealTable->getTableTitle();
- QStringList rowTitles, colTitles, units;
- myRealTable->getRowTitles( rowTitles );
- myRealTable->getColTitles( colTitles );
- myRealTable->getUnits( units );
-
- if ( nbRows > 0) {
- // data
- int nRow = 0;
- tblRealAttr->SetNbColumns( nbCols );
- for ( i = 0; i < nbRows; i++ ) {
- QStringList data;
- myRealTable->getRowData( i, data );
- bool bEmptyRow = true;
- for ( int j = 0; j < data.count(); j++ ) {
- if ( !data[ j ].isNull() ) {
- tblRealAttr->PutValue( data[ j ].toDouble(), nRow+1, j+1 );
- bEmptyRow = false;
- }
- }
- if ( !bEmptyRow ) { // Skip rows with no data !!!
- // set row title
- tblRealAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() );
- // set row unit
- tblRealAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() );
- nRow++;
- }
- }
- if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!!
- // column titles
- for ( i = 0; i < colTitles.count(); i++ )
- tblRealAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() );
- }
- }
- // title
- tblRealAttr->SetTitle( (const char*)myRealTable->getTableTitle().toLatin1() );
- }
- if ( myIntTable || myRealTable)
- builder->CommitCommand(); // commit transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!
- else
- builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!
- }
- catch( ... ) {
- MESSAGE("VisuGUI_TableDlg::onOK : Exception has been caught !!!");
- builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!
- done = false;
- SUIT_MessageBox::critical ( this, tr("ERR_ERROR"), tr("ERR_APP_EXCEPTION") );
- }
- }
- }
- if ( done )
- accept();
-}
-
-/*!
- <Help> button slot, shows corresponding help page
-*/
-void VisuGUI_TableDlg::onHelp()
-{
- QString aHelpFileName = "/files/displaying_tables.htm";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
- app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
- else {
- QString platform;
-#ifdef WIN32
- platform = "winapplication";
-#else
- platform = "application";
-#endif
- SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
- }
-}
-
-/*!
- Populates table with data
-*/
-void VisuGUI_TableDlg::initDlg()
-{
- int i, j;
- if ( myObject ) {
- _PTR(GenericAttribute) anAttr;
- _PTR(AttributeTableOfInteger) tblIntAttr;
- _PTR(AttributeTableOfReal) tblRealAttr;
- if ( myObject->FindAttribute( anAttr, "AttributeTableOfInteger") ) {
- tblIntAttr = anAttr;
- }
- if ( myObject->FindAttribute( anAttr, "AttributeTableOfReal") ) {
- tblRealAttr = anAttr;
- }
- // Table of integer
- if ( tblIntAttr && myIntTable ) {
- try {
- // title
- myIntTable->setTableTitle( tblIntAttr->GetTitle().c_str() );
- // nb of rows & cols
- int nbRows = tblIntAttr->GetNbRows() ;
- int nbCols = tblIntAttr->GetNbColumns();
- myIntTable->setNumRows( nbRows );
- myIntTable->setNumCols( nbCols );
- // rows titles
- QStringList strlist;
- vector<string> rowTitles = tblIntAttr->GetRowTitles();
- for ( i = 0; i < nbRows; i++ ) {
- if ( rowTitles.size() > 0 )
- strlist.append( rowTitles[i].c_str() );
- else
- strlist.append( "" );
- }
- myIntTable->setRowTitles( strlist );
- // columns titles
- strlist.clear();
- vector<string> colTitles = tblIntAttr->GetColumnTitles();
- for ( i = 0; i < nbCols; i++ ) {
- if ( colTitles.size() > 0 )
- strlist.append( colTitles[i].c_str() );
- else
- strlist.append( "" );
- }
- myIntTable->setColTitles( strlist );
- // units
- strlist.clear();
- vector<string> rowUnits = tblIntAttr->GetRowUnits();
- if ( rowUnits.size() > 0 ) {
- for ( i = 0; i < nbRows; i++ )
- strlist.append( rowUnits[i].c_str() );
- myIntTable->setUnits( strlist );
- }
- // data
- for ( i = 1; i <= nbRows; i++ ) {
- strlist.clear();
- for ( j = 1; j <= nbCols; j++ ) {
- if ( tblIntAttr->HasValue( i, j ) )
- strlist.append( QString::number( tblIntAttr->GetValue( i, j ) ) );
- else
- strlist.append( QString::null );
- }
- myIntTable->setRowData( i-1, strlist );
- }
- myIntTable->adjustTable();
- }
- catch( ... ) {
- MESSAGE("VisuGUI_TableDlg::initDlg : Exception has been caught !!!");
- }
- }
- // Table of real
- if ( tblRealAttr && myRealTable ) {
- try {
- // title
- myRealTable->setTableTitle( tblRealAttr->GetTitle().c_str() );
- // nb of rows & cols
- int nbRows = tblRealAttr->GetNbRows() ;
- int nbCols = tblRealAttr->GetNbColumns();
- myRealTable->setNumRows( nbRows );
- myRealTable->setNumCols( nbCols );
- // rows titles
- QStringList strlist;
- vector<string> rowTitles = tblRealAttr->GetRowTitles();
- for ( i = 0; i < nbRows; i++ ) {
- if ( rowTitles.size() > 0 )
- strlist.append( rowTitles[i].c_str() );
- else
- strlist.append( "" );
- }
- myRealTable->setRowTitles( strlist );
- // columns titles
- strlist.clear();
- vector<string> colTitles = tblRealAttr->GetColumnTitles();
- for ( i = 0; i < nbCols; i++ ) {
- if ( colTitles.size() > 0 )
- strlist.append( colTitles[i].c_str() );
- else
- strlist.append( "" );
- }
- myRealTable->setColTitles( strlist );
- // units
- strlist.clear();
- vector<string> rowUnits = tblRealAttr->GetRowUnits();
- if ( rowUnits.size() > 0 ) {
- for ( i = 0; i < nbRows; i++ )
- strlist.append( rowUnits[i].c_str() );
- myRealTable->setUnits( strlist );
- }
- // data
- for ( i = 1; i <= nbRows; i++ ) {
- strlist.clear();
- for ( j = 1; j <= nbCols; j++ ) {
- if ( tblRealAttr->HasValue( i, j ) )
- strlist.append( QString::number( tblRealAttr->GetValue( i, j ) ) );
- else
- strlist.append( QString::null );
- }
- myRealTable->setRowData( i-1, strlist );
- }
- myRealTable->adjustTable();
- }
- catch( ... ) {
- MESSAGE("VisuGUI_TableDlg::initDlg : Exception has been caught !!!");
- }
- }
- }
-}
-
-/*!
- Provides help on F1 button click
-*/
-void VisuGUI_TableDlg::keyPressEvent( QKeyEvent* e )
-{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
-
- if ( e->key() == Qt::Key_F1 )
- {
- e->accept();
- onHelp();
- }
-}
-
-/*!
- Constructor
-*/
-VisuGUI_TableWidget::VisuGUI_TableWidget( QWidget* parent,
- const char* name,
- bool edit,
- Qt::Orientation orient,
- bool showColumnTitles )
- : QWidget( parent ), myOrientation( orient )
-{
- QGridLayout* mainLayout = new QGridLayout( this );
- mainLayout->setMargin( 0 );
- mainLayout->setSpacing( SPACING_SIZE );
-
- myTitleEdit = new QLineEdit( this );
- myTitleEdit->setAlignment( Qt::AlignCenter );
- myTitleEdit->setReadOnly( !edit );
- QFont fnt = myTitleEdit->font();
- fnt.setBold( true );
- myTitleEdit->setFont( fnt );
-
- //myTable = new VisuGUI_Table( orient, this );
- myTable = new QTableWidget( 5, 5, this );
- //myTable->setNumRows( 5 );
- //myTable->setNumCols( 5 );
- myTable->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
- myTable->setMinimumSize( MIN_TABLE_WIDTH, MIN_TABLE_HEIGHT );
- myTable->setSelectionMode( QAbstractItemView::SingleSelection );
- myTable->setShowGrid( true );
- myTable->horizontalHeader()->setMovable( false );
- myTable->verticalHeader()->setMovable( false );
- //myTable->setColumnMovingEnabled( false );
- //myTable->setRowMovingEnabled( false );
- myTable->setDragEnabled( false );
- //myTable->setReadOnly( !edit );
- myTable->setEditTriggers( edit ? QAbstractItemView::AllEditTriggers : QAbstractItemView::NoEditTriggers );
-
- setUnitsTitle( tr( "UNITS_TLT" ) );
-
- if ( !showColumnTitles ) {
- if ( myOrientation == Qt::Horizontal ) {
- myTable->horizontalHeader()->hide();
- //myTable->setTopMargin( 0 );
- }
- else {
- myTable->verticalHeader()->hide();
- //myTable->setLeftMargin( 0 );
- }
- }
-
- mainLayout->addWidget( myTitleEdit, 0, 0 );
- mainLayout->addWidget( myTable, 1, 0 );
-
- if ( edit ) {
- myAddRowBtn = new QPushButton( tr( "ADD_ROW_BTN" ), this );
- myDelRowBtn = new QPushButton( tr( "REMOVE_ROW_BTN" ), this );
- myAddColBtn = new QPushButton( tr( "ADD_COLUMN_BTN" ), this );
- myDelColBtn = new QPushButton( tr( "REMOVE_COLUMN_BTN" ), this );
- myAdjustBtn = new QPushButton( tr( "ADJUST_CELLS_BTN" ), this );
- mySelectAllBtn = new QPushButton( tr( "SELECT_ALL_BTN" ), this );
- myClearBtn = new QPushButton( tr( "CLEAR_BTN"), this );
- QVBoxLayout* btnLayout = new QVBoxLayout; btnLayout->setMargin( 0 ); btnLayout->setSpacing( SPACING_SIZE );
- btnLayout->addWidget( myAddRowBtn );
- btnLayout->addWidget( myDelRowBtn );
- btnLayout->addWidget( myAddColBtn );
- btnLayout->addWidget( myDelColBtn );
- btnLayout->addStretch();
- btnLayout->addWidget( myAdjustBtn );
- btnLayout->addStretch();
- btnLayout->addWidget( mySelectAllBtn );
- btnLayout->addWidget( myClearBtn );
- mainLayout->addLayout( btnLayout, 1, 1 );
- connect( myTable, SIGNAL( selectionChanged() ), this, SLOT( updateButtonsState() ) );
- connect( myTable, SIGNAL( currentChanged( int, int) ), this, SLOT( updateButtonsState() ) );
- connect( myAddRowBtn, SIGNAL( clicked() ), this, SLOT( addRow() ) );
- connect( myAddColBtn, SIGNAL( clicked() ), this, SLOT( addCol() ) );
- connect( myDelRowBtn, SIGNAL( clicked() ), this, SLOT( delRow() ) );
- connect( myDelColBtn, SIGNAL( clicked() ), this, SLOT( delCol() ) );
- connect( myAdjustBtn, SIGNAL( clicked() ), this, SLOT( adjustTable() ) );
- connect( mySelectAllBtn, SIGNAL( clicked() ), this, SLOT( selectAll() ) );
- connect( myClearBtn, SIGNAL( clicked() ), this, SLOT( clearTable() ) );
- myTable->horizontalHeader()->installEventFilter( this );
- myTable->verticalHeader()->installEventFilter( this );
- myTable->installEventFilter( this );
- }
- updateButtonsState();
-}
-/*!
- Destructor
-*/
-VisuGUI_TableWidget::~VisuGUI_TableWidget()
-{
-}
-/*!
- Sets table title
-*/
-void VisuGUI_TableWidget::setTableTitle( const QString& title )
-{
- myTitleEdit->setText( title );
-}
-/*!
- Gets table title
-*/
-QString VisuGUI_TableWidget::getTableTitle()
-{
- return myTitleEdit->text();
-}
-/*!
- Sets total number of rows
-*/
-void VisuGUI_TableWidget::setNumRows( const int num )
-{
- myOrientation == Qt::Horizontal ? myTable->setRowCount( num ) : myTable->setColumnCount( num );
-}
-/*!
- Gets total number of rows
-*/
-int VisuGUI_TableWidget::getNumRows()
-{
- return myOrientation == Qt::Horizontal ? myTable->rowCount() : myTable->columnCount();
-}
-/*!
- Sets total number of columns
-*/
-void VisuGUI_TableWidget::setNumCols( const int num )
-{
- // !!! first column contains units !!!
- myOrientation == Qt::Horizontal ? myTable->setColumnCount( num+1 ) : myTable->setRowCount( num+1 );
-// myOrientation == Qt::Horizontal ? myTable->setColumnReadOnly( 0, true ) : myTable->setRowReadOnly( 0, true );
-}
-/*!
- Gets total number of columns
-*/
-int VisuGUI_TableWidget::getNumCols()
-{
- // !!! first column contains units !!!
- return myOrientation == Qt::Horizontal ? myTable->columnCount()-1 : myTable->rowCount()-1;
-}
-/*!
- Sets rows titles
-*/
-void VisuGUI_TableWidget::setRowTitles( QStringList& tlts )
-{
- QStringList aLabels;
- for ( int i = 0; i < tlts.count(); i++ )
- tlts[i].isNull() ? aLabels.append("") : aLabels.append( tlts[i] );
-
- myOrientation == Qt::Horizontal ?
- myTable->setVerticalHeaderLabels( aLabels ) :
- myTable->setHorizontalHeaderLabels( aLabels );
-
- // myTable->verticalHeader()->setLabel( i, tlts[i] ) :
- //myTable->horizontalHeader()->setLabel( i, tlts[i] );
- //}
-}
-/*!
- Gets rows titles
-*/
-void VisuGUI_TableWidget::getRowTitles( QStringList& tlts )
-{
- tlts.clear();
- if ( myOrientation == Qt::Horizontal ) {
- for ( int i = 0; i < myTable->rowCount(); i++ ) {
- tlts.append( myTable->verticalHeaderItem(i) ? myTable->verticalHeaderItem(i)->text() : "" );
- }
- }
- else {
- for ( int i = 0; i < myTable->columnCount(); i++ ) {
- tlts.append( myTable->horizontalHeaderItem(i) ? myTable->horizontalHeaderItem(i)->text() : "" );
- }
- }
-}
-/*!
- Sets columns titles
-*/
-void VisuGUI_TableWidget::setColTitles( QStringList& tlts )
-{
- QStringList aLabels;
-
- // !!! first column contains units !!!
- aLabels.append(""); // it'll be initialized below - in setUnitsTitle() method
-
- for ( int i = 0; i < tlts.count(); i++ )
- tlts[i].isNull() ? aLabels.append("") : aLabels.append( tlts[i] );
-
- myOrientation == Qt::Horizontal ?
- myTable->setHorizontalHeaderLabels( aLabels ) :
- myTable->setVerticalHeaderLabels( aLabels );
-
- setUnitsTitle( tr( "UNITS_TLT" ) );
-}
-/*!
- Sets columns titles
-*/
-void VisuGUI_TableWidget::getColTitles( QStringList& tlts )
-{
- // !!! first column contains units !!!
- tlts.clear();
- if ( myOrientation == Qt::Horizontal ) {
- for ( int i = 1; i < myTable->columnCount(); i++ ) {
- tlts.append( myTable->horizontalHeaderItem(i) ? myTable->horizontalHeaderItem(i)->text() : "" );
- }
- }
- else {
- for ( int i = 1; i < myTable->rowCount(); i++ ) {
- tlts.append( myTable->verticalHeaderItem(i) ? myTable->verticalHeaderItem(i)->text() : "" );
- }
- }
-}
-/*!
- Sets units title
-*/
-void VisuGUI_TableWidget::setUnitsTitle( const QString& tlt ) {
- // !!! first column contains units !!!
- myTable->model()->setHeaderData( 0, myOrientation, QVariant(tlt.isNull() ? "" : tlt), Qt::DisplayRole );
-}
-/*!
- Sets units
-*/
-void VisuGUI_TableWidget::setUnits( QStringList& units )
-{
- QAbstractTableModel* aModel = qobject_cast<QAbstractTableModel*>( myTable->model() );
- if ( aModel )
- {
- QModelIndex anIndex;
- for ( int i = 0; i < units.count(); i++ )
- {
- myOrientation == Qt::Horizontal ?
- anIndex = aModel->index( i, 0 ) :
- anIndex = aModel->index( 0, i );
-
- aModel->setData( anIndex, QVariant( units[i].isNull() ? "" : units[i] ) );
- }
- }
-}
-/*!
- Gets units
-*/
-void VisuGUI_TableWidget::getUnits( QStringList& units )
-{
- units.clear();
- QAbstractTableModel* aModel = qobject_cast<QAbstractTableModel*>( myTable->model() );
- if ( aModel )
- {
- if ( myOrientation == Qt::Horizontal )
- {
- for ( int i = 0; i < myTable->rowCount(); i++ )
- units.append( aModel->index( i, 0 ).data().toString() );
- }
- else {
- for ( int i = 0; i < myTable->columnCount(); i++ )
- units.append( aModel->index( 0, i ).data().toString() );
- }
- }
-}
-/*!
- Sets row data
-*/
-void VisuGUI_TableWidget::setRowData( int row, QStringList& data )
-{
- QAbstractTableModel* aModel = qobject_cast<QAbstractTableModel*>( myTable->model() );
- if ( aModel )
- {
- QModelIndex anIndex;
- if ( row >= 0 && row < getNumRows() ) {
- for ( int i = 0; i < data.count(); i++ )
- {
- myOrientation == Qt::Horizontal ? anIndex = aModel->index( row, i+1 ) :
- anIndex = aModel->index( i+1, row );
- aModel->setData( anIndex, QVariant( data[i] ) );
-
- }
- }
- }
-}
-/*!
- Gets row data
-*/
-void VisuGUI_TableWidget::getRowData( int row, QStringList& data )
-{
- data.clear();
- QAbstractTableModel* aModel = qobject_cast<QAbstractTableModel*>( myTable->model() );
- if ( aModel )
- {
- if ( row >= 0 && row < getNumRows() )
- {
- if ( myOrientation == Qt::Horizontal )
- {
- for ( int i = 1; i < myTable->columnCount(); i++ )
- data.append( aModel->index( row, i ).data().toString() );
- }
- else {
- for ( int i = 1; i < myTable->rowCount(); i++ )
- data.append( aModel->index( i, row ).data().toString() );
- }
- }
- }
-}
-/*!
- Adjusts table cell to see contents, <Adjust Cells> button slot
-*/
-void VisuGUI_TableWidget::adjustTable()
-{
- myTable->resizeRowsToContents();
- myTable->resizeColumnsToContents();
-}
-/*!
- Called when selection changed in table
-*/
-void VisuGUI_TableWidget::updateButtonsState()
-{
- if ( myTable->editTriggers() == QAbstractItemView::NoEditTriggers )
- return;
- bool bDR = false; // <Delete Row(s)>
- bool bDC = false; // <Delete Column(s)>
- bool bSA = false; // <Select All>
- bool bCT = false; // <Clear>
- int i;
- //TO DO column/row selection check
- /*int c = myOrientation == Qt::Horizontal ? 0 : 1;
- for ( i = c; i < myTable->rowCount(); i++ ) {
-
- if ( myTable->isRowSelected( i, true ) )
- bDR = true;
- else
- bSA = true;
- }
- c = myOrientation == Qt::Horizontal ? 1 : 0;
- for ( i = c; i < myTable->columnCount(); i++ ) {
- if ( myTable->isColumnSelected( i, true ) )
- bDC = true;
- else
- bSA = true;
- }*/
- /*int nbSel = myTable->numSelections();
- for ( i = 0; i < nbSel; i++ ) {
- QTableSelection ts = myTable->selection( i );
- for ( int j = ts.topRow(); j < ts.bottomRow()+1; j++) {
- for ( int k = ts.leftCol(); k < ts.rightCol()+1; k++) {
- if ( myTable->item( j, k ) )
- bCT = true;
- }
- }
- }*/
- QList<QTableWidgetItem*> aSelection = myTable->selectedItems();
- QList<QTableWidgetItem*>::ConstIterator anIt = aSelection.constBegin(),
- anEndIt = aSelection.constEnd();
- for ( ; anIt != anEndIt; anIt++ )
- {
- if( *anIt )
- {
- bCT = true;
- break;
- }
- }
-
- if ( myTable->item( myTable->currentRow(), myTable->currentColumn() ) )
- bCT = true;
- myDelRowBtn->setEnabled( bDR );
- myDelColBtn->setEnabled( bDC );
- mySelectAllBtn->setEnabled( bSA );
- myClearBtn->setEnabled( bCT );
-}
-/*!
- <Add row> button slot
-*/
-void VisuGUI_TableWidget::addRow()
-{
- myTable->insertRow( myTable->rowCount() );
- updateButtonsState();
-}
-/*!
- <Add column> button slot
-*/
-void VisuGUI_TableWidget::addCol()
-{
- myTable->insertColumn( myTable->columnCount() );
- updateButtonsState();
-}
-/*!
- <Delete row(s)> button slot
-*/
-void VisuGUI_TableWidget::delRow()
-{
- //TODO
- /*int c = myOrientation == Qt::Horizontal ? 0 : 1;
- QList<int> il;
- int i;
- for ( i = c; i < myTable->rowCount(); i++ )
- if ( myTable->isRowSelected( i, true ) )
- il.append( i );
- if ( il.count() > 0 ) {
- QMemArray<int> ildel( il.count() );
- for ( i = 0; i < il.count(); i++ )
- ildel[ i ] = il[ i ];
- myTable->removeRows( ildel );
- }*/
-
- updateButtonsState();
-}
-/*!
- <Delete column(s)> button slot
-*/
-void VisuGUI_TableWidget::delCol()
-{
- //TODO
- /*int c = myOrientation == Qt::Horizontal ? 1 : 0;
- QValueList<int> il;
- int i;
- for ( i = c; i < myTable->numCols(); i++ )
- if ( myTable->isColumnSelected( i, true ) )
- il.append( i );
- if ( il.count() > 0 ) {
- QMemArray<int> ildel( il.count() );
- for ( i = 0; i < il.count(); i++ )
- ildel[ i ] = il[ i ];
- myTable->removeColumns( ildel );
- }*/
- updateButtonsState();
-}
-/*!
- <Select All> button slot
-*/
-void VisuGUI_TableWidget::selectAll()
-{
- /*myTable->clearSelection();
- QTableSelection ts;
- ts.init( 0, 0 ); ts.expandTo( myTable->numRows()-1, myTable->numCols()-1 );
- myTable->addSelection( ts );*/
- myTable->selectAll();
- updateButtonsState();
-}
-/*!
- <Clear> button slot
-*/
-void VisuGUI_TableWidget::clearTable()
-{
- /*int nbSel = myTable->numSelections();
- for ( int i = 0; i < nbSel; i++ ) {
- QTableSelection ts = myTable->selection( i );
- for ( int j = ts.topRow(); j < ts.bottomRow()+1; j++) {
- if ( myOrientation == Qt::Vertical && j == 0 ) {
-// continue; // UNITS
- }
- for ( int k = ts.leftCol(); k < ts.rightCol()+1; k++) {
- if ( myOrientation == Qt::Horizontal && k == 0 ) {
-// continue; // UNITS
- }
- myTable->clearCell( j, k );
- }
- }
- }
- if ( nbSel == 0 )
- myTable->clearCell( myTable->currentRow(), myTable->currentColumn() );
- myTable->clearSelection();*/
- myTable->clearContents();
- updateButtonsState();
-}
-/*!
- Event filter - handles titles editing
-*/
-bool VisuGUI_TableWidget::eventFilter( QObject* o, QEvent* e )
-{
- if ( e->type() == QEvent::MouseButtonDblClick) {
- //TODO
- /*QMouseEvent* me = ( QMouseEvent* )e;
- if ( me->button() == Qt::LeftButton && (myTable->editTriggers() != QAbstractItemView::NoEditTriggers ) ) {
- if ( o == myTable->horizontalHeader() ) {
- for ( int i = 0; i < myTable->horizontalHeader()->count(); i++ ) {
- QRect rect = myTable->horizontalHeader()->sectionRect( i );
- rect.addCoords( 1, 1, -1, -1 );
- if ( rect.contains( myTable->horizontalHeader()->mapFromGlobal( me->globalPos() ) ) ) {
- if ( myOrientation == Qt::Vertical || i != 0 ) {
- bool bOk;
- QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ),
- tr( "TITLE_LBL" ),
- QLineEdit::Normal,
- myTable->horizontalHeader()->label( i ),
- &bOk,
- this );
- if ( bOk && !tlt.isNull() )
- myTable->horizontalHeader()->setLabel( i, tlt );
- break;
- }
- }
- }
- }
- if ( o == myTable->verticalHeader() ) {
- for ( int i = 0; i < myTable->verticalHeader()->count(); i++ ) {
- QRect rect = myTable->verticalHeader()->sectionRect( i );
- rect.addCoords( 1, 1, -1, -1 );
- if ( rect.contains( myTable->verticalHeader()->mapFromGlobal( me->globalPos() ) ) ) {
- if ( myOrientation == Qt::Horizontal || i != 0 ) {
- bool bOk;
- QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ),
- tr( "TITLE_LBL" ),
- QLineEdit::Normal,
- myTable->verticalHeader()->label( i ),
- &bOk,
- this );
- if ( bOk && !tlt.isNull() )
- myTable->verticalHeader()->setLabel( i, tlt );
- break;
- }
- }
- }
- }
- }*/
- }
- else if ( e->type() == QEvent::KeyRelease && o == myTable ) {
- QKeyEvent* ke = (QKeyEvent*)e;
- if ( ke->key() == Qt::Key_Delete && (myTable->editTriggers() != QAbstractItemView::NoEditTriggers) ) {
- clearTable();
- }
- else if ( ke->key() == Qt::Key_Backspace && (myTable->editTriggers() != QAbstractItemView::NoEditTriggers) ) {
- clearTable();
- int i = myTable->currentRow();
- int j = myTable->currentColumn() - 1;
- if ( j < 0 ) { j = myTable->columnCount()-1; i--; }
- if ( i >= 0 && j >= 0 )
- myTable->setCurrentCell( i, j );
- }
- }
- return QWidget::eventFilter( o, e );
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : VisuGUI_TableDlg.h
-// Author : Vadim SANDLER
-// Module : VISU
-//
-#ifndef VisuGUI_TABLE_DLG_H
-#define VisuGUI_TABLE_DLG_H
-
-#include <QDialog>
-#include <QLineEdit>
-#include <QPushButton>
-#include <QItemDelegate>
-
-class QTableWidget;
-class VisuGUI_TableWidget;
-
-#include <SALOMEDSClient_SObject.hxx>
-
-#include "VisuGUITools.h"
-
-class VISU_GUITOOLS_EXPORT VisuGUI_TableDlg : public QDialog
-{
- Q_OBJECT
-
-public:
-
- enum { ttNone, ttInt, ttReal, ttBoth, ttAuto };
-
- VisuGUI_TableDlg( QWidget* parent,
- _PTR(SObject) obj,
- bool edit = false,
- int which = ttAuto,
- Qt::Orientation orient = Qt::Horizontal,
- bool showColumnTitles = true );
- ~VisuGUI_TableDlg();
-
-private:
- void keyPressEvent( QKeyEvent* e );
-
-public slots:
- void onOK();
- void onHelp();
-
-private:
- void initDlg();
-
-private:
- VisuGUI_TableWidget* myIntTable;
- VisuGUI_TableWidget* myRealTable;
- QPushButton* myOKBtn;
- QPushButton* myCancelBtn;
- QPushButton* myHelpBtn;
-
- _PTR(SObject) myObject;
-};
-
-class VISU_GUITOOLS_EXPORT VisuGUI_TableWidget : public QWidget
-{
- Q_OBJECT
-public:
- VisuGUI_TableWidget( QWidget* parent = 0,
- const char* name = 0,
- bool edit = false,
- Qt::Orientation orient = Qt::Horizontal,
- bool showColumnTitles = true );
- ~VisuGUI_TableWidget();
-
- void setTableTitle( const QString& title );
- QString getTableTitle();
- void setNumRows( const int num );
- int getNumRows();
- void setNumCols( const int num );
- int getNumCols();
- void setRowTitles( QStringList& tlts );
- void getRowTitles( QStringList& tlts );
- void setColTitles( QStringList& tlts );
- void getColTitles( QStringList& tlts );
- void setUnitsTitle( const QString& tlt );
- void setUnits( QStringList& units );
- void getUnits( QStringList& units );
- void setRowData( int row, QStringList& data );
- void getRowData( int row, QStringList& data );
-
- QTableWidget* getTable() { return myTable; }
- QLineEdit* getTitleEdit() { return myTitleEdit; }
-
- bool eventFilter( QObject* o, QEvent* e);
-
-public slots:
- void updateButtonsState();
- void addRow();
- void addCol();
- void delRow();
- void delCol();
- void adjustTable();
- void selectAll();
- void clearTable();
-
-private:
- QLineEdit* myTitleEdit;
- QTableWidget* myTable;
- QPushButton* myAddRowBtn;
- QPushButton* myAddColBtn;
- QPushButton* myDelRowBtn;
- QPushButton* myDelColBtn;
- QPushButton* myAdjustBtn;
- QPushButton* mySelectAllBtn;
- QPushButton* myClearBtn;
- Qt::Orientation myOrientation;
-};
-
-class VISU_GUITOOLS_EXPORT NumDelegateItem: public QItemDelegate
-{
-public:
- enum NumValidator{ NV_Int, NV_Real };
-
- NumDelegateItem( QObject* parent, NumValidator mode = NV_Int );
- virtual ~NumDelegateItem();
-
- virtual QWidget * createEditor( QWidget * parent,
- const QStyleOptionViewItem & option,
- const QModelIndex & index ) const;
- virtual void setEditorData( QWidget * editor,
- const QModelIndex & index ) const;
-private:
- int myMode;
-};
-
-#endif // VisuGUI_TABLE_DLG_H
-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# $Header$
#
-SUBDIRS = CONVERTOR PIPELINE OBJECT VVTK GUITOOLS VISU_I VISUGUI VISU_SWIG ENGINE
+SUBDIRS = CONVERTOR PIPELINE OBJECT VISU_I VISUGUI VISU_SWIG ENGINE
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU OBJECT : interactive object for VISU entities implementation
# File : Makefile.in
# Module : VISU
VISU_PointMap3dActor.h \
VISU_ActorBase.h \
VISU_IsoSurfActor.h \
+ VISU_SelectVisiblePoints.h \
VISU_OBJECT.h
dist_libVisuObject_la_SOURCES = \
VISU_VectorsAct.cxx \
VISU_PointMap3dActor.cxx \
VISU_ActorBase.cxx \
- VISU_IsoSurfActor.cxx
+ VISU_IsoSurfActor.cxx \
+ VISU_SelectVisiblePoints.cxx
libVisuObject_la_CPPFLAGS= \
$(QT_INCLUDES) \
-I$(srcdir)/../CONVERTOR
libVisuObject_la_LDFLAGS= \
- $(BOOST_LIBS) \
$(GUI_LDFLAGS) \
$(KERNEL_LDFLAGS) \
+ $(BOOST_LIB_SIGNALS) \
$(VTK_LIBS)
libVisuObject_la_LIBADD= \
- -lboost_signals@BOOST_LIBSUFFIX@ \
- -lSalomeObject \
+ -lSalomeObject -lqtx -lsuit \
../PIPELINE/libVisuPipeLine.la \
-lSVTK
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
-// File :
-// Author :
+// File :
+// Author :
// Module : VISU
-
+//
#include "VISU_Actor.h"
+#include "VISU_ActorFactory.h"
#include "VISU_PickingSettings.h"
#include "VISU_GaussPtsDeviceActor.h"
+#include "VISU_SelectVisiblePoints.h"
#include "VISU_PipeLine.hxx"
+#include "VISU_UsedPointsFilter.hxx"
+#include "SVTK_Actor.h"
#include "SVTK_Event.h"
+#include "VTKViewer_CellCenters.h"
+#include "VTKViewer_FramedTextActor.h"
#include "VTKViewer_ShrinkFilter.h"
#include "VTKViewer_GeometryFilter.h"
-#include "VISU_ActorFactory.h"
+
#include "SALOME_InteractiveObject.hxx"
-
+
+#include "SUIT_Session.h"
+#include "SUIT_ResourceMgr.h"
+
#include <stdexcept>
#include <sstream>
+#include <cmath> // to use std::abs( int )
// VTK Includes
#include <vtkProperty.h>
#include <vtkTextActor.h>
#include <vtkProperty2D.h>
#include <vtkRenderer.h>
+#include <vtkRenderWindow.h>
#include <vtkCellPicker.h>
#include <vtkCell.h>
#include <vtkPointPicker.h>
#include <vtkActor2D.h>
#include <vtkMaskPoints.h>
#include <vtkLabeledDataMapper.h>
-#include <vtkSelectVisiblePoints.h>
#include <vtkTextProperty.h>
#include <vtkProperty2D.h>
myIsShrinkable(false),
myShrinkFilter(VTKViewer_ShrinkFilter::New()),
myAnnotationMapper(vtkTextMapper::New()),
+#if (VTK_XVERSION < 0x050100)
myAnnotationActor(vtkTextActor::New()),
- myTextActor(VISU_FramedTextActor::New()),
+#else
+ myAnnotationActor(vtkActor2D::New()),
+#endif
+ myTextActor(VTKViewer_FramedTextActor::New()),
myIsFeatureEdgesAllowed(false),
myIsFeatureEdgesEnabled(false),
myFeatureEdges(vtkFeatureEdges::New()),
myFeatureEdges->Delete();
myEventCallbackCommand->Delete();
- myEventCallbackCommand->SetClientData(this);
+ myEventCallbackCommand->SetClientData(this);
myEventCallbackCommand->SetCallback(VISU_Actor::ProcessEvents);
if( VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get() )
- aPickingSettings->AddObserver(VISU::UpdatePickingSettingsEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
-
+ aPickingSettings->AddObserver(VISU::UpdatePickingSettingsEvent,
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
+
//Definition of values labeling pipeline
myValLblDataSet = vtkUnstructuredGrid::New();
- myValCellCenters = vtkCellCenters::New();
+ myValCellCenters = VTKViewer_CellCenters::New();
myValCellCenters->SetInput(myValLblDataSet);
+ myValUsedPoints = VISU_UsedPointsFilter::New();
+ myValUsedPoints->SetInput(myValLblDataSet);
+
myValMaskPoints = vtkMaskPoints::New();
myValMaskPoints->SetInput(myValCellCenters->GetOutput());
myValMaskPoints->SetOnRatio(1);
-
- myValSelectVisiblePoints = vtkSelectVisiblePoints::New();
+
+ myValSelectVisiblePoints = VISU_SelectVisiblePoints::New();
myValSelectVisiblePoints->SetInput(myValMaskPoints->GetOutput());
myValSelectVisiblePoints->SelectInvisibleOff();
myValSelectVisiblePoints->SetTolerance(0.1);
-
+
+ char aFormat[16] = "%g";
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+ if (aResourceMgr) {
+ // san: precision can be negative - this is used by double spin boxes
+ int aFloatingPrec = std::abs( aResourceMgr->integerValue("VISU", "visual_data_precision", 6) );
+ sprintf(aFormat, "%%.%dg", aFloatingPrec);
+ //cout << "$$$ aFormat = " << aFormat << endl;
+ }
+
myValLabeledDataMapper = vtkLabeledDataMapper::New();
myValLabeledDataMapper->SetInput(myValSelectVisiblePoints->GetOutput());
- myValLabeledDataMapper->SetLabelFormat("%g");
+ //myValLabeledDataMapper->SetLabelFormat("%g");
+ //myValLabeledDataMapper->SetLabelFormat("%.20g");
+ myValLabeledDataMapper->SetLabelFormat(aFormat);
myValLabeledDataMapper->SetLabelModeToLabelScalars();
-
+
vtkTextProperty* aClsTextProp = vtkTextProperty::New();
aClsTextProp->SetFontFamilyToTimes();
static int aCellsFontSize = 12;
aClsTextProp->SetShadow(0);
myValLabeledDataMapper->SetLabelTextProperty(aClsTextProp);
aClsTextProp->Delete();
-
+
myIsValLabeled = false;
myValLabels = vtkActor2D::New();
myValLabels->SetMapper(myValLabeledDataMapper);
myValLabels->GetProperty()->SetColor(0,1,0);
myValLabels->SetVisibility( myIsValLabeled );
+
+ // to allow modification of the reference coordinate in redefined SetPosition() methods
+ vtkCoordinate* aValLabelsCoordinate = vtkCoordinate::New();
+ myValLabels->GetPositionCoordinate()->SetReferenceCoordinate( aValLabelsCoordinate );
+ aValLabelsCoordinate->Delete();
}
//----------------------------------------------------------------------------
myValLabeledDataMapper->Delete();
myValSelectVisiblePoints->Delete();
myValMaskPoints->Delete();
+ myValUsedPoints->Delete();
myValCellCenters->Delete();
myValLabels->Delete();
}
//----------------------------------------------------------------------------
-void
+void
VISU_Actor
::setIO(const Handle(SALOME_InteractiveObject)& theIO)
{
- Superclass::setIO(theIO);
- myName = theIO->getName();
+ Superclass::setIO(theIO);
+ myName = theIO->getName();
}
//----------------------------------------------------------------------------
-void
+void
VISU_Actor
::SetPrs3d(VISU::Prs3d_i* thePrs3d)
-{
+{
myPrs3d = thePrs3d;
}
-VISU::Prs3d_i*
+VISU::Prs3d_i*
VISU_Actor
::GetPrs3d()
-{
+{
return myPrs3d;
}
//----------------------------------------------------------------------------
void
VISU_Actor
-::SetPipeLine(VISU_PipeLine* thePipeLine)
+::SetPipeLine(VISU_PipeLine* thePipeLine)
{
myPipeLine = thePipeLine;
if(thePipeLine){
if(vtkMapper *aMapper = myPipeLine->GetMapper()){
if(vtkDataSet *aDataSet = aMapper->GetInput()){
- SetShrinkable(thePipeLine->IsShrinkable());
- SetFeatureEdgesAllowed(thePipeLine->IsFeatureEdgesAllowed());
- SetMapperInput(aDataSet);
+ SetShrinkable(thePipeLine->IsShrinkable());
+ SetFeatureEdgesAllowed(thePipeLine->IsFeatureEdgesAllowed());
+ SetMapperInput(aDataSet);
}
}
}
this->Modified();
}
-VISU_PipeLine*
+VISU_PipeLine*
VISU_Actor
-::GetPipeLine()
-{
+::GetPipeLine()
+{
return myPipeLine.GetPointer();
}
-VISU_PipeLine*
+VISU_PipeLine*
VISU_Actor
-::GetCurrentPL()
-{
+::GetCurrentPL()
+{
return GetPipeLine();
}
//----------------------------------------------------------------------------
void
VISU_Actor
-::SetRepresentation(int theMode)
-{
+::SetRepresentation(int theMode)
+{
Superclass::SetRepresentation(theMode);
if(myRepresentation == VTK_POINTS)
{
UnShrink();
}
- SetFeatureEdgesEnabled( theMode == SVTK::Representation::FeatureEdges );
+ SetFeatureEdgesEnabled( theMode == VTKViewer::Representation::FeatureEdges );
}
VISU_Actor
::SetShrink()
{
- if(!myIsShrinkable)
+ if(!myIsShrinkable)
return;
if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){
myShrinkFilter->SetInput(aDataSet);
VISU_Actor
::UnShrink()
{
- if(!myIsShrunk)
+ if(!myIsShrunk)
return;
if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){
myPassFilter[1]->SetInput(aDataSet);
bool
VISU_Actor
-::IsShrunkable()
-{
+::IsShrunkable()
+{
return myIsShrinkable;
}
//----------------------------------------------------------------------------
bool
VISU_Actor
-::IsFeatureEdgesAllowed()
-{
+::IsFeatureEdgesAllowed()
+{
return myIsFeatureEdgesAllowed;
}
VISU_Actor
::SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled)
{
- if ( !myIsFeatureEdgesAllowed || myIsFeatureEdgesEnabled == theIsFeatureEdgesEnabled )
+ if ( !myIsFeatureEdgesAllowed || myIsFeatureEdgesEnabled == theIsFeatureEdgesEnabled )
return;
if ( vtkPolyData* aPolyData = myPassFilter[ 2 ]->GetPolyDataOutput() )
void
VISU_Actor
::GetFeatureEdgesFlags(bool& theIsFeatureEdges,
- bool& theIsBoundaryEdges,
- bool& theIsManifoldEdges,
- bool& theIsNonManifoldEdges)
+ bool& theIsBoundaryEdges,
+ bool& theIsManifoldEdges,
+ bool& theIsNonManifoldEdges)
{
theIsFeatureEdges = myFeatureEdges->GetFeatureEdges();
theIsBoundaryEdges = myFeatureEdges->GetBoundaryEdges();
void
VISU_Actor
::SetFeatureEdgesFlags(bool theIsFeatureEdges,
- bool theIsBoundaryEdges,
- bool theIsManifoldEdges,
- bool theIsNonManifoldEdges)
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges)
{
myFeatureEdges->SetFeatureEdges(theIsFeatureEdges);
myFeatureEdges->SetBoundaryEdges(theIsBoundaryEdges);
vtkFloatingPointType
VISU_Actor
::GetOpacity()
-{
+{
return GetProperty()->GetOpacity();
}
theRenderer->RemoveActor(myAnnotationActor.GetPointer());
theRenderer->RemoveActor(myTextActor.GetPointer());
theRenderer->RemoveActor(myValLabels);
- Superclass::RemoveFromRender(theRenderer);
+ Superclass::RemoveFromRender(theRenderer);
myDestroySignal(this);
}
//----------------------------------------------------------------------------
-void
+void
VISU_Actor
::SetVisibility(int theMode)
{
Superclass::SetVisibility( theMode );
myValLabels->SetVisibility( myIsValLabeled && theMode );
+
+ // Moved from VISU_GaussPtsAct::SetVisibility() (due to IPAL21159)
+ Highlight(isHighlighted());
+}
+//----------------------------------------------------------------------------
+ //! Gets know whether the actor should be displayed or not
+bool
+VISU_Actor
+::ShouldBeDisplayed()
+{
+ return GetFactory()->GetActiveState();
}
//----------------------------------------------------------------------------
-void
+void
+VISU_Actor
+::SetPosition( double thePosition[3] )
+{
+ Superclass::SetPosition( thePosition );
+ if( vtkCoordinate* aCoord = myValLabels->GetPositionCoordinate()->GetReferenceCoordinate() )
+ aCoord->SetValue( thePosition );
+ myValSelectVisiblePoints->SetOffset( thePosition );
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_Actor
+::SetPosition( double theX, double theY, double theZ )
+{
+ Superclass::SetPosition( theX, theY, theZ );
+ if( vtkCoordinate* aCoord = myValLabels->GetPositionCoordinate()->GetReferenceCoordinate() )
+ aCoord->SetValue( theX, theY, theZ );
+ myValSelectVisiblePoints->SetOffset( theX, theY, theZ );
+}
+
+//----------------------------------------------------------------------------
+void
VISU_Actor
::SetVTKMapping(bool theIsVTKMapping)
{
myIsVTKMapping = theIsVTKMapping;
}
-bool
+bool
VISU_Actor
::IsVTKMapping() const
{
}
//----------------------------------------------------------------------------
-vtkDataSet*
+vtkDataSet*
VISU_Actor
::GetInput()
{
return VISU::GetElemVTKID(GetMapper()->GetInput(), theID);
}
-vtkCell*
+vtkCell*
VISU_Actor
::GetElemCell(vtkIdType theObjID)
{
//----------------------------------------------------------------------------
bool
VISU_Actor
-::isSubElementsHighlighted()
-{
- return myIsSubElementsHighlighted;
+::isSubElementsHighlighted()
+{
+ return myIsSubElementsHighlighted;
}
inline
void
ChangeZoom(vtkFloatingPointType theZoomFactor,
- vtkRenderer* theRenderer,
- vtkIdType theInitialHasIndex,
- vtkIdType theCurrentHasIndex)
+ vtkRenderer* theRenderer,
+ vtkIdType theInitialHasIndex,
+ vtkIdType theCurrentHasIndex)
{
//printf( "VISU_Actor::ChangeZoom( %d, %d )", theInitialHasIndex, theCurrentHasIndex );
if(theInitialHasIndex + theCurrentHasIndex == 1){
}
/*!
- Updates visibility of the highlight devices
+ Updates visibility of the highlight devices
*/
void
VISU_Actor
{
if( mySelectionMode == ActorSelection )
ResetTextActor();
- else
- aShowTextActor = false;
myLastSelectionMode = mySelectionMode;
}
- myTextActor->SetVisibility( GetVisibility() && theIsHighlight && aShowTextActor );
+ myTextActor->SetVisibility( GetVisibility() && theIsHighlight && aShowTextActor &&
+ ( mySelectionMode == ActorSelection || isSubElementsHighlighted() ) );
bool anInitialHasIndex = isHighlighted();
bool aCurrentHasIndex = theIsHighlight;
{
vtkFloatingPointType aZoomFactor = aPickingSettings->GetZoomFactor();
ChangeZoom(aZoomFactor,
- GetRenderer(),
- anInitialHasIndex,
- aCurrentHasIndex);
+ GetRenderer(),
+ anInitialHasIndex,
+ aCurrentHasIndex);
}
}
*/
bool
VISU_Actor
-::PreHighlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight)
+::PreHighlight(vtkInteractorStyle* theInteractorStyle,
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight)
{
bool aRet = Superclass::PreHighlight(theInteractorStyle,
- theSelectionEvent,
- theIsHighlight);
+ theSelectionEvent,
+ theIsHighlight);
#ifndef ENABLE_ANNOTATION
return aRet;
-#endif
+#endif
//
myAnnotationActor->SetVisibility(0);
if(theIsHighlight){
switch(mySelectionMode){
- case CellSelection:{
+ case CellSelection:{
vtkRenderer* aRenderer = theInteractorStyle->GetCurrentRenderer();
- myCellPicker->Pick(theSelectionEvent->myX,
- theSelectionEvent->myY,
- 0.0,
- aRenderer);
+ myCellPicker->Pick(theSelectionEvent->myX,
+ theSelectionEvent->myY,
+ 0.0,
+ aRenderer);
if(myCellPicker->GetActor() != this)
- return false;
+ return false;
vtkIdType aVTKId = myCellPicker->GetCellId();
if(aVTKId >= 0 && mySelector->IsValid(this,aVTKId,true) && hasIO()){
- vtkIdType anObjId = GetElemObjId(aVTKId);
- if(vtkCell* aCell = GetElemCell(anObjId)){
- vtkPoints* aPts = aCell->GetPoints();
- if(int aNbPts = aCell->GetNumberOfPoints()){
- vtkFloatingPointType aCoord[3] = {0.0, 0.0, 0.0};
- for(int i = 0; i < aNbPts; i++){
- vtkFloatingPointType *aPntCoord = aPts->GetPoint(i);
- aCoord[0] += aPntCoord[0];
- aCoord[1] += aPntCoord[1];
- aCoord[2] += aPntCoord[2];
- }
- // Display coordinates
- vtkFloatingPointType aWorldCoord[4] = {aCoord[0]/aNbPts, aCoord[1]/aNbPts, aCoord[2]/aNbPts, 1.0};
- aRenderer->SetWorldPoint(aWorldCoord);
- aRenderer->WorldToDisplay();
- vtkFloatingPointType aSelectionPoint[3];
- aRenderer->GetDisplayPoint(aSelectionPoint);
- myAnnotationActor->SetPosition(aSelectionPoint);
- //
- // To prepare the annotation text
- std::ostringstream aStr;
- aStr<<"Cell ID: "<< anObjId;
- std::string aString = aStr.str();
- myAnnotationMapper->SetInput(aString.c_str());
-
- myAnnotationActor->SetVisibility(1);
- return true;
- }
- }
+ vtkIdType anObjId = GetElemObjId(aVTKId);
+ if(vtkCell* aCell = GetElemCell(anObjId)){
+ vtkPoints* aPts = aCell->GetPoints();
+ if(int aNbPts = aCell->GetNumberOfPoints()){
+ vtkFloatingPointType aCoord[3] = {0.0, 0.0, 0.0};
+ for(int i = 0; i < aNbPts; i++){
+ vtkFloatingPointType *aPntCoord = aPts->GetPoint(i);
+ aCoord[0] += aPntCoord[0];
+ aCoord[1] += aPntCoord[1];
+ aCoord[2] += aPntCoord[2];
+ }
+ // Display coordinates
+ vtkFloatingPointType aWorldCoord[4] = {aCoord[0]/aNbPts, aCoord[1]/aNbPts, aCoord[2]/aNbPts, 1.0};
+ aRenderer->SetWorldPoint(aWorldCoord);
+ aRenderer->WorldToDisplay();
+ vtkFloatingPointType aSelectionPoint[3];
+ aRenderer->GetDisplayPoint(aSelectionPoint);
+ myAnnotationActor->SetPosition(aSelectionPoint);
+ //
+ // To prepare the annotation text
+ std::ostringstream aStr;
+ aStr<<"Cell ID: "<< anObjId;
+ std::string aString = aStr.str();
+ myAnnotationMapper->SetInput(aString.c_str());
+
+ myAnnotationActor->SetVisibility(1);
+ return true;
+ }
+ }
}
break;
}
- case NodeSelection:{
+ case NodeSelection:{
vtkRenderer* aRenderer = theInteractorStyle->GetCurrentRenderer();
- myPointPicker->Pick(theSelectionEvent->myX,
- theSelectionEvent->myY,
- 0.0,
- aRenderer);
+ myPointPicker->Pick(theSelectionEvent->myX,
+ theSelectionEvent->myY,
+ 0.0,
+ aRenderer);
if(myPointPicker->GetActor() != this)
- return false;
+ return false;
vtkIdType aVtkId = myPointPicker->GetPointId();
if(aVtkId >= 0 && mySelector->IsValid(this,aVtkId,true) && hasIO()){
- vtkIdType anObjId = GetNodeObjId( aVtkId );
- if(vtkFloatingPointType* aCoord = GetNodeCoord(anObjId)){
- // Display coordinates
- vtkFloatingPointType aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0};
- aRenderer->SetWorldPoint(aWorldCoord);
- aRenderer->WorldToDisplay();
- vtkFloatingPointType aSelectionPoint[3];
- aRenderer->GetDisplayPoint(aSelectionPoint);
- myAnnotationActor->SetPosition(aSelectionPoint);
- //
- // To prepare the annotation text
- std::ostringstream aStr;
- aStr<<"Node ID: "<< anObjId;
- std::string aString = aStr.str();
- myAnnotationMapper->SetInput(aString.c_str());
-
- myAnnotationActor->SetVisibility(1);
- return true;
- }
+ vtkIdType anObjId = GetNodeObjId( aVtkId );
+ if(vtkFloatingPointType* aCoord = GetNodeCoord(anObjId)){
+ // Display coordinates
+ vtkFloatingPointType aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0};
+ aRenderer->SetWorldPoint(aWorldCoord);
+ aRenderer->WorldToDisplay();
+ vtkFloatingPointType aSelectionPoint[3];
+ aRenderer->GetDisplayPoint(aSelectionPoint);
+ myAnnotationActor->SetPosition(aSelectionPoint);
+ //
+ // To prepare the annotation text
+ std::ostringstream aStr;
+ aStr<<"Node ID: "<< anObjId;
+ std::string aString = aStr.str();
+ myAnnotationMapper->SetInput(aString.c_str());
+
+ myAnnotationActor->SetVisibility(1);
+ return true;
+ }
}
break;
}
*/
bool
VISU_Actor
-::Highlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight)
+::Highlight(vtkInteractorStyle* theInteractorStyle,
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight)
{
return Superclass::Highlight(theInteractorStyle,
- theSelectionEvent,
- theIsHighlight);
+ theSelectionEvent,
+ theIsHighlight);
}
//-------------------------------------------------------------------------
VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get();
bool anInitialHasIndex = isSubElementsHighlighted() && mySelectionMode != ActorSelection;
-
+
TColStd_IndexedMapOfInteger aMapIndex;
mySelector->GetIndex( getIO(), aMapIndex );
bool aCurrentHasIndex = aMapIndex.Extent() == 1;
{
case ActorSelection:
{
- ResetTextActor();
- break;
+ ResetTextActor();
+ break;
}
case CellSelection:
{
- if( !aCurrentHasIndex )
- {
- myTextActor->SetVisibility(false);
- break;
- }
-
- int anObjId = aMapIndex(1);
- vtkCellData* aCellData = aDataSet->GetCellData();
- if(vtkCell* aCell = GetElemCell(anObjId)){
- vtkPoints* aPts = aCell->GetPoints();
- if(int aNbPts = aCell->GetNumberOfPoints()){
- vtkFloatingPointType aCoord[3] = {0.0, 0.0, 0.0};
- for(int i = 0; i < aNbPts; i++){
- vtkFloatingPointType *aPntCoord = aPts->GetPoint(i);
- aCoord[0] += aPntCoord[0];
- aCoord[1] += aPntCoord[1];
- aCoord[2] += aPntCoord[2];
- }
-
- aFlyTo = true;
- aFlyToCoord[0] = aCoord[0] / aNbPts;
- aFlyToCoord[1] = aCoord[1] / aNbPts;
- aFlyToCoord[2] = aCoord[2] / aNbPts;
-
- vtkFloatingPointType aWorldCoord[4] = {aCoord[0]/aNbPts, aCoord[1]/aNbPts, aCoord[2]/aNbPts, 1.0};
- aRenderer->SetWorldPoint(aWorldCoord);
- aRenderer->WorldToDisplay();
- vtkFloatingPointType aSelectionPoint[3];
- aRenderer->GetDisplayPoint(aSelectionPoint);
- myTextActor->SetPosition(aSelectionPoint);
- myTextActor->SetModePosition(aPickingSettings->GetInfoWindowPosition());
- myTextActor->SetTransparency(aPickingSettings->GetInfoWindowTransparency());
- myTextActor->SetWorldPoint(aWorldCoord);
-
- std::ostringstream aStr;
- aStr << "Cell ID: " << anObjId;
-
- vtkCell* aCell = GetElemCell(anObjId);
- int aVTKID = GetElemVTKID(anObjId);
- if (aCell) {
- int aNbOfPoints = aCell->GetNumberOfPoints();
- if ( aNbOfPoints > 0 ) {
- aStr << getScalar(aCellData, aVTKID);
- aStr << getVector(aCellData, aVTKID);
- }
- }
-
- std::string aString = aStr.str();
- myTextActor->SetText(aString.c_str());
- }
- }
- break;
+ if( !aCurrentHasIndex )
+ {
+ myTextActor->SetVisibility(false);
+ break;
+ }
+
+ int anObjId = aMapIndex(1);
+ vtkCellData* aCellData = aDataSet->GetCellData();
+ if(vtkCell* aCell = GetElemCell(anObjId)){
+ vtkPoints* aPts = aCell->GetPoints();
+ if(int aNbPts = aCell->GetNumberOfPoints()){
+ vtkFloatingPointType aCoord[3] = {0.0, 0.0, 0.0};
+ for(int i = 0; i < aNbPts; i++){
+ vtkFloatingPointType *aPntCoord = aPts->GetPoint(i);
+ aCoord[0] += aPntCoord[0];
+ aCoord[1] += aPntCoord[1];
+ aCoord[2] += aPntCoord[2];
+ }
+
+ aFlyTo = true;
+ aFlyToCoord[0] = aCoord[0] / aNbPts;
+ aFlyToCoord[1] = aCoord[1] / aNbPts;
+ aFlyToCoord[2] = aCoord[2] / aNbPts;
+
+ vtkFloatingPointType aWorldCoord[4] = {aCoord[0]/aNbPts, aCoord[1]/aNbPts, aCoord[2]/aNbPts, 1.0};
+ aRenderer->SetWorldPoint(aWorldCoord);
+ aRenderer->WorldToDisplay();
+ vtkFloatingPointType aSelectionPoint[3];
+ aRenderer->GetDisplayPoint(aSelectionPoint);
+ myTextActor->SetPosition(aSelectionPoint);
+ myTextActor->SetModePosition(aPickingSettings->GetInfoWindowPosition());
+ myTextActor->SetTransparency(aPickingSettings->GetInfoWindowTransparency());
+ myTextActor->SetWorldPoint(aWorldCoord);
+
+ std::ostringstream aStr;
+ aStr << "Cell ID: " << anObjId;
+
+ vtkCell* aCell = GetElemCell(anObjId);
+ int aVTKID = GetElemVTKID(anObjId);
+ if (aCell) {
+ int aNbOfPoints = aCell->GetNumberOfPoints();
+ if ( aNbOfPoints > 0 ) {
+ aStr << getScalar(aCellData, aVTKID);
+ aStr << getVector(aCellData, aVTKID);
+ }
+ }
+
+ std::string aString = aStr.str();
+ myTextActor->SetText(aString.c_str());
+ }
+ }
+ break;
}
case NodeSelection:
- {
- if( !aCurrentHasIndex )
- {
- myTextActor->SetVisibility(false);
- break;
- }
-
- int anObjId = aMapIndex(1);
- vtkPointData* aPntData = aDataSet->GetPointData();
- if(vtkFloatingPointType* aCoord = GetNodeCoord(anObjId)){
- aFlyTo = true;
- aFlyToCoord[0] = aCoord[0];
- aFlyToCoord[1] = aCoord[1];
- aFlyToCoord[2] = aCoord[2];
-
- vtkFloatingPointType aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0};
- aRenderer->SetWorldPoint(aWorldCoord);
- aRenderer->WorldToDisplay();
- vtkFloatingPointType aSelectionPoint[3];
- aRenderer->GetDisplayPoint(aSelectionPoint);
- myTextActor->SetPosition(aSelectionPoint);
- myTextActor->SetModePosition(aPickingSettings->GetInfoWindowPosition());
- myTextActor->SetTransparency(aPickingSettings->GetInfoWindowTransparency());
- myTextActor->SetWorldPoint(aWorldCoord);
-
- std::ostringstream aStr;
- aStr << "Point ID: " << anObjId;
-
- int aVTKID = GetNodeVTKID(anObjId);
- if(aVTKID >= 0) {
- aStr << getScalar(aPntData, aVTKID);
- aStr << getVector(aPntData, aVTKID);
- }
-
- const VISU::PIDMapper& aMapper = GetPipeLine()->GetIDMapper();
- //VISU::TIdTypeVector aVec = aMapper->GetIndexesOfNode(anObjId);
- VISU::TStructuredId aVec = aMapper->GetIndexesOfNode(anObjId);
-
- aStr << "\nCoordinates: " << "[";
- aStr << aCoord[0];
- //if( aVec.size() > 0 )
- if (aVec[0] != -1)
- aStr << " (" << aVec[0] << ")";
- aStr << "; ";
-
- aStr << aCoord[1];
- //if( aVec.size() > 1 )
- if (aVec[1] != -1)
- aStr << " (" << aVec[1] << ")";
- aStr << "; ";
-
- aStr << aCoord[2];
- //if( aVec.size() > 2 )
- if (aVec[2] != -1)
- aStr << " (" << aVec[2] << ")";
- aStr << "]";
-
- std::string aString = aStr.str();
- myTextActor->SetText(aString.c_str());
- }
- break;
+ {
+ if( !aCurrentHasIndex )
+ {
+ myTextActor->SetVisibility(false);
+ break;
+ }
+
+ int anObjId = aMapIndex(1);
+ vtkPointData* aPntData = aDataSet->GetPointData();
+ if(vtkFloatingPointType* aCoord = GetNodeCoord(anObjId)){
+ aFlyTo = true;
+ aFlyToCoord[0] = aCoord[0];
+ aFlyToCoord[1] = aCoord[1];
+ aFlyToCoord[2] = aCoord[2];
+
+ vtkFloatingPointType aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0};
+ aRenderer->SetWorldPoint(aWorldCoord);
+ aRenderer->WorldToDisplay();
+ vtkFloatingPointType aSelectionPoint[3];
+ aRenderer->GetDisplayPoint(aSelectionPoint);
+ myTextActor->SetPosition(aSelectionPoint);
+ myTextActor->SetModePosition(aPickingSettings->GetInfoWindowPosition());
+ myTextActor->SetTransparency(aPickingSettings->GetInfoWindowTransparency());
+ myTextActor->SetWorldPoint(aWorldCoord);
+
+ std::ostringstream aStr;
+ aStr << "Point ID: " << anObjId;
+
+ int aVTKID = GetNodeVTKID(anObjId);
+ if(aVTKID >= 0) {
+ aStr << getScalar(aPntData, aVTKID);
+ aStr << getVector(aPntData, aVTKID);
+ }
+
+ const VISU::PIDMapper& aMapper = GetPipeLine()->GetIDMapper();
+ //VISU::TIdTypeVector aVec = aMapper->GetIndexesOfNode(anObjId);
+ VISU::TStructuredId aVec = aMapper->GetIndexesOfNode(anObjId);
+
+ aStr << "\nCoordinates: " << "[";
+ aStr << aCoord[0];
+ //if( aVec.size() > 0 )
+ if (aVec[0] != -1)
+ aStr << " (" << aVec[0] << ")";
+ aStr << "; ";
+
+ aStr << aCoord[1];
+ //if( aVec.size() > 1 )
+ if (aVec[1] != -1)
+ aStr << " (" << aVec[1] << ")";
+ aStr << "; ";
+
+ aStr << aCoord[2];
+ //if( aVec.size() > 2 )
+ if (aVec[2] != -1)
+ aStr << " (" << aVec[2] << ")";
+ aStr << "]";
+
+ std::string aString = aStr.str();
+ myTextActor->SetText(aString.c_str());
+ }
+ break;
}
case EdgeOfCellSelection:
- break;
+ break;
default:
- break;
+ break;
}
}
{
vtkFloatingPointType aZoomFactor = aPickingSettings->GetZoomFactor();
ChangeZoom(aZoomFactor,
- GetRenderer(),
- anInitialHasIndex,
- aCurrentHasIndex);
+ GetRenderer(),
+ anInitialHasIndex,
+ aCurrentHasIndex);
}
// FlyTo
vtkRenderWindowInteractor* anInteractor = myInteractor;
vtkFloatingPointType aDollyWas = anInteractor->GetDolly();
int aNumberOfFlyFramesWas = anInteractor->GetNumberOfFlyFrames();
-
+
+ double aPosition[3];
+ GetPosition( aPosition );
+ for( int i = 0; i < 3; i++ )
+ aFlyToCoord[i] += aPosition[i];
+
anInteractor->SetDolly(0.0);
anInteractor->SetNumberOfFlyFrames(aPickingSettings->GetStepNumber());
anInteractor->FlyTo(aRenderer, aFlyToCoord);
GetBounds(aCoord);
vtkFloatingPointType aWorldCoord[4] = { ( aCoord[0] + aCoord[1] ) / 2,
- ( aCoord[2] + aCoord[3] ) / 2,
- ( aCoord[4] + aCoord[5] ) / 2, 1.0};
+ ( aCoord[2] + aCoord[3] ) / 2,
+ ( aCoord[4] + aCoord[5] ) / 2, 1.0};
vtkRenderer* aRenderer = GetRenderer();
aRenderer->SetWorldPoint(aWorldCoord);
aRenderer->WorldToDisplay();
}
//-------------------------------------------------------------------------
-void
+void
VISU_Actor
-::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+::ProcessEvents(vtkObject* vtkNotUsed(theObject),
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
if(vtkObject* anObject = reinterpret_cast<vtkObject*>(theClientData))
if(VISU_Actor* self = dynamic_cast<VISU_Actor*>(anObject)) {
if(theEvent == VISU::UpdatePickingSettingsEvent)
- self->UpdatePickingSettings();
+ self->UpdatePickingSettings();
}
}
vtkDataSet* aGrid = GetValLabelsInput();
if ( !aGrid )
return;
-
+
bool isOnPnt = VISU::IsDataOnPoints( aGrid );
bool isOnCell = VISU::IsDataOnCells( aGrid );
if ( !isOnPnt && !isOnCell )
return;
}
}
-
+
myIsValLabeled = theIsValLabeled;
if ( myIsValLabeled )
myValMaskPoints->SetInput( myValCellCenters->GetOutput() );
}
else if ( isOnPnt )
- myValMaskPoints->SetInput( aDataSet );
+ {
+ myValUsedPoints->SetInput( aDataSet );
+ myValMaskPoints->SetInput( myValUsedPoints->GetOutput() );
+ }
myValLabels->SetVisibility( GetVisibility() );
}
else
myValLabels->SetVisibility( false );
-
+
Modified();
}
vtkTextProperty* VISU_Actor::GetsValLabelsProps() const
{
- return myValLabeledDataMapper->GetLabelTextProperty();
+ return myValLabeledDataMapper->GetLabelTextProperty();
}
//----------------------------------------------------------------------------
return aDataSet;
}
+
+VISU_Actor::EQuadratic2DRepresentation
+VISU_Actor::GetQuadratic2DRepresentation() const
+{
+ if(Superclass::GetQuadraticArcMode()){
+ return VISU_Actor::eArcs;
+ }
+ else
+ return VISU_Actor::eLines;
+}
+
+void VISU_Actor::SetQuadratic2DRepresentation( EQuadratic2DRepresentation theMode )
+{
+ switch(theMode) {
+ case VISU_Actor::eArcs:
+ myPreHighlightActor->SetQuadraticArcMode(true);
+ myHighlightActor->SetQuadraticArcMode(true);
+ break;
+ case VISU_Actor::eLines:
+ myPreHighlightActor->SetQuadraticArcMode(false);
+ myHighlightActor->SetQuadraticArcMode(false);
+ break;
+ default:
+ break;
+ }
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File :
// Author :
// Module : VISU
-
+//
#ifndef VISU_ACTOR_H
#define VISU_ACTOR_H
#include "SALOME_Actor.h"
#include "VISU_ActorBase.h"
#include "VISU_BoostSignals.h"
-#include "SVTK_DeviceActor.h"
+#include "VTKViewer_Actor.h"
#include <string>
#include <vtkTimeStamp.h>
class vtkImplicitFunctionCollection;
class vtkFeatureEdges;
class vtkTextProperty;
-class vtkCellCenters;
-class vtkSelectVisiblePoints;
class vtkLabeledDataMapper;
class vtkMaskPoints;
class vtkActor2D;
-class VISU_FramedTextActor;
+class VTKViewer_CellCenters;
+class VTKViewer_FramedTextActor;
+
+class VISU_SelectVisiblePoints;
+class VISU_UsedPointsFilter;
+
+#if !defined(VTK_XVERSION)
+#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION)
+#endif
-namespace SVTK
+namespace VTKViewer
{
namespace Representation
{
void
SetVisibility(int theMode);
+ bool
+ ShouldBeDisplayed();
+
+ virtual
+ void
+ SetPosition( double thePosition[3] );
+
+ virtual
+ void
+ SetPosition( double theX, double theY, double theZ );
+
//----------------------------------------------------------------------------
virtual
VISU_PipeLine*
virtual
void
GetFeatureEdgesFlags(bool& theIsFeatureEdges,
- bool& theIsBoundaryEdges,
- bool& theIsManifoldEdges,
- bool& theIsNonManifoldEdges);
+ bool& theIsBoundaryEdges,
+ bool& theIsManifoldEdges,
+ bool& theIsNonManifoldEdges);
virtual
void
SetFeatureEdgesFlags(bool theIsFeatureEdges,
- bool theIsBoundaryEdges,
- bool theIsManifoldEdges,
- bool theIsNonManifoldEdges);
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges);
virtual
bool
virtual
bool
PreHighlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight);
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight);
//! To process highlight (called from #SVTK_InteractorStyle)
virtual
bool
Highlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight);
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight);
//! Internal highlight.
virtual
vtkTextProperty*
GetsValLabelsProps() const;
+
+ enum EQuadratic2DRepresentation { eLines = 0, eArcs };
+
+ virtual
+ EQuadratic2DRepresentation GetQuadratic2DRepresentation() const;
+
+ virtual void
+ SetQuadratic2DRepresentation( EQuadratic2DRepresentation theMode );
+
protected:
VISU_Actor();
static
void
ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
//----------------------------------------------------------------------------
private:
bool myIsShrunk;
vtkSmartPointer<vtkTextMapper> myAnnotationMapper;
+#if (VTK_XVERSION < 0x050100)
vtkSmartPointer<vtkTextActor> myAnnotationActor;
+#else
+ vtkSmartPointer<vtkActor2D> myAnnotationActor;
+#endif
- vtkSmartPointer<VISU_FramedTextActor> myTextActor;
+ vtkSmartPointer<VTKViewer_FramedTextActor> myTextActor;
vtkSmartPointer<vtkFeatureEdges> myFeatureEdges;
bool myIsFeatureEdgesAllowed;
vtkDataSet* myValLblDataSet;
vtkActor2D* myValLabels;
vtkMaskPoints* myValMaskPoints;
- vtkCellCenters* myValCellCenters;
+ VTKViewer_CellCenters* myValCellCenters;
+ VISU_UsedPointsFilter* myValUsedPoints;
vtkLabeledDataMapper* myValLabeledDataMapper;
- vtkSelectVisiblePoints* myValSelectVisiblePoints;
+ VISU_SelectVisiblePoints* myValSelectVisiblePoints;
};
#endif //VISU_ACTOR_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File :
// Author :
#include "VISU_ActorBase.h"
#include "VISU_ActorFactory.h"
#include "VTKViewer_ShrinkFilter.h"
+#include "VTKViewer_Transform.h"
#include <vtkObjectFactory.h>
#include <vtkProperty.h>
if(theActorFactory)
myDestroySignal.connect(boost::bind(&TActorFactory::RemoveActor,
- theActorFactory,
- _1));
+ theActorFactory,
+ _1));
myActorFactory = theActorFactory;
}
}
}
+//----------------------------------------------------------------------------
+void
+VISU_ActorBase
+::SetTransform(VTKViewer_Transform* theTransform)
+{
+ Superclass::SetTransform( theTransform );
+
+ // Since the output of GetHighlightedDataSet() method (which is passed
+ // through transform filter) is used for calculation of bounds of the
+ // SALOME_Actor::myOutlineActor, we should remove transformation
+ // from the outline actor applied in SALOME_Actor::SetTransform().
+ // See issues IPAL22429, IPAL21936.
+ VTKViewer_Transform* aTransform = VTKViewer_Transform::New();
+ myOutlineActor->SetTransform( aTransform );
+ aTransform->Delete();
+}
+
//--------------------------------------------------------------------------
void
return myIsShrinkable;
}
+void
+VISU_ActorBase
+::SetShrinkFactor(vtkFloatingPointType theValue)
+{
+ myShrinkFilter->SetShrinkFactor(theValue);
+ Modified();
+}
+
+vtkFloatingPointType
+VISU_ActorBase
+::GetShrinkFactor()
+{
+ return myShrinkFilter->GetShrinkFactor();
+}
+
+
//--------------------------------------------------------------------------------------
void VISU_ActorBase::RemoveFromRender(vtkRenderer* theRenderer)
myUpdateActorsConnection = theUpdateActorSignal.connect(boost::bind(&VISU_ActorBase::UpdateFromFactory,this));
myRemoveFromRendererConnection = theRemoveFromRendererSignal.connect(boost::bind(&VISU_ActorBase::RemoveFromRender,this));
}
+
+//--------------------------------------------------------------------------------------
+vtkDataSet* VISU_ActorBase::GetHighlightedDataSet() {
+ return myPassFilter.back()->GetOutput();
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File :
// Author :
virtual void UpdateFromFactory();
//----------------------------------------------------------------------------
+ virtual void SetTransform(VTKViewer_Transform* theTransform);
virtual void SetLineWidth(vtkFloatingPointType theLineWidth);
virtual vtkFloatingPointType GetLineWidth();
virtual bool IsShrunkable();
virtual bool IsShrunk();
virtual void SetShrinkable(bool theIsShrinkable);
+
+ virtual void SetShrinkFactor(vtkFloatingPointType theFactor = 0.8);
+ virtual vtkFloatingPointType GetShrinkFactor();
virtual void SetRepresentation(int theMode);
virtual void ConnectToFactory(boost::signal0<void>& , boost::signal0<void>&);
+ //----------------------------------------------------------------------------
+ //! Return pointer to the dataset, which used to calculation of the bounding box of the actor
+ //! Redefined from VTKViewer_Actor
+ virtual vtkDataSet* GetHighlightedDataSet();
+
+
protected:
VISU_ActorBase();
virtual ~VISU_ActorBase();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File :
// Author :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File :
// Author :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File :
// Author :
#include "VISU_UnstructuredGridPL.hxx"
#include "VISU_PipeLineUtils.hxx"
-#include <vtkDataSetMapper.h>
+#include <VTKViewer_DataSetMapper.h>
+
#include <vtkObjectFactory.h>
#include <vtkImplicitBoolean.h>
#include <SALOME_ExtractGeometry.h>
//----------------------------------------------------------------------------
VISU_DataSetActor
::VISU_DataSetActor():
- myMapper(vtkDataSetMapper::New()),
+ myMapper(VTKViewer_DataSetMapper::New()),
myExtractor(SALOME_ExtractGeometry::New()),
myPolyDataExtractor(SALOME_ExtractPolyDataGeometry::New()),
myFunction(vtkImplicitBoolean::New())
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File :
// Author :
#include "VISU_Actor.h"
class vtkDataSetMapper;
+class VTKViewer_DataSetMapper;
class SALOME_ExtractGeometry;
class SALOME_ExtractPolyDataGeometry;
class vtkImplicitBoolean;
SetMapperInput(vtkDataSet* theDataSet);
//----------------------------------------------------------------------------
- vtkSmartPointer<vtkDataSetMapper> myMapper;
+ vtkSmartPointer<VTKViewer_DataSetMapper> myMapper;
vtkSmartPointer<SALOME_ExtractGeometry> myExtractor;
vtkSmartPointer<SALOME_ExtractPolyDataGeometry> myPolyDataExtractor;
vtkSmartPointer<vtkImplicitBoolean> myFunction;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_MeshAct.hxx
// Author : Laurent CORNABE with the help of Nicolas REJNERI
#include "VISU_Event.h"
#include "SVTK_Actor.h"
+#include "VTKViewer_FramedTextActor.h"
#include <SALOME_ExtractPolyDataGeometry.h>
#include <vtkCamera.h>
{
bool
CheckIsSameValue(vtkFloatingPointType theTarget,
- vtkFloatingPointType theSource)
+ vtkFloatingPointType theSource)
{
static vtkFloatingPointType TOL = 10.0 / VTK_LARGE_FLOAT;
return fabs(theTarget - theSource) < TOL;
bool
CheckIsSameVector(vtkFloatingPointType* theTarget,
- vtkFloatingPointType* theSource,
- size_t theLength)
+ vtkFloatingPointType* theSource,
+ size_t theLength)
{
for ( size_t anId = 0; anId < theLength; anId++ ) {
if ( !CheckIsSameValue( theTarget[ anId ], theSource[ anId ] ) )
- return false;
+ return false;
}
return true;
if( VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get() )
aPickingSettings->AddObserver(VISU::UpdatePickingSettingsEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
}
VISU_GaussPtsAct
if(theWidgetCtrl){
theWidgetCtrl->AddObserver(vtkCommand::EnableEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
theWidgetCtrl->AddObserver(vtkCommand::DisableEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
theWidgetCtrl->AddObserver(vtkCommand::StartInteractionEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
theWidgetCtrl->AddObserver(vtkCommand::EndInteractionEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
}
myWidgetCtrl = theWidgetCtrl;
inline
vtkFloatingPointType
GetRadius(vtkIdType theVTKID,
- vtkDataArray *theScalarArray,
- VISU_GaussPointsPL* theGaussPointsPL)
+ vtkDataArray *theScalarArray,
+ VISU_GaussPointsPL* theGaussPointsPL)
{
vtkFloatingPointType aRadius = 0.5;
if(theGaussPointsPL->GetPointSpriteMapper()->GetPointSpriteMode() == 1) // Geometry mode
else if(theGaussPointsPL->GetBicolor()){
vtkFloatingPointType aVal = theScalarArray->GetTuple1(theVTKID);
if(aVal > 0.0)
- aRadius *= theGaussPointsPL->GetMaxSize();
+ aRadius *= theGaussPointsPL->GetMaxSize();
else
- aRadius *= theGaussPointsPL->GetMinSize();
+ aRadius *= theGaussPointsPL->GetMinSize();
aRadius *= theGaussPointsPL->GetAverageCellSize();
}else
aRadius *= theGaussPointsPL->GetPointSize(theVTKID,theScalarArray);
vtkFloatingPointType
VISU_GaussPtsAct
::GetRadius(vtkIdType theObjID,
- vtkIdType theVTKID,
- vtkDataArray *theScalarArray)
+ vtkIdType theVTKID,
+ vtkDataArray *theScalarArray)
{
return ::GetRadius(theVTKID,theScalarArray,myDeviceActor->GetPipeLine());
}
}
+//----------------------------------------------------------------------------
+void
+VISU_GaussPtsAct
+::SetOpacity(vtkFloatingPointType theValue)
+{
+ GetGaussPointsPL()->SetOpacity(theValue);
+ Superclass::SetOpacity(theValue);
+}
+
+
//----------------------------------------------------------------------------
void
VISU_GaussPtsAct
using namespace VISU;
myGaussPtsActorFactory = dynamic_cast<TGaussPtsActorFactory*>(theActorFactory);
myUpdatePrs3dSignal.connect(boost::bind(&TGaussPtsActorFactory::UpdateFromActor,
- myGaussPtsActorFactory,
- _1));
+ myGaussPtsActorFactory,
+ _1));
Superclass::SetFactory(theActorFactory);
}
Superclass::SetVisibility(theMode);
myDeviceActor->SetVisibility(GetVisibility()); // VSV
myScalarBarCtrl->SetVisibility(theMode);
- Highlight(isHighlighted());
}
int
if(theInteractor){
theInteractor->AddObserver(vtkCommand::CharEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
theInteractor->AddObserver(VISU::SetSMDecreaseMagnificationEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
theInteractor->AddObserver(VISU::SetSMIncreaseMagnificationEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
}
Superclass::SetInteractor(theInteractor);
void
VISU_GaussPtsAct
::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
if(vtkObject* anObject = reinterpret_cast<vtkObject*>(theClientData))
if(VISU_GaussPtsAct* self = dynamic_cast<VISU_GaussPtsAct*>(anObject)) {
if(theEvent == VISU::UpdateInsideSettingsEvent)
- self->UpdateInsideCursorSettings();
+ self->UpdateInsideCursorSettings();
else
- self->OnInteractorEvent(theEvent);
+ self->OnInteractorEvent(theEvent);
}
}
{
if( IsSegmentationEnabled() )
{
- this->ChangeMagnification( myInteractor->GetShiftKey() );
- return;
+ this->ChangeMagnification( myInteractor->GetShiftKey() );
+ return;
}
myChangeMagnification = myInteractor->GetShiftKey();
{
if( IsSegmentationEnabled() && myWidgetCtrl->IsSphereActive() )
{
- VISU_SphereWidget* aSphereWidget = myWidgetCtrl->GetSphereWidget();
- aSphereWidget->ChangeRadius( myInteractor->GetShiftKey() );
- myWidgetCtrl->InvokeEvent(vtkCommand::EndInteractionEvent,NULL);
- myWidgetCtrl->GetInteractor()->Render();
+ VISU_SphereWidget* aSphereWidget = myWidgetCtrl->GetSphereWidget();
+ aSphereWidget->ChangeRadius( myInteractor->GetShiftKey() );
+ myWidgetCtrl->InvokeEvent(vtkCommand::EndInteractionEvent,NULL);
+ myWidgetCtrl->GetInteractor()->Render();
}
return;
}
if(Superclass::GetPickable()){
if(vtkMapper* aMapper = GetMapper()){
if(vtkDataSet* aDataSet= aMapper->GetInput()){
- aDataSet->Update();
- return aDataSet->GetNumberOfCells() > 0;
+ aDataSet->Update();
+ return aDataSet->GetNumberOfCells() > 0;
}
}
}
bool
VISU_GaussPtsAct
::PreHighlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight)
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight)
{
if ( !GetPickable() )
return false;
myPreHighlightActor->SetVisibility(false);
myCursorPyramid->SetVisibility(false);
- if (!myBarVisibility)
- return false;
+/* if (!myBarVisibility)
+ return false;*/
if(!theIsHighlight)
if(aSelectionMode == ActorSelection || !theIsHighlight)
return Superclass::PreHighlight(theInteractorStyle,
- theSelectionEvent,
- theIsHighlight);
+ theSelectionEvent,
+ theIsHighlight);
bool anIsChanged = (mySelectionMode != aSelectionMode);
bool anIsPreselected = myIsPreselected;
VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get();
if(aSelectionMode == GaussPointSelection && theIsHighlight){
+ SVTK::TPickLimiter aPickLimiter( myPointPicker, this );
myPointPicker->Pick(theSelectionEvent->myX,
- theSelectionEvent->myY,
- 0.0,
- theInteractorStyle->GetCurrentRenderer());
+ theSelectionEvent->myY,
+ 0.0,
+ theInteractorStyle->GetCurrentRenderer());
if(myPointPicker->GetActor() != this)
return (anIsPreselected != myIsPreselected);
vtkIdType anObjId = GetNodeObjId( aVtkId );
myIsPreselected = (anObjId >= 0);
if(myIsPreselected){
- anIsChanged = (myLastPreHighlightObjID != anObjId);
- if(anIsChanged){
- vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId);
+ anIsChanged = (myLastPreHighlightObjID != anObjId);
+ if(anIsChanged){
+ vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId);
//Take into account translation
vtkFloatingPointType aLocalNodeCoord[3];
this->Transform->Push();
aLocalNodeCoord[1] = aNodeCoord[1] + aPosition[1];
aLocalNodeCoord[2] = aNodeCoord[2] + aPosition[2];
- vtkDataSet* aDataSet = GetInput();
- vtkPointData* aPointData = aDataSet->GetPointData();
- if(vtkDataArray *aScalarArray = aPointData->GetScalars()){
- vtkFloatingPointType aPyramidHeight = aPickingSettings->GetPyramidHeight();
- aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
- //vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor();
- vtkFloatingPointType aColor[3];
- theInteractorStyle->GetCurrentRenderer()->GetBackground( aColor );
- aColor[0] = 1. - aColor[0];
- aColor[1] = 1. - aColor[1];
- aColor[2] = 1. - aColor[2];
-
- myCursorPyramid->Init(aPyramidHeight,
- aPickingSettings->GetCursorSize(),
- GetRadius(anObjId,aVtkId,aScalarArray),
- GetMagnification(anObjId),
- GetClamp(anObjId),
- aNodeCoord,
- aColor);
- }
+ vtkDataSet* aDataSet = GetInput();
+ vtkPointData* aPointData = aDataSet->GetPointData();
+ if(vtkDataArray *aScalarArray = aPointData->GetScalars()){
+ vtkFloatingPointType aPyramidHeight = aPickingSettings->GetPyramidHeight();
+ aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
+ //vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor();
+ vtkFloatingPointType aColor[3];
+ theInteractorStyle->GetCurrentRenderer()->GetBackground( aColor );
+ aColor[0] = 1. - aColor[0];
+ aColor[1] = 1. - aColor[1];
+ aColor[2] = 1. - aColor[2];
+
+ myCursorPyramid->Init(aPyramidHeight,
+ aPickingSettings->GetCursorSize(),
+ GetRadius(anObjId,aVtkId,aScalarArray),
+ GetMagnification(anObjId),
+ GetClamp(anObjId),
+ aNodeCoord,
+ aColor);
+ }
this->Transform->Pop();
- myLastPreHighlightObjID = anObjId;
- }
- myCursorPyramid->SetVisibility(true);
+ myLastPreHighlightObjID = anObjId;
+ }
+ myCursorPyramid->SetVisibility(true);
}
}
}
inline
void
ChangeZoom(VISU_PickingSettings *thePickingSettings,
- vtkRenderer* theRenderer,
- vtkIdType theInitialHasIndex,
- vtkIdType theCurrentHasIndex)
+ vtkRenderer* theRenderer,
+ vtkIdType theInitialHasIndex,
+ vtkIdType theCurrentHasIndex)
{
if( (theInitialHasIndex + theCurrentHasIndex == 1) && thePickingSettings){
vtkCamera *aCamera = theRenderer->GetActiveCamera();
bool
VISU_GaussPtsAct
::Highlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight)
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight)
{
if ( !GetPickable() )
return false;
mySelector->RemoveIObject(anIO);
/* ChangeZoom(myPickingSettings,
- theInteractorStyle,
- anInitialHasIndex,
- false,
- anIO);*/
+ theInteractorStyle,
+ anInitialHasIndex,
+ false,
+ anIO);*/
return true;
}
- if (!myBarVisibility)
- return false;
+/* if (!myBarVisibility)
+ return false;*/
if(aSelectionMode == ActorSelection)
return Superclass::Highlight(theInteractorStyle,
- theSelectionEvent,
- theIsHighlight);
+ theSelectionEvent,
+ theIsHighlight);
if(aSelectionMode == GaussPointSelection && !theSelectionEvent->myIsRectangle){
-
vtkRenderer *aRenderer = theInteractorStyle->GetCurrentRenderer();
+
+ SVTK::TPickLimiter aPickLimiter( myPointPicker, this );
myPointPicker->Pick(theSelectionEvent->myX,
- theSelectionEvent->myY,
- 0.0,
- aRenderer);
+ theSelectionEvent->myY,
+ 0.0,
+ aRenderer);
if(myPointPicker->GetActor() != this) {
mySelector->ClearIObjects();
/* ChangeZoom(myPickingSettings,
- theInteractorStyle,
- anInitialHasIndex,
- false,
- anIO);*/
+ theInteractorStyle,
+ anInitialHasIndex,
+ false,
+ anIO);*/
return true;
}
if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) && hasIO()) {
vtkIdType anObjId = GetNodeObjId( aVtkId );
if(anObjId >= 0){
- // myIsHighlighted = true;
- // Update the Selector
- if(mySelector->IsSelected(myIO))
- mySelector->AddOrRemoveIndex(myIO,anObjId,theSelectionEvent->myIsShift);
- else{
- if(!theSelectionEvent->myIsShift){
- mySelector->ClearIObjects();
- }
- mySelector->AddOrRemoveIndex(myIO,anObjId,theSelectionEvent->myIsShift);
- mySelector->AddIObject(this);
- }
- /*
- vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId);
- //
- // FlyTo
- vtkRenderWindowInteractor* anInteractor = theInteractorStyle->GetInteractor();
- vtkFloatingPointType aDollyWas = anInteractor->GetDolly();
- int aNumberOfFlyFramesWas = anInteractor->GetNumberOfFlyFrames();
-
- anInteractor->SetDolly(0.);
- anInteractor->SetNumberOfFlyFrames(myPickingSettings->GetStepNumber());
- anInteractor->FlyTo(aRenderer,aNodeCoord);
- aRenderer->ResetCameraClippingRange();
- anInteractor->SetDolly(aDollyWas);
- anInteractor->SetNumberOfFlyFrames(aNumberOfFlyFramesWas);
-
- anInteractor->InvokeEvent(SVTK::ChangeRotationPoint, aNodeCoord);*/
-
- mySelectionMode = aSelectionMode;
-
- /* ChangeZoom(myPickingSettings,
- theInteractorStyle,
- anInitialHasIndex,
- true,
- anIO);*/
-
- return true;
+ // myIsHighlighted = true;
+ // Update the Selector
+ if(mySelector->IsSelected(myIO))
+ mySelector->AddOrRemoveIndex(myIO,anObjId,theSelectionEvent->myIsShift);
+ else{
+ if(!theSelectionEvent->myIsShift){
+ mySelector->ClearIObjects();
+ }
+ mySelector->AddOrRemoveIndex(myIO,anObjId,theSelectionEvent->myIsShift);
+ mySelector->AddIObject(this);
+ }
+ /*
+ vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId);
+ //
+ // FlyTo
+ vtkRenderWindowInteractor* anInteractor = theInteractorStyle->GetInteractor();
+ vtkFloatingPointType aDollyWas = anInteractor->GetDolly();
+ int aNumberOfFlyFramesWas = anInteractor->GetNumberOfFlyFrames();
+
+ anInteractor->SetDolly(0.);
+ anInteractor->SetNumberOfFlyFrames(myPickingSettings->GetStepNumber());
+ anInteractor->FlyTo(aRenderer,aNodeCoord);
+ aRenderer->ResetCameraClippingRange();
+ anInteractor->SetDolly(aDollyWas);
+ anInteractor->SetNumberOfFlyFrames(aNumberOfFlyFramesWas);
+
+ anInteractor->InvokeEvent(SVTK::ChangeRotationPoint, aNodeCoord);*/
+
+ mySelectionMode = aSelectionMode;
+
+ /* ChangeZoom(myPickingSettings,
+ theInteractorStyle,
+ anInitialHasIndex,
+ true,
+ anIO);*/
+
+ return true;
}// if( anObjId >= 0 ) {
}//if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) && hasIO())
}//if(!theSelectionEvent->myIsRectangle){
/* ChangeZoom(myPickingSettings,
- theInteractorStyle,
- anInitialHasIndex,
- false,
- anIO);*/
+ theInteractorStyle,
+ anInitialHasIndex,
+ false,
+ anIO);*/
return false;
}
if( GetVisibility() && aPickingSettings->GetCameraMovementEnabled() )
{
ChangeZoom(aPickingSettings,
- GetRenderer(),
- anInitialHasIndex,
- aCurrentHasIndex);
+ GetRenderer(),
+ anInitialHasIndex,
+ aCurrentHasIndex);
}
if( aSelectionMode == ActorSelection ) {
// myCursorPyramidSelected->SetVisibility(anIsVisible);
//GetScalarBarCtrl()->Update();
-// myIsHighlighted = aCurrentHasIndex;
+ // to fix a bug with incorrect representation after the first highlight action
+ myIsHighlighted = aCurrentHasIndex;
// Zoom if necessary
// ChangeZoom(myPickingSettings,
-// GetRenderer(),
-// anInitialHasIndex,
-// aCurrentHasIndex);
+// GetRenderer(),
+// anInitialHasIndex,
+// aCurrentHasIndex);
// TColStd_IndexedMapOfInteger aMapIndex;
mySelector->GetIndex( getIO(), aMapIndex );
vtkFloatingPointType aPyramidHeight = aPickingSettings->GetPyramidHeight();
aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
myCursorPyramidSelected->Init(aPyramidHeight,
- aPickingSettings->GetCursorSize(),
- GetRadius(anObjId,aVtkId,aScalarArray),
- GetMagnification(anObjId),
- GetClamp(anObjId),
- aLocalNodeCoord,
- myHighlightActor->GetProperty()->GetColor());
+ aPickingSettings->GetCursorSize(),
+ GetRadius(anObjId,aVtkId,aScalarArray),
+ GetMagnification(anObjId),
+ GetClamp(anObjId),
+ aLocalNodeCoord,
+ myHighlightActor->GetProperty()->GetColor());
myCursorPyramidSelected->SetVisibility(anIsVisible && theIsHighlight);
//
const VISU::PGaussPtsIDMapper& aGaussPtsIDMapper =
- myGaussPointsPL->GetGaussPtsIDMapper();
+ myGaussPointsPL->GetGaussPtsIDMapper();
VISU::TNamedIDMapper* aParent = aGaussPtsIDMapper->GetParent();
VISU::TGaussPointID aGaussPointID = myGaussPointsPL->GetObjID(anObjId);
aStr<<"\nParentCellID: "<<aCellID;
std::string aParentName = aParent->GetElemName(aCellID);
if(aParentName != "") {
- aStr<<"\nParentCellName: '"<<aParentName<<"'";
+ aStr<<"\nParentCellName: '"<<aParentName<<"'";
}
aStr<<"\nLocalPntID: "<<aLocalPntID;
aStr<<"\nScalar: "<<aVal;
aStr<<"\nData: {";
int anId = 0;
while(anId < aNbComp){
- vtkFloatingPointType aComp = aTuple[anId++];
- aStr<<aComp;
- if(anId < aNbComp)
- aStr<<"; ";
+ vtkFloatingPointType aComp = aTuple[anId++];
+ aStr<<aComp;
+ if(anId < aNbComp)
+ aStr<<"; ";
}
aStr<<"}";
}
myTextActor->SetTransparency(aPickingSettings->GetInfoWindowTransparency());
myTextActor->SetWorldPoint(aWorldCoord);
myTextActor->SetText(aString.c_str());
+ myTextActor->SetMoveFrameFlag(1);
myTextActor->SetVisibility(anIsVisible && theIsHighlight && aShowTextActor);
//
// myCellActor
vtkIdType aNbPoints = aCellPoints->GetNumberOfIds();
for (vtkIdType i = 0; i < aNbPoints; i++) {
- aCellDataSet->GetPointCells(aCellPoints->GetId(i), aPointCells);
+ aCellDataSet->GetPointCells(aCellPoints->GetId(i), aPointCells);
- // add cell ids
- vtkIdType aNbCells = aPointCells->GetNumberOfIds();
- for (vtkIdType j = 0; j < aNbCells; j++)
- aNeighbourCells->InsertUniqueId(aPointCells->GetId(j));
+ // add cell ids
+ vtkIdType aNbCells = aPointCells->GetNumberOfIds();
+ for (vtkIdType j = 0; j < aNbCells; j++)
+ aNeighbourCells->InsertUniqueId(aPointCells->GetId(j));
}
aPointCells->Delete();
// get vector data
vtkDataArray* anInputVectors = aDataSetAttributes->GetVectors();
if (!anInputVectors)
- return;
+ return;
// insert neighbour cells to the special dataset
vtkUnstructuredGrid *aCellsToWarp = vtkUnstructuredGrid::New();
std::vector<vtkFloatingPointType> aTuple(aNbComp);
for (vtkIdType i = 0; i < aNbNeighbourCells; i++) {
- vtkIdType aVTKCellId = aNeighbourCells->GetId(i);
- vtkIdType anObjCellId = aParent->GetElemObjID(aVTKCellId);
-
- vtkCell* aCurCell = aParent->GetElemCell(anObjCellId);
-
- vtkIdType aNewCellId = aCellsToWarp->InsertNextCell(aCurCell->GetCellType(), aCurCell->GetPointIds());
-
- // get gauss points corresponding to the current cell
- vtkIdType aPointVtkId = -1;
- vtkIdType aLocalPntId = 0;
- aPointVtkId = aGaussPtsIDMapper->GetVTKID(VISU::TGaussPointID(anObjCellId, aLocalPntId));
-
- if (aPointVtkId >= 0) {
- // Compute average vector
- aCellVectors->Reset();
- while (aPointVtkId >= 0) {
- anInputVectors->GetTuple(aPointVtkId, &aTuple[0]);
-
- if (aNbComp >= 3)
- aCellVectors->InsertNextTuple3(aTuple[0], aTuple[1], aTuple[2]);
- else if (aNbComp == 2)
- aCellVectors->InsertNextTuple3(aTuple[0], aTuple[1], 0);
- else if (aNbComp == 1)
- aCellVectors->InsertNextTuple3(aTuple[0], 0, 0);
-
- aPointVtkId = aGaussPtsIDMapper->GetVTKID(VISU::TGaussPointID(anObjCellId, ++aLocalPntId));
- }
-
- double aXCoord = 0, anYCoord = 0, aZCoord = 0;
-
- vtkIdType aNbVectors = aCellVectors->GetNumberOfTuples();
-
- for (vtkIdType aVecId = 0; aVecId < aNbVectors; aVecId++) {
- aXCoord += aCellVectors->GetComponent(aVecId, 0);
- anYCoord += aCellVectors->GetComponent(aVecId, 1);
- aZCoord += aCellVectors->GetComponent(aVecId, 2);
- }
-
- aXCoord = aXCoord / aNbVectors;
- anYCoord = anYCoord / aNbVectors;
- aZCoord = aZCoord / aNbVectors;
-
- // set vector data for the cell
- aVectorsToSet->SetTuple3(aNewCellId, aXCoord, anYCoord, aZCoord);
- }
- else
- aVectorsToSet->SetTuple3(aNewCellId, 0, 0, 0);
+ vtkIdType aVTKCellId = aNeighbourCells->GetId(i);
+ vtkIdType anObjCellId = aParent->GetElemObjID(aVTKCellId);
+
+ vtkCell* aCurCell = aParent->GetElemCell(anObjCellId);
+
+ vtkIdType aNewCellId = aCellsToWarp->InsertNextCell(aCurCell->GetCellType(), aCurCell->GetPointIds());
+
+ // get gauss points corresponding to the current cell
+ vtkIdType aPointVtkId = -1;
+ vtkIdType aLocalPntId = 0;
+ aPointVtkId = aGaussPtsIDMapper->GetVTKID(VISU::TGaussPointID(anObjCellId, aLocalPntId));
+
+ if (aPointVtkId >= 0) {
+ // Compute average vector
+ aCellVectors->Reset();
+ while (aPointVtkId >= 0) {
+ anInputVectors->GetTuple(aPointVtkId, &aTuple[0]);
+
+ if (aNbComp >= 3)
+ aCellVectors->InsertNextTuple3(aTuple[0], aTuple[1], aTuple[2]);
+ else if (aNbComp == 2)
+ aCellVectors->InsertNextTuple3(aTuple[0], aTuple[1], 0);
+ else if (aNbComp == 1)
+ aCellVectors->InsertNextTuple3(aTuple[0], 0, 0);
+
+ aPointVtkId = aGaussPtsIDMapper->GetVTKID(VISU::TGaussPointID(anObjCellId, ++aLocalPntId));
+ }
+
+ double aXCoord = 0, anYCoord = 0, aZCoord = 0;
+
+ vtkIdType aNbVectors = aCellVectors->GetNumberOfTuples();
+
+ for (vtkIdType aVecId = 0; aVecId < aNbVectors; aVecId++) {
+ aXCoord += aCellVectors->GetComponent(aVecId, 0);
+ anYCoord += aCellVectors->GetComponent(aVecId, 1);
+ aZCoord += aCellVectors->GetComponent(aVecId, 2);
+ }
+
+ aXCoord = aXCoord / aNbVectors;
+ anYCoord = anYCoord / aNbVectors;
+ aZCoord = aZCoord / aNbVectors;
+
+ // set vector data for the cell
+ aVectorsToSet->SetTuple3(aNewCellId, aXCoord, anYCoord, aZCoord);
+ }
+ else
+ aVectorsToSet->SetTuple3(aNewCellId, 0, 0, 0);
}
aCellsToWarp->GetCellData()->SetVectors(aVectorsToSet);
if(theInsideCursorSettings){
theInsideCursorSettings->AddObserver(VISU::UpdateInsideSettingsEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
UpdateInsideCursorSettings();
}
}
return myFunction->GetFunction();
}
+//----------------------------------------------------------------------------
+vtkDataSet* VISU_GaussPtsAct::GetValLabelsInput()
+{
+ return GetInput();
+}
+
//==============================================================================
vtkFloatingPointType
VISU_GaussPtsAct1
::GetRadius(vtkIdType theObjID,
- vtkIdType theVTKID,
- vtkDataArray *theScalarArray)
+ vtkIdType theVTKID,
+ vtkDataArray *theScalarArray)
{
VISU_GaussPointsPL* aPipeLine = myDeviceActor->GetPipeLine();
if(IsSegmentationEnabled()){
void
VISU_GaussPtsAct1::SetPosition(double _arg[3]){
- if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct1::SetPosition - this = "<<this);
+ if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct1::SetPosition - this = "<<this);
Superclass::SetPosition(_arg);
myUpdatePositionSignal(_arg);
}
if(theOutsideCursorSettings)
{
theOutsideCursorSettings->AddObserver(VISU::UpdateOutsideSettingsEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
UpdateOutsideCursorSettings();
}
}
void
VISU_GaussPtsAct1
::ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData)
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData)
{
if(vtkObject* anObject = reinterpret_cast<vtkObject*>(theClientData))
if(VISU_GaussPtsAct1* self = dynamic_cast<VISU_GaussPtsAct1*>(anObject))
if(theEvent == VISU::UpdateOutsideSettingsEvent)
- self->UpdateOutsideCursorSettings();
+ self->UpdateOutsideCursorSettings();
Superclass::ProcessEvents(theObject,theEvent,theClientData,theCallData);
}
//----------------------------------------------------------------------------
void
VISU_GaussPtsAct2::SetPosition(double _arg[3]){
- if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct2::SetPosition - this = "<<this);
+ if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct2::SetPosition - this = "<<this);
Superclass::SetPosition(_arg);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ScalarMapAct.h
// Author : Laurent CORNABE with help of Nicolas REJNERI
class VISU_GaussPtsDeviceActor;
class VISU_CursorPyramid;
-class VISU_FramedTextActor;
class vtkUnstructuredGrid;
class vtkPolyDataMapper;
unsigned long int
GetMemorySize();
+ //----------------------------------------------------------------------------
+ virtual
+ void
+ SetOpacity(vtkFloatingPointType theValue);
+
//----------------------------------------------------------------------------
virtual
void
virtual
bool
PreHighlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight);
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight);
//! Redefined method of the actor's highlighting
virtual
bool
Highlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight);
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight);
//----------------------------------------------------------------------------
//! Set the picking settings to the actor.
virtual vtkImplicitFunctionCollection* GetClippingPlanes();
+ //----------------------------------------------------------------------------
+ virtual
+ vtkDataSet*
+ GetValLabelsInput();
+
protected:
//----------------------------------------------------------------------------
VISU_GaussPtsAct();
virtual
vtkFloatingPointType
GetRadius(vtkIdType theObjID,
- vtkIdType theVTKID,
- vtkDataArray *theScalarArray);
+ vtkIdType theVTKID,
+ vtkDataArray *theScalarArray);
//! To get current value of the magnification
virtual
static
void
ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
// To process VTK event method
virtual
virtual
int
RenderTranslucentGeometry(vtkViewport *viewport);
-
+
virtual
void
SetPosition(double _arg[3]);
virtual
vtkFloatingPointType
GetRadius(vtkIdType theObjID,
- vtkIdType theVTKID,
- vtkDataArray *theScalarArray);
+ vtkIdType theVTKID,
+ vtkDataArray *theScalarArray);
//! To get current value of the magnification
virtual
static
void
ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
// To process VTK event method
virtual
virtual
unsigned long int
GetMemorySize();
-
+
virtual
void
SetPosition(double _arg[3]);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ScalarMapAct.h
// Author : Laurent CORNABE with help of Nicolas REJNERI
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH OBJECT : interactive object for SMESH visualization
// File :
// Author :
TTextureValue
GetTexture(const std::string& theMainTexture,
- const std::string& theAlphaTexture)
+ const std::string& theAlphaTexture)
{
typedef std::pair<std::string,std::string> TTextureKey;
typedef std::map<TTextureKey,TTextureValue> TTextureMap;
QString anAlphaTextureVTI = Image2VTI(theAlphaTexture).c_str();
if( !aMainTextureVTI.isNull() && !anAlphaTextureVTI.isNull() ){
- aTextureValue =
- VISU_GaussPointsPL::MakeTexture( aMainTextureVTI.toLatin1().data(),
- anAlphaTextureVTI.toLatin1().data() );
+ aTextureValue =
+ VISU_GaussPointsPL::MakeTexture( aMainTextureVTI.toLatin1().data(),
+ anAlphaTextureVTI.toLatin1().data() );
- if( aTextureValue.GetPointer() )
- aTextureMap[aTextureKey] = aTextureValue;
+ if( aTextureValue.GetPointer() )
+ aTextureMap[aTextureKey] = aTextureValue;
}
RemoveFile(aMainTextureVTI.toLatin1().data());
void
VISU_GaussDeviceActorBase
::DoMapperShallowCopy( vtkMapper* theMapper,
- bool theIsCopyInput )
+ bool theIsCopyInput )
{
VISU::CopyMapper( GetMapper(), theMapper, theIsCopyInput );
}
if(Superclass::GetPickable()){
if(vtkMapper* aMapper = GetMapper()){
if(vtkDataSet* aDataSet= aMapper->GetInput()){
- aDataSet->Update();
- return aDataSet->GetNumberOfCells() > 0;
+ aDataSet->Update();
+ return aDataSet->GetNumberOfCells() > 0;
}
}
}
void
VISU_CursorPyramid
::SetPreferences(vtkFloatingPointType theHeight,
- vtkFloatingPointType theCursorSize)
+ vtkFloatingPointType theCursorSize)
{
Init(theHeight, theCursorSize, myRadius, myMagnification, myClamp, GetPosition(), GetProperty()->GetColor());
}
mySources[5]->SetCenter(0.0, 0.0, -aDisplacement);
}
-
-//----------------------------------------------------------------------------
-#include <vtkViewport.h>
-#include <vtkWindow.h>
-#include <vtkProp.h>
-#include <vtkPolyData.h>
-#include <vtkPolyDataMapper2D.h>
-#include <vtkActor2D.h>
-#include <vtkTimeStamp.h>
-#include <vtkTextProperty.h>
-#include <vtkTextActor.h>
-#include <vtkTextMapper.h>
-#include <vtkPoints.h>
-#include <vtkCellArray.h>
-#include <vtkProperty2D.h>
-//==================================================================
-vtkCxxRevisionMacro(VISU_FramedTextActor, "$Revision$");
-vtkStandardNewMacro(VISU_FramedTextActor);
-
-//==================================================================
-// function : VISU_FramedTextActor
-// purpose :
-//==================================================================
-VISU_FramedTextActor::VISU_FramedTextActor()
-{
- PositionCoordinate->SetCoordinateSystemToNormalizedViewport();
-
- myTransparency=0.;
- myBar = vtkPolyData::New();
- myBarMapper = vtkPolyDataMapper2D::New();
- myBarMapper->SetInput(myBar);
- myBarActor = vtkActor2D::New();
- myBarActor->SetMapper(myBarMapper);
- myBarActor->GetProperty()->SetOpacity(1.-myTransparency);
- myBarActor->GetProperty()->SetColor(.5, .5, .5);
- //
- myTextProperty = vtkTextProperty::New();
- myTextProperty->SetFontSize(12);
- myTextProperty->SetBold(0);
- myTextProperty->SetItalic(0);
- myTextProperty->SetShadow(1);
- myTextProperty->SetFontFamilyToArial();
- //
- myTextMapper=vtkTextMapper::New();
- myTextMapper->SetInput("");
- myTextMapper->GetTextProperty()->ShallowCopy(myTextProperty);
- myTextActor=vtkActor2D::New();
- myTextActor->SetMapper(myTextMapper);
- //
- myBarActor->SetVisibility(1);
- myTextActor->SetVisibility(1);
- myBarActor->SetPickable(0);
- myTextActor->SetPickable(0);
- //----------------------------------------------------------
- myModePosition=0;// 0 -centered below the point
- // 1 -top left corner of the 3D view window
- //
- for(int i=0; i<4; i++) {
- myWorldPoint[i] = 0.;
- }
- myDistance=10.;
- //
-}
-//==================================================================
-// function : ~
-// purpose :
-//==================================================================
-VISU_FramedTextActor::~VISU_FramedTextActor()
-{
- myTextActor->Delete();
- myTextMapper->Delete();
- myTextProperty->Delete();
- myBarActor->Delete();
- myBarMapper->Delete();
- myBar->Delete();
-}
-//==================================================================
-// function : SetVisibility
-// purpose :
-//==================================================================
-void VISU_FramedTextActor::SetVisibility (int theVisibility)
-{
- myBarActor->SetVisibility(theVisibility);
- myTextActor->SetVisibility(theVisibility);
-}
-//==================================================================
-// function : GetVisibility
-// purpose :
-//==================================================================
-int VISU_FramedTextActor::GetVisibility()
-{
- return myBarActor->GetVisibility();
-}
-//==================================================================
-// function : SetPickable
-// purpose :
-//==================================================================
-void VISU_FramedTextActor::SetPickable (int thePickability)
-{
- myBarActor->SetPickable(thePickability);
- myTextActor->SetPickable(thePickability);
-}
-//==================================================================
-// function : GetPickable
-// purpose :
-//==================================================================
-int VISU_FramedTextActor::GetPickable()
-{
- return myBarActor->GetPickable();
-}
-//==================================================================
-// function : SetTransparency
-// purpose :
-//==================================================================
-void VISU_FramedTextActor::SetTransparency(const vtkFloatingPointType theTransparency)
-{
- if (theTransparency>=0. && theTransparency<=1.){
- myTransparency=theTransparency;
- myBarActor->GetProperty()->SetOpacity(1.-myTransparency);
- Modified();
- }
-}
-//==================================================================
-// function : GetTransparency
-// purpose :
-//==================================================================
-vtkFloatingPointType VISU_FramedTextActor::GetTransparency()const
-{
- return myTransparency;
-}
-//==================================================================
-// function : SetText
-// purpose :
-//==================================================================
-void VISU_FramedTextActor::SetText(const char* theText)
-{
- myTextMapper->SetInput(theText);
- Modified();
-}
-//==================================================================
-// function : GetText
-// purpose :
-//==================================================================
-char* VISU_FramedTextActor::GetText()
-{
- return myTextMapper->GetInput();
-}
-//==================================================================
-// function : SetModePosition
-// purpose :
-//==================================================================
-void VISU_FramedTextActor::SetModePosition(const int theMode)
-{
- myModePosition=theMode;
- Modified();
-}
-//==================================================================
-// function : GetModePosition
-// purpose :
-//==================================================================
-int VISU_FramedTextActor::GetModePosition()const
-{
- return myModePosition;
-}
-//==================================================================
-// function : SetWorldPoint
-// purpose :
-//==================================================================
-void VISU_FramedTextActor::SetWorldPoint(const vtkFloatingPointType theWorldPoint[4])
-{
- for(int i = 0; i<4; ++i) {
- myWorldPoint[i] = theWorldPoint[i];
- }
- Modified();
-}
-//==================================================================
-// function : GetWorldPoint
-// purpose :
-//==================================================================
-const vtkFloatingPointType* VISU_FramedTextActor::GetWorldPoint()const
-{
- return myWorldPoint;
-}
-//==================================================================
-// function : SetDistance
-// purpose :
-//==================================================================
-void VISU_FramedTextActor::SetDistance(const vtkFloatingPointType theDistance)
-{
- myDistance=theDistance;
-}
-//==================================================================
-// function : GetDistance
-// purpose :
-//==================================================================
-vtkFloatingPointType VISU_FramedTextActor::GetDistance()const
-{
- return myDistance;
-}
-//==================================================================
-// function : ReleaseGraphicsResources
-// purpose :
-//==================================================================
-void VISU_FramedTextActor::ReleaseGraphicsResources(vtkWindow *win)
-{
- myTextActor->ReleaseGraphicsResources(win);
- myBarActor->ReleaseGraphicsResources(win);
-}
-//==================================================================
-// function : RenderOverlay
-// purpose :
-//==================================================================
-int VISU_FramedTextActor::RenderOverlay(vtkViewport *viewport)
-{
- int renderedSomething = 0;
- myBarActor->RenderOverlay(viewport);
- renderedSomething +=myTextActor->RenderOverlay(viewport);
- return renderedSomething;
-}
-//==================================================================
-// function : RenderOpaqueGeometry
-// purpose :
-//==================================================================
-int
-VISU_FramedTextActor
-::RenderOpaqueGeometry(vtkViewport *theViewport)
-{
- int anIsRenderedSomething = 0;
- int* aViewportSize = theViewport->GetSize();
- if(aViewportSize[0] == 1 || aViewportSize[1] == 1)
- return anIsRenderedSomething;
-
- myBar->Initialize();
-
- int aNbPoints = 4;
- vtkPoints *aPoints = vtkPoints::New();
- aPoints->SetNumberOfPoints(aNbPoints);
- myBar->SetPoints(aPoints);
- aPoints->Delete();
-
- vtkCellArray *aPolys = vtkCellArray::New();
- aPolys->Allocate(aPolys->EstimateSize(1,4));
- vtkIdType aPointsIds[4] = {0, 1, 3, 2};
- aPolys->InsertNextCell(4,aPointsIds);
- myBar->SetPolys(aPolys);
- aPolys->Delete();
-
- int aTextSize[2];
- myTextMapper->GetSize(theViewport, aTextSize);
- int aBarWidth = aTextSize[0];
- int aBarHeight = aTextSize[1];
-
- if (myModePosition==0) {
- theViewport->SetWorldPoint(myWorldPoint);
- theViewport->WorldToDisplay();
-
- vtkFloatingPointType aSelectionPoint[3];
- theViewport->GetDisplayPoint(aSelectionPoint);
- vtkFloatingPointType u = aSelectionPoint[0];
- vtkFloatingPointType v = aSelectionPoint[1] - myDistance;
- theViewport->ViewportToNormalizedViewport(u, v);
- PositionCoordinate->SetValue(u, v);
- //
- myTextProperty->SetJustificationToCentered();
- myTextProperty->SetVerticalJustificationToTop();
- //
- aBarWidth /= 2;
- aPoints->SetPoint(0, -aBarWidth, 0.0, 0.0);
- aPoints->SetPoint(1, -aBarWidth, -aBarHeight, 0.0);
- aPoints->SetPoint(2, aBarWidth, 0.0, 0.0);
- aPoints->SetPoint(3, aBarWidth, -aBarHeight, 0.0);
- }
- else {//if (myModePosition==1) {
- PositionCoordinate->SetValue(0.0, 1.0);
- myTextProperty->SetJustificationToLeft();
- myTextProperty->SetVerticalJustificationToTop();
- //
- aPoints->SetPoint(0, 0.0, 0.0, 0.0);
- aPoints->SetPoint(1, 0.0, -aBarHeight, 0.0);
- aPoints->SetPoint(2, aBarWidth, 0.0, 0.0);
- aPoints->SetPoint(3, aBarWidth, -aBarHeight, 0.0);
- }
- //
- myTextMapper->GetTextProperty()->ShallowCopy(myTextProperty);
- myBarActor ->GetPositionCoordinate()->SetReferenceCoordinate(PositionCoordinate);
- myTextActor->GetPositionCoordinate()->SetReferenceCoordinate(PositionCoordinate);
- //
- myBuildTime.Modified();
- //
- return anIsRenderedSomething;
-}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH OBJECT : interactive object for SMESH visualization
// File :
// Author :
VISU_OBJECT_EXPORT
TTextureValue
GetTexture(const std::string& theMainTexture,
- const std::string& theAlphaTexture);
+ const std::string& theAlphaTexture);
}
virtual
void
DoMapperShallowCopy( vtkMapper* theMapper,
- bool theIsCopyInput );
+ bool theIsCopyInput );
VISU_OpenGLPointSpriteMapper*
GetPointSpriteMapper();
vtkFloatingPointType theColor[3]);
void SetPreferences(vtkFloatingPointType theHeight,
- vtkFloatingPointType theCursorSize);
+ vtkFloatingPointType theCursorSize);
protected:
VISU_CursorPyramid();
};
-//==================================================================
-// class VISU_FramedTextActor
-//
-#include <vtkActor2D.h>
-//
-class vtkViewport;
-class vtkProp;
-class vtkWindow;
-class vtkPolyData;
-class vtkPolyDataMapper2D;
-class vtkActor2D;
-class vtkTimeStamp;
-class vtkTextProperty;
-class vtkTextMapper;
-
-class VISU_FramedTextActor : public vtkActor2D
-{
-public:
- // vtks
- vtkTypeRevisionMacro(VISU_FramedTextActor,vtkActor2D);
- static VISU_FramedTextActor *New();
- //
- virtual int RenderOpaqueGeometry(vtkViewport* viewport);
- virtual int RenderTranslucentGeometry(vtkViewport*) { return 0; };
- virtual int RenderOverlay(vtkViewport* viewport);
- virtual void ReleaseGraphicsResources(vtkWindow *);
- virtual void SetVisibility (int );
- virtual int GetVisibility() ;
- virtual void SetPickable (int ) ;
- virtual int GetPickable();
- //
- // selectors
- void SetText(const char* theText);
- char* GetText();
- //
- void SetModePosition(const int theMode);
- int GetModePosition()const;
- //
- void SetWorldPoint(const vtkFloatingPointType theWorldPoint[4]);
- const vtkFloatingPointType* GetWorldPoint()const;
- //
- void SetDistance(const vtkFloatingPointType theDistance);
- vtkFloatingPointType GetDistance()const;
- //
- void SetTransparency(const vtkFloatingPointType theTransparency);
- vtkFloatingPointType GetTransparency()const;
- //
-protected:
- VISU_FramedTextActor();
- ~VISU_FramedTextActor();
-
-protected:
- vtkPolyData *myBar;
- vtkPolyDataMapper2D *myBarMapper;
- vtkActor2D *myBarActor;
- //
- vtkTextProperty *myTextProperty;
- vtkTextMapper *myTextMapper;
- vtkActor2D *myTextActor;
- //
- vtkTimeStamp myBuildTime;
- //
- int myModePosition;
- vtkFloatingPointType myWorldPoint[4];
- vtkFloatingPointType myDistance;
- vtkFloatingPointType myTransparency;
-
-private:
- VISU_FramedTextActor(const VISU_FramedTextActor&); // Not implemented.
- void operator=(const VISU_FramedTextActor&); // Not implemented.
-};
-
#endif //VISU_GAUSS_PTS_DEVICE_ACTOR_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File :
// Author :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File :
// Author :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_IsoSurfActor.cxx
// Author : Vitaly Smetannikov
unsigned long aTime = myLabelsDataSet->GetMTime();
unsigned long anObjTime = GetMTime();
if (aTime < anObjTime) {
- myLabelsDataSet->ShallowCopy(aDataSet);
- myLabelsDataSet->Modified();
+ myLabelsDataSet->ShallowCopy(aDataSet);
+ myLabelsDataSet->Modified();
}
}
}
//----------------------------------------------------------------------------
void VISU_IsoSurfActor::RemoveFromRender(vtkRenderer* theRenderer)
{
- VISU_ScalarMapAct::RemoveFromRender(theRenderer);
theRenderer->RemoveActor(myLabels);
+ VISU_ScalarMapAct::RemoveFromRender(theRenderer);
}
//From vtkFollower
return VISU_ScalarMapAct::RenderOpaqueGeometry(vp);
}
-
+#if (VTK_XVERSION < 0x050100)
int VISU_IsoSurfActor::RenderTranslucentGeometry(vtkViewport *vp)
+#else
+int VISU_IsoSurfActor::RenderTranslucentPolygonalGeometry(vtkViewport *vp)
+#endif
{
UpdateLabels();
+#if (VTK_XVERSION < 0x050100)
return VISU_ScalarMapAct::RenderTranslucentGeometry(vp);
+#else
+ return VISU_ScalarMapAct::RenderTranslucentPolygonalGeometry(vp);
+#endif
}
void VISU_IsoSurfActor::SetVisibility(int theMode){
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_IsoSurfActor.h
// Author : Vitaly Smetannikov
virtual void RemoveFromRender( vtkRenderer* );
virtual int RenderOpaqueGeometry(vtkViewport *viewport);
+#if (VTK_XVERSION < 0x050100)
virtual int RenderTranslucentGeometry(vtkViewport *viewport);
+#else
+ virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
+#endif
//virtual void SetPipeLine(VISU_PipeLine* thePipeLine);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_MeshAct.cxx
// Author :
//
#include "VISU_MeshAct.h"
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
#include <vtkObjectFactory.h>
#include <vtkRenderer.h>
#include <vtkTexture.h>
m = vtkMatrix4x4::New();
mySurfaceActor = SVTK_DeviceActor::New();
- mySurfaceActor->SetRepresentation(SVTK::Representation::Surface);
+ mySurfaceActor->SetRepresentation(VTKViewer::Representation::Surface);
mySurfaceActor->SetUserMatrix(m);
+ mySurfaceActor->SetCoincident3DAllowed(true);
myEdgeActor = SVTK_DeviceActor::New();
- myEdgeActor->SetRepresentation(SVTK::Representation::Wireframe);
+ myEdgeActor->SetRepresentation(VTKViewer::Representation::Wireframe);
myEdgeActor->SetUserMatrix(m);
+ myEdgeActor->SetCoincident3DAllowed(true);
myNodeActor = SVTK_DeviceActor::New();
- myNodeActor->SetRepresentation(SVTK::Representation::Points);
+ myNodeActor->SetRepresentation(VTKViewer::Representation::Points);
myNodeActor->SetUserMatrix(m);
m->Delete();
- SetRepresentation(SVTK::Representation::Surface);
+ SetRepresentation(VTKViewer::Representation::Surface);
+
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+ //Quadratic 2D elements representation
+ if(aResourceMgr) {
+ //----------------------------------------------------------------------------
+ int aQuadraticAngle = aResourceMgr->integerValue( "VISU", "max_angle", 2);
+ mySurfaceActor->SetQuadraticArcAngle(aQuadraticAngle);
+ myEdgeActor->SetQuadraticArcAngle(aQuadraticAngle);
+
+ int anElem0DSize = aResourceMgr->integerValue( "VISU", "elem0d_size", 5);
+ GetSurfaceProperty()->SetPointSize(anElem0DSize);
+ }
}
VISU_MeshAct
void
VISU_MeshAct
::SetFeatureEdgesFlags(bool theIsFeatureEdges,
- bool theIsBoundaryEdges,
- bool theIsManifoldEdges,
- bool theIsNonManifoldEdges)
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges)
{
Superclass::SetFeatureEdgesFlags(theIsFeatureEdges,
- theIsBoundaryEdges,
- theIsManifoldEdges,
- theIsNonManifoldEdges);
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
mySurfaceActor->SetFeatureEdgesFlags(theIsFeatureEdges,
- theIsBoundaryEdges,
- theIsManifoldEdges,
- theIsNonManifoldEdges);
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
}
void
{
Superclass::SetRepresentation(theMode);
- if(theMode == SVTK::Representation::Insideframe)
- myEdgeActor->SetRepresentation(SVTK::Representation::Insideframe);
+ if(theMode == VTKViewer::Representation::Insideframe)
+ myEdgeActor->SetRepresentation(VTKViewer::Representation::Insideframe);
else
- myEdgeActor->SetRepresentation(SVTK::Representation::Wireframe);
+ myEdgeActor->SetRepresentation(VTKViewer::Representation::Wireframe);
}
//----------------------------------------------------------------------------
GetMatrix(myEdgeActor->GetUserMatrix());
GetMatrix(mySurfaceActor->GetUserMatrix());
- using namespace SVTK::Representation;
+ using namespace VTKViewer::Representation;
switch(GetRepresentation()){
case Points :
myNodeActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
myEdgeActor->RenderOpaqueGeometry(ren);
break;
case Surface :
+ case FeatureEdges :
mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
mySurfaceActor->RenderOpaqueGeometry(ren);
break;
myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
myEdgeActor->RenderOpaqueGeometry(ren);
break;
- case FeatureEdges :
- mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
- mySurfaceActor->RenderOpaqueGeometry(ren);
- break;
}
return 1;
}
int
VISU_MeshAct
+#if (VTK_XVERSION < 0x050100)
::RenderTranslucentGeometry(vtkViewport *ren)
+#else
+::RenderTranslucentPolygonalGeometry(vtkViewport *ren)
+#endif
{
GetMatrix(myNodeActor->GetUserMatrix());
GetMatrix(myEdgeActor->GetUserMatrix());
GetMatrix(mySurfaceActor->GetUserMatrix());
- using namespace SVTK::Representation;
+ using namespace VTKViewer::Representation;
switch(GetRepresentation()){
case Points :
myNodeActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+#if (VTK_XVERSION < 0x050100)
myNodeActor->RenderTranslucentGeometry(ren);
+#else
+ myNodeActor->RenderTranslucentPolygonalGeometry(ren);
+#endif
break;
case Wireframe :
case Insideframe :
myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+#if (VTK_XVERSION < 0x050100)
myEdgeActor->RenderTranslucentGeometry(ren);
+#else
+ myEdgeActor->RenderTranslucentPolygonalGeometry(ren);
+#endif
break;
case Surface :
+ case FeatureEdges :
mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+#if (VTK_XVERSION < 0x050100)
mySurfaceActor->RenderTranslucentGeometry(ren);
+#else
+ mySurfaceActor->RenderTranslucentPolygonalGeometry(ren);
+#endif
break;
case Surfaceframe :
mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+#if (VTK_XVERSION < 0x050100)
mySurfaceActor->RenderTranslucentGeometry(ren);
+#else
+ mySurfaceActor->RenderTranslucentPolygonalGeometry(ren);
+#endif
myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
+#if (VTK_XVERSION < 0x050100)
myEdgeActor->RenderTranslucentGeometry(ren);
- break;
- case FeatureEdges :
- mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
- mySurfaceActor->RenderTranslucentGeometry(ren);
+#else
+ myEdgeActor->RenderTranslucentPolygonalGeometry(ren);
+#endif
break;
}
return 1;
}
+
+#if (VTK_XVERSION >= 0x050100)
+int
+VISU_MeshAct
+::HasTranslucentPolygonalGeometry()
+{
+ int result = 0;
+
+ using namespace VTKViewer::Representation;
+ switch ( GetRepresentation() ) {
+ case Points:
+ result |= myNodeActor->HasTranslucentPolygonalGeometry();
+ break;
+ case Wireframe:
+ case Insideframe:
+ result |= myEdgeActor->HasTranslucentPolygonalGeometry();
+ break;
+ case Surface:
+ case FeatureEdges:
+ result |= mySurfaceActor->HasTranslucentPolygonalGeometry();
+ break;
+ case Surfaceframe:
+ result |= mySurfaceActor->HasTranslucentPolygonalGeometry();
+ result |= myEdgeActor->HasTranslucentPolygonalGeometry();
+ break;
+ default:
+ break;
+ }
+
+ return result;
+}
+#endif
+
+VISU_Actor::EQuadratic2DRepresentation
+VISU_MeshAct::GetQuadratic2DRepresentation() const
+{
+ bool mode = (mySurfaceActor->GetQuadraticArcMode() && myEdgeActor->GetQuadraticArcMode());
+ if(mode){
+ return VISU_Actor::eArcs;
+ }
+ else
+ return VISU_Actor::eLines;
+}
+
+void VISU_MeshAct::SetQuadratic2DRepresentation( EQuadratic2DRepresentation theMode )
+{
+ Superclass::SetQuadratic2DRepresentation( theMode );
+ switch(theMode) {
+ case VISU_Actor::eArcs:
+ mySurfaceActor->SetQuadraticArcMode(true);
+ myEdgeActor->SetQuadraticArcMode(true);
+ break;
+ case VISU_Actor::eLines:
+ mySurfaceActor->SetQuadraticArcMode(false);
+ myEdgeActor->SetQuadraticArcMode(false);
+ break;
+ default:
+ break;
+ }
+}
+
+void VISU_MeshAct::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
+{
+ Superclass::SetMarkerStd( theMarkerType, theMarkerScale );
+ myNodeActor->SetMarkerStd( theMarkerType, theMarkerScale );
+}
+
+void VISU_MeshAct::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture )
+{
+ Superclass::SetMarkerTexture( theMarkerId, theMarkerTexture );
+ myNodeActor->SetMarkerTexture( theMarkerId, theMarkerTexture );
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_MeshAct.h
// Author : Laurent CORNABE with the help of Nicolas REJNERI
virtual
void
SetFeatureEdgesFlags(bool theIsFeatureEdges,
- bool theIsBoundaryEdges,
- bool theIsManifoldEdges,
- bool theIsNonManifoldEdges);
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges);
virtual
void
virtual
int
+#if (VTK_XVERSION < 0x050100)
RenderTranslucentGeometry(vtkViewport *ren);
+#else
+ RenderTranslucentPolygonalGeometry(vtkViewport *ren);
+
+ virtual
+ int
+ HasTranslucentPolygonalGeometry();
+#endif
+
+ virtual
+ EQuadratic2DRepresentation GetQuadratic2DRepresentation() const;
+
+ virtual void
+ SetQuadratic2DRepresentation( EQuadratic2DRepresentation theMode );
+
+ virtual
+ void
+ SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
+
+ virtual
+ void
+ SetMarkerTexture( int, VTK::MarkerTexture );
protected:
VISU_MeshAct();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifdef WIN32
-# ifdef VISU_OBJECT_EXPORTS
+# if defined VISU_OBJECT_EXPORTS || defined VisuObject_EXPORTS
# define VISU_OBJECT_EXPORT __declspec(dllexport)
# else
# define VISU_OBJECT_EXPORT __declspec(dllimport)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PickingSettings.cxx
// Author : Oleg UVAROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PickingSettings.cxx
// Author : Oleg UVAROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File :
// Author :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PointMap3dActor.h
// Author : Dmitry MATVEICHEV with help of Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_MeshAct.hxx
// Author : Laurent CORNABE with the help of Nicolas REJNERI
#include "VISU_DeformedShapePL.hxx"
#include "VISU_PipeLineUtils.hxx"
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
#include <SALOME_ExtractGeometry.h>
#include <SALOME_ExtractPolyDataGeometry.h>
if(theInteractor)
theInteractor->AddObserver(vtkCommand::CharEvent,
- myEventCallbackCommand,
- 0.0);
+ myEventCallbackCommand,
+ 0.0);
myInteractor = theInteractor;
}
//----------------------------------------------------------------------------
void
DoMapperShallowCopy( vtkMapper* theMapper,
- bool theIsCopyInput )
+ bool theIsCopyInput )
{
Superclass::DoMapperShallowCopy( theMapper, theIsCopyInput );
SetPointSpriteMapper( aMapper );
+ myGeomFilter->SetAppendCoincident3D(true);
+
aMapper->Delete();
myEventCallbackCommand->SetClientData( this );
static
void
ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData)
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData)
{
if ( VISU_PointsDeviceActor* self = reinterpret_cast<VISU_PointsDeviceActor*>( theClientData ) )
self->OnInteractorEvent( theEvent );
switch( myInteractor->GetKeyCode() ) {
case 'M' :
case 'm' : {
- if ( !GetVisibility() )
- return;
+ if ( !GetVisibility() )
+ return;
- static vtkFloatingPointType anIncrement = 2;
- vtkFloatingPointType aMagnification = GetPointSpriteMapper()->GetPointSpriteMagnification();
- vtkFloatingPointType coefficient = myInteractor->GetShiftKey() ? anIncrement : 1 / anIncrement;
+ static vtkFloatingPointType anIncrement = 2;
+ vtkFloatingPointType aMagnification = GetPointSpriteMapper()->GetPointSpriteMagnification();
+ vtkFloatingPointType coefficient = myInteractor->GetShiftKey() ? anIncrement : 1 / anIncrement;
- GetPointSpriteMapper()->SetPointSpriteMagnification( aMagnification * coefficient );
+ GetPointSpriteMapper()->SetPointSpriteMagnification( aMagnification * coefficient );
- myInteractor->CreateTimer(VTKI_TIMER_UPDATE);
- break;
+ myInteractor->CreateTimer(VTKI_TIMER_UPDATE);
+ break;
}
default:
- return;
+ return;
}
break;
}
vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
mySurfaceActor= SVTK_DeviceActor::New();
- mySurfaceActor->SetRepresentation(SVTK::Representation::Surface);
+ mySurfaceActor->SetRepresentation(VTKViewer::Representation::Surface);
mySurfaceActor->SetProperty(aProperty);
mySurfaceActor->SetUserMatrix(aMatrix);
+ mySurfaceActor->SetCoincident3DAllowed(true);
myEdgeActor = SVTK_DeviceActor::New();
- myEdgeActor->SetRepresentation(SVTK::Representation::Wireframe);
+ myEdgeActor->SetRepresentation(VTKViewer::Representation::Wireframe);
myEdgeActor->SetUserMatrix(aMatrix);
myEdgeActor->GetProperty()->SetColor(255.,255.,255.);
- myPointsActor = VISU_PointsDeviceActor::New();
+ myEdgeActor->SetCoincident3DAllowed(true);
+
+ myPointsActor = SVTK_DeviceActor::New();
+ myPointsActor->SetRepresentation(VTKViewer::Representation::Points);
myPointsActor->SetProperty(aProperty);
myPointsActor->SetUserMatrix(aMatrix);
+ myPointSpriteActor = VISU_PointsDeviceActor::New();
+ myPointSpriteActor->SetProperty(aProperty);
+ myPointSpriteActor->SetUserMatrix(aMatrix);
+
aMatrix->Delete();
+
+ myIsPointSpriteMode = false;
+
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+ //Quadratic 2D elements representation
+ if(aResourceMgr) {
+ //----------------------------------------------------------------------------
+ int aQuadraticAngle = aResourceMgr->integerValue( "VISU", "max_angle", 2);
+ mySurfaceActor->SetQuadraticArcAngle(aQuadraticAngle);
+ myEdgeActor->SetQuadraticArcAngle(aQuadraticAngle);
+
+ int anElem0DSize = aResourceMgr->integerValue( "VISU", "elem0d_size", 5);
+ mySurfaceActor->GetProperty()->SetPointSize(anElem0DSize);
+ }
}
//----------------------------------------------------------------------------
myScalarBar->Delete();
myPointsActor->Delete();
+ myPointSpriteActor->Delete();
mySurfaceActor->Delete();
myEdgeActor->Delete();
myEdgeActor->GetMapper()->ScalarVisibilityOff();
- myPointsActor->DoMapperShallowCopy( thePipeLine->GetMapper(), false );
+ myPointSpriteActor->DoMapperShallowCopy( thePipeLine->GetMapper(), false );
+ VISU::CopyMapper( myPointsActor->GetMapper(), thePipeLine->GetMapper(), false );
VISU::CopyMapper( mySurfaceActor->GetMapper(), thePipeLine->GetMapper(), false );
}
// myEdgeActor->SetInput( theDataSet );
if (theDataSet->IsA("vtkPolyData")) {
+ myPointSpriteActor->SetInput( myPolyDataExtractor->GetOutput() );
myPointsActor->SetInput( myPolyDataExtractor->GetOutput() );
mySurfaceActor->SetInput( myPolyDataExtractor->GetOutput() );
myEdgeActor->SetInput( myPolyDataExtractor->GetOutput() );
} else {
+ myPointSpriteActor->SetInput( myExtractor->GetOutput() );
myPointsActor->SetInput( myExtractor->GetOutput() );
mySurfaceActor->SetInput( myExtractor->GetOutput() );
myEdgeActor->SetInput( myExtractor->GetOutput() );
Superclass::SetTransform(theTransform);
myPointsActor->SetTransform(theTransform);
+ myPointSpriteActor->SetTransform(theTransform);
mySurfaceActor->SetTransform(theTransform);
myEdgeActor->SetTransform(theTransform);
}
+//----------------------------------------------------------------------------
+vtkProperty*
+VISU_ScalarMapAct
+::GetEdgeProperty()
+{
+ return myEdgeActor->GetProperty();
+}
+
//----------------------------------------------------------------------------
void
VISU_ScalarMapAct
Superclass::SetShrinkable(theIsShrinkable);
mySurfaceActor->SetShrinkable(theIsShrinkable);
+ myEdgeActor->SetShrinkable(theIsShrinkable);
}
void
Superclass::SetShrinkFactor(theValue);
mySurfaceActor->SetShrinkFactor(theValue);
+ myEdgeActor->SetShrinkFactor(theValue);
}
//----------------------------------------------------------------------------
Superclass::SetShrink();
mySurfaceActor->SetShrink();
+ myEdgeActor->SetShrink();
}
void
Superclass::UnShrink();
mySurfaceActor->UnShrink();
+ myEdgeActor->UnShrink();
}
//----------------------------------------------------------------------------
void
VISU_ScalarMapAct
::SetFeatureEdgesFlags(bool theIsFeatureEdges,
- bool theIsBoundaryEdges,
- bool theIsManifoldEdges,
- bool theIsNonManifoldEdges)
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges)
{
Superclass::SetFeatureEdgesFlags(theIsFeatureEdges,
- theIsBoundaryEdges,
- theIsManifoldEdges,
- theIsNonManifoldEdges);
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
mySurfaceActor->SetFeatureEdgesFlags(theIsFeatureEdges,
- theIsBoundaryEdges,
- theIsManifoldEdges,
- theIsNonManifoldEdges);
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
}
void
::SetOpacity(vtkFloatingPointType theValue)
{
mySurfaceActor->GetProperty()->SetOpacity(theValue);
+
+ vtkFloatingPointType aPointSpriteOpacity = theValue > 0.0 ? 1.0 : 0.0;
+ myPointSpriteActor->GetPointSpriteMapper()->SetPointSpriteOpacity(aPointSpriteOpacity);
}
vtkFloatingPointType
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
Superclass::DeepCopy(theActor);
SetBarVisibility(anActor->GetBarVisibility());
- myPointsActor->DeepCopy( anActor->myPointsActor );
+ myPointSpriteActor->DeepCopy( anActor->myPointSpriteActor );
SetShading(anActor->IsShading());
}
}
{
Superclass::AddToRender(theRenderer);
- myPointsActor->SetInteractor( myInteractor );
+ myPointSpriteActor->SetInteractor( myInteractor );
if(myScalarBar)
theRenderer->AddActor2D(myScalarBar);
theRenderer->RemoveActor(myScalarBar);
if ( vtkWindow* aWindow = theRenderer->GetRenderWindow() ) {
+ myPointSpriteActor->ReleaseGraphicsResources( aWindow );
myPointsActor->ReleaseGraphicsResources( aWindow );
mySurfaceActor->ReleaseGraphicsResources( aWindow );
myEdgeActor->ReleaseGraphicsResources( aWindow );
{
Superclass::SetVisibility( theMode );
+ myPointSpriteActor->SetVisibility( theMode );
myPointsActor->SetVisibility( theMode );
if(myScalarBar)
{
myBarVisibility = theMode;
if(myScalarBar)
- myScalarBar->SetVisibility(myBarVisibility);
+ myScalarBar->SetVisibility(myBarVisibility && GetVisibility());
}
Superclass::SetRepresentation(theMode);
- if(theMode == SVTK::Representation::Surfaceframe)
- mySurfaceActor->SetRepresentation(SVTK::Representation::Surface);
+ if(theMode == VTKViewer::Representation::Surfaceframe)
+ mySurfaceActor->SetRepresentation(VTKViewer::Representation::Surface);
else
mySurfaceActor->SetRepresentation(theMode);
+ myPointSpriteActor->SetProperty( mySurfaceActor->GetProperty() );
myPointsActor->SetProperty( mySurfaceActor->GetProperty() );
SetShading(anIsShanding);
GetMatrix(myEdgeActor->GetUserMatrix());
GetMatrix(mySurfaceActor->GetUserMatrix());
GetMatrix(myPointsActor->GetUserMatrix());
+ GetMatrix(myPointSpriteActor->GetUserMatrix());
- using namespace SVTK::Representation;
+ using namespace VTKViewer::Representation;
switch ( GetRepresentation() ) {
case Surfaceframe:
break;
case Points:
- myPointsActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
- myPointsActor->RenderOpaqueGeometry(ren);
+ if( myIsPointSpriteMode ) {
+ myPointSpriteActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+ myPointSpriteActor->RenderOpaqueGeometry(ren);
+ } else {
+ myPointsActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+ myPointsActor->RenderOpaqueGeometry(ren);
+ }
break;
default:
int
VISU_ScalarMapAct
+#if (VTK_XVERSION < 0x050100)
::RenderTranslucentGeometry(vtkViewport *ren)
+#else
+::RenderTranslucentPolygonalGeometry(vtkViewport *ren)
+#endif
{
GetMatrix(myEdgeActor->GetUserMatrix());
GetMatrix(mySurfaceActor->GetUserMatrix());
- using namespace SVTK::Representation;
+ using namespace VTKViewer::Representation;
switch ( GetRepresentation() ) {
case Surfaceframe:
mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+#if (VTK_XVERSION < 0x050100)
mySurfaceActor->RenderTranslucentGeometry(ren);
+#else
+ mySurfaceActor->RenderTranslucentPolygonalGeometry(ren);
+#endif
myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
+#if (VTK_XVERSION < 0x050100)
myEdgeActor->RenderTranslucentGeometry(ren);
+#else
+ myEdgeActor->RenderTranslucentPolygonalGeometry(ren);
+#endif
break;
case Points:
- myPointsActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
- myPointsActor->RenderTranslucentGeometry(ren);
+ if( myIsPointSpriteMode ) {
+ myPointSpriteActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+#if (VTK_XVERSION < 0x050100)
+ myPointSpriteActor->RenderTranslucentGeometry(ren);
+#else
+ myPointSpriteActor->RenderTranslucentPolygonalGeometry(ren);
+#endif
+ } else {
+ myPointsActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+#if (VTK_XVERSION < 0x050100)
+ myPointsActor->RenderTranslucentGeometry(ren);
+#else
+ myPointsActor->RenderTranslucentPolygonalGeometry(ren);
+#endif
+ }
break;
default:
mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+#if (VTK_XVERSION < 0x050100)
mySurfaceActor->RenderTranslucentGeometry(ren);
+#else
+ mySurfaceActor->RenderTranslucentPolygonalGeometry(ren);
+#endif
}
return 1;
}
+//----------------------------------------------------------------------------
+#if (VTK_XVERSION >= 0x050100)
+int
+VISU_ScalarMapAct
+::HasTranslucentPolygonalGeometry()
+{
+ int result = 0;
+
+ using namespace VTKViewer::Representation;
+ switch ( GetRepresentation() ) {
+ case Surfaceframe:
+ result |= mySurfaceActor->HasTranslucentPolygonalGeometry();
+ result |= myEdgeActor->HasTranslucentPolygonalGeometry();
+ break;
+ case Points:
+ if( myIsPointSpriteMode )
+ result |= myPointSpriteActor->HasTranslucentPolygonalGeometry();
+ else
+ result |= myPointsActor->HasTranslucentPolygonalGeometry();
+ break;
+ default:
+ result |= mySurfaceActor->HasTranslucentPolygonalGeometry();
+ }
+
+ return result;
+}
+#endif
+
//----------------------------------------------------------------------------
unsigned long int
VISU_ScalarMapAct
{
unsigned long int aSize = Superclass::GetMemorySize();
- aSize += myPointsActor->GetMemorySize();
+ aSize += myPointSpriteActor->GetMemorySize();
return aSize;
}
//----------------------------------------------------------------------------
+
+VISU_Actor::EQuadratic2DRepresentation
+VISU_ScalarMapAct
+::GetQuadratic2DRepresentation() const
+{
+ bool mode = (mySurfaceActor->GetQuadraticArcMode() && myEdgeActor->GetQuadraticArcMode());
+ if(mode){
+ return VISU_Actor::eArcs;
+ }
+ else
+ return VISU_Actor::eLines;
+}
+
+void VISU_ScalarMapAct::SetQuadratic2DRepresentation( VISU_Actor::EQuadratic2DRepresentation theMode )
+{
+ Superclass::SetQuadratic2DRepresentation( theMode );
+ switch(theMode) {
+ case VISU_Actor::eArcs:
+ mySurfaceActor->SetQuadraticArcMode(true);
+ myEdgeActor->SetQuadraticArcMode(true);
+ break;
+ case VISU_Actor::eLines:
+ mySurfaceActor->SetQuadraticArcMode(false);
+ myEdgeActor->SetQuadraticArcMode(false);
+ break;
+ default:
+ break;
+ }
+}
+
+void VISU_ScalarMapAct::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
+{
+ Superclass::SetMarkerStd( theMarkerType, theMarkerScale );
+ myPointsActor->SetMarkerStd( theMarkerType, theMarkerScale );
+
+ myIsPointSpriteMode = theMarkerType == VTK::MT_POINT_SPRITE;
+}
+
+void VISU_ScalarMapAct::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture )
+{
+ Superclass::SetMarkerTexture( theMarkerId, theMarkerTexture );
+ myPointsActor->SetMarkerTexture( theMarkerId, theMarkerTexture );
+
+ myIsPointSpriteMode = false;
+}
+
+/**
+ * Set size of the 0D elements.
+ */
+void VISU_ScalarMapAct::Set0DElemSize(vtkFloatingPointType theValue) {
+ mySurfaceActor->GetProperty()->SetPointSize(theValue);
+}
+
+/**
+ * Get size of the 0D elements.
+ */
+vtkFloatingPointType VISU_ScalarMapAct::Get0DElemSize() {
+ return mySurfaceActor->GetProperty()->GetPointSize();
+}
+
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ScalarMapAct.h
// Author : Laurent CORNABE with help of Nicolas REJNERI
#include "VISU_OBJECT.h"
#include "VISU_DataSetActor.h"
+#include "SVTK_DeviceActor.h"
+
+namespace VTK
+{
+ const MarkerType MT_POINT_SPRITE = MT_USER + 1;
+}
class VISU_ScalarBarActor;
class VISU_PointsDeviceActor;
-
//----------------------------------------------------------------------------
class VISU_OBJECT_EXPORT VISU_ScalarMapAct : public VISU_DataSetActor
{
void
SetTransform(VTKViewer_Transform* theTransform);
+ virtual
+ vtkProperty*
+ GetEdgeProperty();
+
virtual
void
SetShrinkable(bool theIsShrinkable);
virtual
void
UnShrink();
+
+ virtual
+ EQuadratic2DRepresentation GetQuadratic2DRepresentation() const;
+
+ virtual void
+ SetQuadratic2DRepresentation( EQuadratic2DRepresentation theMode );
+
virtual
void
virtual
void
SetFeatureEdgesFlags(bool theIsFeatureEdges,
- bool theIsBoundaryEdges,
- bool theIsManifoldEdges,
- bool theIsNonManifoldEdges);
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges);
virtual
void
virtual
int
+#if (VTK_XVERSION < 0x050100)
RenderTranslucentGeometry(vtkViewport *ren);
+#else
+ RenderTranslucentPolygonalGeometry(vtkViewport *ren);
+
+ virtual
+ int
+ HasTranslucentPolygonalGeometry();
+#endif
virtual
void
int
GetBarVisibility();
+ virtual
+ vtkFloatingPointType
+ Get0DElemSize();
+
virtual
VISU_ScalarBarActor*
GetScalarBar();
virtual
unsigned long int
GetMemorySize();
-
+
+ virtual
+ void
+ SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
+
+ virtual
+ void
+ SetMarkerTexture( int, VTK::MarkerTexture );
+
+ virtual
+ void
+ Set0DElemSize(vtkFloatingPointType theValue);
+
+
protected:
VISU_ScalarMapAct();
bool myBarVisibility;
VISU_ScalarBarActor* myScalarBar;
- VISU_PointsDeviceActor* myPointsActor;
+ VISU_PointsDeviceActor* myPointSpriteActor;
+ SVTK_DeviceActor* myPointsActor;
SVTK_DeviceActor* mySurfaceActor;
SVTK_DeviceActor* myEdgeActor;
+
+ bool myIsPointSpriteMode;
};
//----------------------------------------------------------------------------
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// VISU OBJECT : interactive object for VISU entities implementation
+// File : VISU_SelectVisiblePoints.h
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#include "VISU_SelectVisiblePoints.h"
+
+#include "vtkCamera.h"
+#include "vtkCellArray.h"
+#include "vtkDataSet.h"
+#include "vtkMatrix4x4.h"
+#include "vtkInformation.h"
+#include "vtkInformationVector.h"
+#include "vtkObjectFactory.h"
+#include "vtkPointData.h"
+#include "vtkPoints.h"
+#include "vtkPolyData.h"
+#include "vtkRenderWindow.h"
+#include "vtkRenderer.h"
+
+vtkStandardNewMacro(VISU_SelectVisiblePoints);
+
+// Instantiate object with no renderer; window selection turned off;
+// tolerance set to 0.01; and select invisible off.
+VISU_SelectVisiblePoints::VISU_SelectVisiblePoints()
+{
+ this->Offset[0] = this->Offset[1] = this->Offset[2] = 0.0;
+}
+
+VISU_SelectVisiblePoints::~VISU_SelectVisiblePoints()
+{
+}
+
+int VISU_SelectVisiblePoints::RequestData(
+ vtkInformation *vtkNotUsed(request),
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
+{
+ // get the info objects
+ vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
+ vtkInformation *outInfo = outputVector->GetInformationObject(0);
+
+ // get the input and ouptut
+ vtkDataSet *input = vtkDataSet::SafeDownCast(
+ inInfo->Get(vtkDataObject::DATA_OBJECT()));
+ vtkPolyData *output = vtkPolyData::SafeDownCast(
+ outInfo->Get(vtkDataObject::DATA_OBJECT()));
+
+ vtkIdType ptId, cellId;
+ int visible;
+ vtkPoints *outPts;
+ vtkCellArray *outputVertices;
+ vtkPointData *inPD=input->GetPointData();
+ vtkPointData *outPD=output->GetPointData();
+ vtkIdType numPts=input->GetNumberOfPoints();
+ double x[4], xTrans[4];
+ double dx[3], z;
+ int selection[4];
+
+ if ( this->Renderer == NULL )
+ {
+ vtkErrorMacro(<<"Renderer must be set");
+ return 0;
+ }
+
+ if ( numPts < 1 )
+ {
+ return 0;
+ }
+
+ outPts = vtkPoints::New();
+ outPts->Allocate(numPts/2+1);
+ outPD->CopyAllocate(inPD);
+
+ outputVertices = vtkCellArray::New();
+ output->SetVerts(outputVertices);
+ outputVertices->Delete();
+
+ int *size = this->Renderer->GetRenderWindow()->GetSize();
+
+ // specify a selection window to avoid querying
+ if ( this->SelectionWindow )
+ {
+ for (int i=0; i<4; i++)
+ {
+ selection[i] = this->Selection[i];
+ }
+ }
+ else
+ {
+ selection[0] = selection[2] = 0;
+ selection[1] = size[0] - 1;
+ selection[3] = size[1] - 1;
+ }
+
+ // Grab the composite perspective transform. This matrix is used to convert
+ // each point to view coordinates. vtkRenderer provides a WorldToView()
+ // method but it computes the composite perspective transform each time
+ // WorldToView() is called. This is expensive, so we get the matrix once
+ // and handle the transformation ourselves.
+ vtkMatrix4x4 *matrix = vtkMatrix4x4::New();
+ double view[4];
+ matrix->DeepCopy(this->Renderer->GetActiveCamera()->
+ GetCompositeProjectionTransformMatrix(this->Renderer->GetTiledAspectRatio(),0,1));
+
+ // If we have more than a few query points, we grab the z-buffer for the
+ // selection region all at once and probe the resulting array. When we
+ // have just a few points, we perform individual z-buffer queries.
+ const int SimpleQueryLimit = 25;
+ float *zPtr = NULL;
+ if (numPts > SimpleQueryLimit)
+ {
+ zPtr = this->Renderer->GetRenderWindow()->
+ GetZbufferData(selection[0], selection[2], selection[1], selection[3]);
+ }
+
+ int abort=0;
+ vtkIdType progressInterval=numPts/20+1;
+ x[3] = 1.0;
+ for (cellId=(-1), ptId=0; ptId < numPts && !abort; ptId++)
+ {
+ // perform conversion
+ input->GetPoint(ptId,x);
+
+ // take into account translation offset (this is the only difference
+ // between this class and native vtkSelectVisiblePoints class)
+ xTrans[0] = x[0] + this->Offset[0];
+ xTrans[1] = x[1] + this->Offset[1];
+ xTrans[2] = x[2] + this->Offset[2];
+ xTrans[3] = 1.0;
+
+ matrix->MultiplyPoint(xTrans, view);
+ if (view[3] == 0.0)
+ {
+ continue;
+ }
+ this->Renderer->SetViewPoint(view[0]/view[3], view[1]/view[3],
+ view[2]/view[3]);
+ this->Renderer->ViewToDisplay();
+ this->Renderer->GetDisplayPoint(dx);
+ visible = 0;
+
+ if ( ! (ptId % progressInterval) )
+ {
+ this->UpdateProgress((double)ptId/numPts);
+ abort = this->GetAbortExecute();
+ }
+
+ // check whether visible and in selection window
+ if ( dx[0] >= selection[0] && dx[0] <= selection[1] &&
+ dx[1] >= selection[2] && dx[1] <= selection[3] )
+ {
+ if (numPts > SimpleQueryLimit)
+ {
+ // Access the value from the captured zbuffer. Note, we only
+ // captured a portion of the zbuffer, so we need to offset dx by
+ // the selection window.
+ z = zPtr[(int)dx[0] - selection[0]
+ + ((int)dx[1] - selection[2])
+ *(selection[1] - selection[0] + 1)];
+ }
+ else
+ {
+ z = this->Renderer->GetZ(static_cast<int>(dx[0]),
+ static_cast<int>(dx[1]));
+ }
+ if( dx[2] < (z + this->Tolerance) )
+ {
+ visible = 1;
+ }
+ }
+
+ if ( (visible && !this->SelectInvisible) ||
+ (!visible && this->SelectInvisible) )
+ {
+ cellId = outPts->InsertNextPoint(x);
+ output->InsertNextCell(VTK_VERTEX, 1, &cellId);
+ outPD->CopyData(inPD,ptId,cellId);
+ }
+ }//for all points
+
+ output->SetPoints(outPts);
+ outPts->Delete();
+ output->Squeeze();
+
+ matrix->Delete();
+
+ if (zPtr)
+ {
+ delete [] zPtr;
+ }
+
+ vtkDebugMacro(<<"Selected " << cellId + 1 << " out of "
+ << numPts << " original points");
+
+ return 1;
+}
+
+void VISU_SelectVisiblePoints::PrintSelf(ostream& os, vtkIndent indent)
+{
+ this->Superclass::PrintSelf(os,indent);
+
+ os << indent << "Offset: ("
+ << this->Offset[0] << ", "
+ << this->Offset[1] << ", "
+ << this->Offset[2] << ")\n";
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// VISU OBJECT : interactive object for VISU entities implementation
+// File : VISU_SelectVisiblePoints.h
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#ifndef VISU_SelectVisiblePoints_HeaderFile
+#define VISU_SelectVisiblePoints_HeaderFile
+
+#include "VISU_OBJECT.h"
+
+#include "vtkSelectVisiblePoints.h"
+
+class vtkRenderer;
+
+class VISU_OBJECT_EXPORT VISU_SelectVisiblePoints : public vtkSelectVisiblePoints
+{
+public:
+ vtkTypeMacro(VISU_SelectVisiblePoints,vtkSelectVisiblePoints);
+ void PrintSelf(ostream& os, vtkIndent indent);
+
+ // Description:
+ // Instantiate object with no renderer; window selection turned off;
+ // tolerance set to 0.01; and select invisible off.
+ static VISU_SelectVisiblePoints *New();
+
+ // Description:
+ // Set/Get a translation offset for input points.
+ vtkSetVector3Macro(Offset,double);
+ vtkGetVectorMacro(Offset,double,4);
+
+protected:
+ VISU_SelectVisiblePoints();
+ ~VISU_SelectVisiblePoints();
+
+ virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+
+ double Offset[3];
+
+private:
+ VISU_SelectVisiblePoints(const VISU_SelectVisiblePoints&); // Not implemented.
+ void operator=(const VISU_SelectVisiblePoints&); // Not implemented.
+};
+
+#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_VectorsAct.cxx
// Author : Laurent CORNABE with help of Nicolas REJNERI
// Module : VISU
-
+//
#include "VISU_VectorsAct.h"
#include "VISU_VectorsPL.hxx"
#include <SVTK_Actor.h>
return Superclass::GetValLabelsInput();
}
+
+//--------------------------------------------------------------------------------------
+vtkDataSet* VISU_VectorsAct::GetHighlightedDataSet() {
+ return myPassFilter[3]->GetOutput();
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_VectorsAct.h
// Author : Laurent CORNABE with help of Nicolas REJNERI
// Module : VISU
-
+//
#ifndef VISU_VectorsAct_HeaderFile
#define VISU_VectorsAct_HeaderFile
virtual
vtkDataSet*
GetValLabelsInput();
+
+ //----------------------------------------------------------------------------
+ //! Return pointer to the dataset, which used to calculation of the bounding box of the actor
+ //! Redefined from VTKViewer_Actor
+ virtual vtkDataSet* GetHighlightedDataSet();
+
protected:
VISU_VectorsAct();
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU OBJECT : interactive object for VISU entities implementation
# File : Makefile.in
# Module : VISU
VISU_MeshPL.hxx \
VISU_ScalarMapPL.hxx \
VISU_CutPlanesPL.hxx \
+ VISU_CutLinesBasePL.hxx \
VISU_CutLinesPL.hxx \
+ VISU_CutSegmentPL.hxx \
VISU_IsoSurfacesPL.hxx \
VISU_DeformedShapePL.hxx \
VISU_VectorsPL.hxx \
VISU_ElnoAssembleFilter.hxx \
VISU_DeformationPL.hxx \
VISU_OptionalDeformationPL.hxx \
- VISU_XYPlotActor.hxx
+ VISU_XYPlotActor.hxx \
+ VISU_CellDataToPointData.hxx
dist_libVisuPipeLine_la_SOURCES= \
VISU_MapperHolder.cxx \
VISU_MeshPL.cxx \
VISU_ScalarMapPL.cxx \
VISU_CutPlanesPL.cxx \
+ VISU_CutLinesBasePL.cxx \
VISU_CutLinesPL.cxx \
+ VISU_CutSegmentPL.cxx \
VISU_IsoSurfacesPL.cxx \
VISU_DeformedShapePL.cxx \
VISU_VectorsPL.cxx \
VISU_ElnoAssembleFilter.cxx \
VISU_DeformationPL.cxx \
VISU_OptionalDeformationPL.cxx\
- VISU_XYPlotActor.cxx
+ VISU_XYPlotActor.cxx \
+ VISU_CellDataToPointData.cxx
libVisuPipeLine_la_CPPFLAGS= \
$(VTK_INCLUDES) \
-I$(srcdir)/../CONVERTOR
libVisuPipeLine_la_LDFLAGS= \
+ $(VTK_LIBS) -lVTKViewer \
$(KERNEL_LDFLAGS) -lSALOMELocalTrace \
- $(GUI_LDFLAGS) \
+ $(GUI_LDFLAGS) -lqtx -lsuit -lvtkTools \
$(MED_LDFLAGS) \
../CONVERTOR/libVisuConvertor.la \
- $(VTK_LIBS) -lVTKViewer \
- $(MED2_LIBS) \
- $(QT_LIBS)
+ $(MED3_LIBS) \
+ $(QT_LIBS) \
+ $(OGL_LIBS)
# Executables targets
dist_VISUPipeLine_SOURCES= VISUPipeLine.cxx
dist_VISU_img2vti_SOURCES= VISU_img2vti.cxx
-AM_CPPFLAGS=$(libVisuPipeLine_la_CPPFLAGS)
+AM_CPPFLAGS+=$(libVisuPipeLine_la_CPPFLAGS)
LDADD=$(libVisuPipeLine_la_LDFLAGS) libVisuPipeLine.la \
- -lOpUtil -lMEDWrapper -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase -lmed_V2_1 -lsuit -lqtx -lSALOMEBasics -lvtkWidgets
+ -lOpUtil -lMEDWrapper -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase -lsuit -lqtx -lSALOMEBasics -lvtkWidgets
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOME_ExtractGeometry.h"
#include <vtkCell.h>
int
SALOME_ExtractGeometry
::RequestData(vtkInformation *request,
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector)
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
int
SALOME_ExtractGeometry
::RequestData2(vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector)
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
{
newId = newPts->InsertNextPoint(x);
pointMap[ptId] = newId;
- if(myStoreMapping)
- myNodeVTK2ObjIds.push_back(ptId);
+ if(myStoreMapping)
+ myNodeVTK2ObjIds.push_back(ptId);
outputPD->CopyData(pd,ptId,newId);
}
}
{
newId = newPts->InsertNextPoint(x);
pointMap[ptId] = newId;
- if(myStoreMapping)
- myNodeVTK2ObjIds.push_back(ptId);
+ if(myStoreMapping)
+ myNodeVTK2ObjIds.push_back(ptId);
outputPD->CopyData(pd,ptId,newId);
}
}
x = input->GetPoint(ptId);
newId = newPts->InsertNextPoint(x);
pointMap[ptId] = newId;
- if(myStoreMapping)
- myNodeVTK2ObjIds.push_back(ptId);
+ if(myStoreMapping)
+ myNodeVTK2ObjIds.push_back(ptId);
outputPD->CopyData(pd,ptId,newId);
}
newCellPts->InsertId(i,pointMap[ptId]);
{
newCellId = output->InsertNextCell(cell->GetCellType(),newCellPts);
if(myStoreMapping)
- myElemVTK2ObjIds.push_back(cellId);
+ myElemVTK2ObjIds.push_back(cellId);
outputCD->CopyData(cd,cellId,newCellId);
}
}//for all cells
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOME_ExtractGeometry_H
#define SALOME_ExtractGeometry_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOME_ExtractPolyDataGeometry.h"
#include <vtkCellArray.h>
int
SALOME_ExtractPolyDataGeometry
::RequestData(vtkInformation *request,
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector)
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
myElemVTK2ObjIds.clear();
myNodeVTK2ObjIds.clear();
int
SALOME_ExtractPolyDataGeometry
::RequestData2(vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector)
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
{
newId = newPts->InsertNextPoint(x);
pointMap[ptId] = newId;
- if(myStoreMapping)
- myNodeVTK2ObjIds.push_back(ptId);
+ if(myStoreMapping)
+ myNodeVTK2ObjIds.push_back(ptId);
outputPD->CopyData(pd,ptId,newId);
}
}
{
newId = newPts->InsertNextPoint(x);
pointMap[ptId] = newId;
- if(myStoreMapping)
- myNodeVTK2ObjIds.push_back(ptId);
+ if(myStoreMapping)
+ myNodeVTK2ObjIds.push_back(ptId);
outputPD->CopyData(pd,ptId,newId);
}
}
x = input->GetPoint(ptId);
newId = newPts->InsertNextPoint(x);
pointMap[ptId] = newId;
- if(myStoreMapping)
- myNodeVTK2ObjIds.push_back(ptId);
+ if(myStoreMapping)
+ myNodeVTK2ObjIds.push_back(ptId);
outputPD->CopyData(pd,ptId,newId);
}
newCellPts->InsertId(i,pointMap[ptId]);
{
newCellId = output->InsertNextCell(cell->GetCellType(),newCellPts);
if(myStoreMapping)
- myElemVTK2ObjIds.push_back(cellId);
+ myElemVTK2ObjIds.push_back(cellId);
outputCD->CopyData(cd,cellId,newCellId);
}
}//for all cells
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOME_ExtractPolyDataGeometry_H
#define SALOME_ExtractPolyDataGeometry_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.hxx
// Author: Alexey PETROV
// VTK includes
#include <vtkShrinkFilter.h>
#include <vtkPointLocator.h>
-#include <vtkCutter.h>
+#include <vtkEDFCutter.h>
#include <vtkPlane.h>
#include <vtkWarpVector.h>
#include <vtkScalarBarActor.h>
template<class TPipeLine>
VISU_ColoredPL*
CreateColoredPL(VISU_Convertor* theConvertor,
- const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber);
+ const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber);
//----------------------------------------------------------------------------
template<>
VISU_ColoredPL*
CreateColoredPL<VISU_GaussPointsPL>(VISU_Convertor* theConvertor,
- const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber)
+ const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber)
{
VISU_GaussPointsPL* aPresent = VISU_GaussPointsPL::New();
VISU::PGaussPtsIDMapper aGaussPtsIDMapper =
theConvertor->GetTimeStampOnGaussPts(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
aPresent->SetGaussPtsIDMapper(aGaussPtsIDMapper);
char aMainTexture[80];
template<class TPipeLine>
VISU_ColoredPL*
CreateColoredPL(VISU_Convertor* theConvertor,
- const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber)
+ const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber)
{
TPipeLine* aPresent = TPipeLine::New();
VISU::PUnstructuredGridIDMapper anUnstructuredGridIDMapper =
theConvertor->GetTimeStampOnMesh(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
aPresent->SetUnstructuredGridIDMapper(anUnstructuredGridIDMapper);
vtkFloatingPointType aRange[] = { 4, 5 };
//{
// VISU::PUnstructuredGridIDMapper anIDMapper =
// theConvertor->GetMeshOnGroup(theMeshName,
- // "groupe1");
+ // "groupe1");
// aPresent->AddGeometry(anIDMapper->GetOutput());
//}
//{
// VISU::PUnstructuredGridIDMapper anIDMapper =
// theConvertor->GetMeshOnGroup(theMeshName,
- // "TUBEH ");
+ // "TUBEH ");
// aPresent->AddGeometry(anIDMapper->GetOutput());
//}
//{
// VISU::PUnstructuredGridIDMapper anIDMapper =
// theConvertor->GetMeshOnGroup(theMeshName,
- // "STRI ");
+ // "STRI ");
// aPresent->AddGeometry(anIDMapper->GetOutput());
//}
aPresent->Update();
const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter;
if(isOnlyMesh){
- const VISU::TEntity& anEntity = VISU::CELL_ENTITY;
- aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
+ const VISU::TEntity& anEntity = VISU::CELL_ENTITY;
+ aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
- VISU::PNamedIDMapper anIDMapper =
- aConvertor->GetMeshOnEntity(aMeshName,anEntity);
+ VISU::PNamedIDMapper anIDMapper =
+ aConvertor->GetMeshOnEntity(aMeshName,anEntity);
- VISU_MeshPL* aPresent = VISU_MeshPL::New();
- aPresent->SetUnstructuredGridIDMapper(anIDMapper);
+ VISU_MeshPL* aPresent = VISU_MeshPL::New();
+ aPresent->SetUnstructuredGridIDMapper(anIDMapper);
- vtkActor* aActor = vtkActor::New();
- aActor->SetMapper(aPresent->GetMapper());
- aActor->GetProperty()->SetRepresentation(VTK_WIREFRAME);
- //aRenderer->ResetCameraClippingRange();
+ vtkActor* aActor = vtkActor::New();
+ aActor->SetMapper(aPresent->GetMapper());
+ aActor->GetProperty()->SetRepresentation(VTK_WIREFRAME);
+ //aRenderer->ResetCameraClippingRange();
- aRenderer->AddActor(aActor);
+ aRenderer->AddActor(aActor);
- aWindow->Render();
- anInteractor->Start();
- return 0;
+ aWindow->Render();
+ anInteractor->Start();
+ return 0;
}
//Import fields
aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++) {
- const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
- const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
- const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
- for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
- const VISU::PField aField = aFieldMapIter->second;
-// if(aField->myNbComp == 1)
-// continue;
- const std::string& aFieldName = aFieldMapIter->first;
- const VISU::TValField& aValField = aField->myValField;
- VISU::TValField::const_reverse_iterator aValFieldIter = aValField.rbegin();
- if(aValFieldIter == aValField.rend()) return 0;
- int aTimeStamp = aValFieldIter->first;
-
- vtkActor* anActor = vtkActor::New();
- VISU_ColoredPL* aPresent = NULL;
- if(anEntity == VISU::NODE_ENTITY){
- aPresent = CreateColoredPL<TPresent>(aConvertor,
- aMeshName,
- anEntity,
- aFieldName,
- aTimeStamp);
-
- anActor->SetMapper(aPresent->GetMapper());
- }else{
- continue;
- aPresent = CreateColoredPL<TPresent>(aConvertor,
- aMeshName,
- anEntity,
- aFieldName,
- aTimeStamp);
-
- VTKViewer_GeometryFilter* aGeometryFilter = VTKViewer_GeometryFilter::New();
- aGeometryFilter->SetInput(aPresent->GetOutput());
- aGeometryFilter->SetInside(true);
-
- vtkMaskPoints* aMaskPoints = vtkMaskPoints::New();
- aMaskPoints->SetInput(aGeometryFilter->GetOutput());
- aMaskPoints->SetGenerateVertices(true);
- aMaskPoints->SetOnRatio(1);
-
- VISU_OpenGLPointSpriteMapper* aMapper = VISU_OpenGLPointSpriteMapper::New();
- aMapper->SetAverageCellSize( VISU_DeformedShapePL::GetScaleFactor( aPresent->GetOutput() ) );
+ const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
+ const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
+ const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
+ for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
+ const VISU::PField aField = aFieldMapIter->second;
+// if(aField->myNbComp == 1)
+// continue;
+ const std::string& aFieldName = aFieldMapIter->first;
+ const VISU::TValField& aValField = aField->myValField;
+ VISU::TValField::const_reverse_iterator aValFieldIter = aValField.rbegin();
+ if(aValFieldIter == aValField.rend()) return 0;
+ int aTimeStamp = aValFieldIter->first;
+
+ vtkActor* anActor = vtkActor::New();
+ VISU_ColoredPL* aPresent = NULL;
+ if(anEntity == VISU::NODE_ENTITY){
+ aPresent = CreateColoredPL<TPresent>(aConvertor,
+ aMeshName,
+ anEntity,
+ aFieldName,
+ aTimeStamp);
+
+ anActor->SetMapper(aPresent->GetMapper());
+ }else{
+ continue;
+ aPresent = CreateColoredPL<TPresent>(aConvertor,
+ aMeshName,
+ anEntity,
+ aFieldName,
+ aTimeStamp);
+
+ VTKViewer_GeometryFilter* aGeometryFilter = VTKViewer_GeometryFilter::New();
+ aGeometryFilter->SetInput(aPresent->GetOutput());
+ aGeometryFilter->SetInside(true);
+
+ vtkMaskPoints* aMaskPoints = vtkMaskPoints::New();
+ aMaskPoints->SetInput(aGeometryFilter->GetOutput());
+ aMaskPoints->SetGenerateVertices(true);
+ aMaskPoints->SetOnRatio(1);
+
+ VISU_OpenGLPointSpriteMapper* aMapper = VISU_OpenGLPointSpriteMapper::New();
+ aMapper->SetAverageCellSize( VISU_DeformedShapePL::GetScaleFactor( aPresent->GetOutput() ) );
- char aMainTexture[80];
- strcpy( aMainTexture, getenv( "VISU_ROOT_DIR" ) );
- strcat( aMainTexture, "/share/salome/resources/visu/sprite_texture.vti" );
-
- char anAlphaTexture[80];
- strcpy( anAlphaTexture, getenv( "VISU_ROOT_DIR" ) );
- strcat( anAlphaTexture, "/share/salome/resources/visu/sprite_alpha.vti" );
-
- vtkSmartPointer<vtkImageData> aTextureValue =
- VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture );
- aMapper->SetImageData( aTextureValue.GetPointer() );
+ char aMainTexture[80];
+ strcpy( aMainTexture, getenv( "VISU_ROOT_DIR" ) );
+ strcat( aMainTexture, "/share/salome/resources/visu/sprite_texture.vti" );
+
+ char anAlphaTexture[80];
+ strcpy( anAlphaTexture, getenv( "VISU_ROOT_DIR" ) );
+ strcat( anAlphaTexture, "/share/salome/resources/visu/sprite_alpha.vti" );
+
+ vtkSmartPointer<vtkImageData> aTextureValue =
+ VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture );
+ aMapper->SetImageData( aTextureValue.GetPointer() );
- //vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New();
- aMapper->SetLookupTable(aPresent->GetMapperTable());
- aMapper->SetUseLookupTableScalarRange(true);
- aMapper->SetColorModeToMapScalars();
- aMapper->SetScalarVisibility(true);
+ //vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New();
+ aMapper->SetLookupTable(aPresent->GetMapperTable());
+ aMapper->SetUseLookupTableScalarRange(true);
+ aMapper->SetColorModeToMapScalars();
+ aMapper->SetScalarVisibility(true);
- aMapper->SetInput(aMaskPoints->GetOutput());
- aGeometryFilter->Delete();
+ aMapper->SetInput(aMaskPoints->GetOutput());
+ aGeometryFilter->Delete();
- anActor->SetMapper(aMapper);
- aMapper->Delete();
- }
+ anActor->SetMapper(aMapper);
+ aMapper->Delete();
+ }
lut->SetNumberOfTableValues(nbColors);
vtkDataArray* dataArr;
if(VISU::IsDataOnCells(aPresent->GetInput())) {
- dataArr = aPresent->GetInput()->GetCellData()->GetScalars();
+ dataArr = aPresent->GetInput()->GetCellData()->GetScalars();
} else {
- dataArr = aPresent->GetInput()->GetPointData()->GetScalars();
+ dataArr = aPresent->GetInput()->GetPointData()->GetScalars();
}
vtkFloatingPointType aRange[2];
dataArr->GetRange(aRange);
MSG(true, "3\n");
for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){
// MSG(true, "Value: "<< *(dataArr->GetTuple(aValId)));
- idx = lut->GetIndex(*(dataArr->GetTuple(aValId)));
+ idx = lut->GetIndex(*(dataArr->GetTuple(aValId)));
// MSG(true, "Value index "<<idx);
- cnt = distr->GetValue(idx);
- distr->SetValue(idx, cnt + 1);
+ cnt = distr->GetValue(idx);
+ distr->SetValue(idx, cnt + 1);
}
MSG(true, "4\n");
distr->Modified();
// points->Allocate(aNbVals);
// double x[3] = {0., 0., 0.};
/* for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){
- x[0] = aValId;
- points->InsertPoint(aValId, x);
+ x[0] = aValId;
+ points->InsertPoint(aValId, x);
*/// MSG(true, "Inserted point "<<aValId);
// MSG(true, ": "<<distr->GetValue(aValId));
// }
MSG(true, "nbYLabels = "<<xyplot->GetNumberOfYLabels());
if (ny < xyplot->GetNumberOfYLabels()) {
MSG(true, "5.1");
- xyplot->SetNumberOfYLabels(ny);
+ xyplot->SetNumberOfYLabels(ny);
MSG(true, "nbYLabels = "<<xyplot->GetNumberOfYLabels());
}
*/ xyplot->GetProperty()->SetColor(1, 1, 1);
vtkObject::GlobalWarningDisplayOn();
- VISU_ScalarBarActor * aScalarBar = VISU_ScalarBarActor::New();
- //vtkScalarBarActor * aScalarBar = vtkScalarBarActor::New();
- aPresent->SetNbColors(5);
- aPresent->DebugOn();
- aPresent->Update();
- aScalarBar->SetLookupTable(aPresent->GetBarTable());
- aScalarBar->DebugOn();
- aScalarBar->SetDistribution(aPresent->GetDistribution());
- aScalarBar->DistributionVisibilityOn();
-// aScalarBar->SetOrientationToHorizontal();
-// aScalarBar->GetPositionCoordinate()->SetValue(.1, .6, 0);
-// aScalarBar->GetPosition2Coordinate()->SetValue(.8, .3, 0);
+ VISU_ScalarBarActor * aScalarBar = VISU_ScalarBarActor::New();
+ //vtkScalarBarActor * aScalarBar = vtkScalarBarActor::New();
+ aPresent->SetNbColors(5);
+ aPresent->DebugOn();
+ aPresent->Update();
+ aScalarBar->SetLookupTable(aPresent->GetBarTable());
+ aScalarBar->DebugOn();
+ aScalarBar->SetDistribution(aPresent->GetDistribution());
+ aScalarBar->DistributionVisibilityOn();
+// aScalarBar->SetOrientationToHorizontal();
+// aScalarBar->GetPositionCoordinate()->SetValue(.1, .6, 0);
+// aScalarBar->GetPosition2Coordinate()->SetValue(.8, .3, 0);
/*{
vtkScalarBarWidget* aWidget = vtkScalarBarWidget::New();
aWidget->SetEnabled( 1 );
}
*/
- aRenderer->AddActor(anActor);
-// aRenderer->AddActor2D(xyplot); //RKV
- aRenderer->AddActor2D(aScalarBar);
-
- //aRenderer->AddActor2D(barChartActor()); //RKV
-
- aWindow->Render();
- aRenderer->ResetCamera();
-
- anInteractor->Start();
- return 0;
- }
+ aRenderer->AddActor(anActor);
+// aRenderer->AddActor2D(xyplot); //RKV
+ aRenderer->AddActor2D(aScalarBar);
+
+ //aRenderer->AddActor2D(barChartActor()); //RKV
+
+ aWindow->Render();
+ aRenderer->ResetCamera();
+
+ anInteractor->Start();
+ return 0;
+ }
}
}
else{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISUPipeline.hxx
// Author : Oleg UVAROV
// Module : VISU
#define _VISUPipeline_HXX_
#ifdef WNT
- #if defined VISU_PIPELINE_EXPORTS
+ #if defined VISU_PIPELINE_EXPORTS || defined VisuPipeLine_EXPORTS
#if defined WIN32
#define VISU_PIPELINE_EXPORT __declspec( dllexport )
#else
--- /dev/null
+/*=========================================================================
+
+ Program: Visualization Toolkit
+ Module: $RCSfile$
+
+ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
+ All rights reserved.
+ See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notice for more information.
+
+ Note from SALOME:
+ This file is a part of VTK library
+ It has been renamed and modified for SALOME project
+
+=========================================================================*/
+
+#include "VISU_CellDataToPointData.hxx"
+
+#include <vtkCellData.h>
+#include <vtkDataSet.h>
+#include <vtkIdList.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
+#include <vtkObjectFactory.h>
+#include <vtkPointData.h>
+
+vtkCxxRevisionMacro(VISU_CellDataToPointData, "$Revision$");
+vtkStandardNewMacro(VISU_CellDataToPointData);
+
+//----------------------------------------------------------------------------
+// Instantiate object so that cell data is not passed to output.
+VISU_CellDataToPointData::VISU_CellDataToPointData()
+{
+ this->PassCellData = 0;
+}
+
+#define VTK_MAX_CELLS_PER_POINT 4096
+
+//----------------------------------------------------------------------------
+int VISU_CellDataToPointData::RequestData(
+ vtkInformation*,
+ vtkInformationVector** inputVector,
+ vtkInformationVector* outputVector)
+{
+ vtkInformation* info = outputVector->GetInformationObject(0);
+ vtkDataSet *output = vtkDataSet::SafeDownCast(
+ info->Get(vtkDataObject::DATA_OBJECT()));
+
+ vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
+ vtkDataSet *input = vtkDataSet::SafeDownCast(
+ inInfo->Get(vtkDataObject::DATA_OBJECT()));
+
+ vtkIdType cellId, ptId;
+ vtkIdType numCells, numPts;
+ vtkCellData *inPD=input->GetCellData();
+ vtkPointData *outPD=output->GetPointData();
+ vtkIdList *cellIds;
+ double weight;
+ double *weights;
+
+ vtkDebugMacro(<<"Mapping cell data to point data");
+
+ // First, copy the input to the output as a starting point
+ output->CopyStructure( input );
+
+ cellIds = vtkIdList::New();
+ cellIds->Allocate(VTK_MAX_CELLS_PER_POINT);
+
+ if ( (numPts=input->GetNumberOfPoints()) < 1 )
+ {
+ vtkDebugMacro(<<"No input point data!");
+ cellIds->Delete();
+ return 1;
+ }
+ weights = new double[VTK_MAX_CELLS_PER_POINT];
+
+ // Pass the point data first. The fields and attributes
+ // which also exist in the cell data of the input will
+ // be over-written during CopyAllocate
+ output->GetPointData()->CopyGlobalIdsOff();
+ output->GetPointData()->PassData(input->GetPointData());
+ output->GetPointData()->CopyFieldOff("vtkGhostLevels");
+
+ // notice that inPD and outPD are vtkCellData and vtkPointData; respectively.
+ // It's weird, but it works.
+ outPD->InterpolateAllocate(inPD,numPts);
+
+ int abort=0;
+ vtkIdType progressInterval=numPts/20 + 1;
+ for (ptId=0; ptId < numPts && !abort; ptId++)
+ {
+ if ( !(ptId % progressInterval) )
+ {
+ this->UpdateProgress(static_cast<double>(ptId)/numPts);
+ abort = GetAbortExecute();
+ }
+
+ input->GetPointCells(ptId, cellIds);
+ numCells = cellIds->GetNumberOfIds();
+ if ( numCells > 0 )
+ {
+ weight = 1.0 / numCells;
+ for (cellId=0; cellId < numCells; cellId++)
+ {
+ weights[cellId] = weight;
+ }
+ outPD->InterpolatePoint(inPD, ptId, cellIds, weights);
+ }
+ else
+ {
+ outPD->NullPoint(ptId);
+ }
+ }
+
+ if ( !this->PassCellData )
+ {
+ output->GetCellData()->CopyAllOff();
+ output->GetCellData()->CopyFieldOn("vtkGhostLevels");
+ }
+ output->GetCellData()->PassData(input->GetCellData());
+
+ cellIds->Delete();
+ delete [] weights;
+
+ return 1;
+}
+
+//----------------------------------------------------------------------------
+void VISU_CellDataToPointData::PrintSelf(ostream& os, vtkIndent indent)
+{
+ this->Superclass::PrintSelf(os,indent);
+
+ os << indent << "Pass Cell Data: " << (this->PassCellData ? "On\n" : "Off\n");
+}
--- /dev/null
+/*=========================================================================
+
+ Program: Visualization Toolkit
+ Module: $RCSfile$
+
+ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
+ All rights reserved.
+ See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notice for more information.
+
+=========================================================================*/
+// .NAME VISU_CellDataToPointData - map cell data to point data
+// .SECTION Description
+// VISU_CellDataToPointData is a filter that transforms cell data (i.e., data
+// specified per cell) into point data (i.e., data specified at cell
+// points). The method of transformation is based on averaging the data
+// values of all cells using a particular point. Optionally, the input cell
+// data can be passed through to the output as well.
+
+// .SECTION Caveats
+// This filter is an abstract filter, that is, the output is an abstract type
+// (i.e., vtkDataSet). Use the convenience methods (e.g.,
+// GetPolyDataOutput(), GetStructuredPointsOutput(), etc.) to get the type
+// of output you want.
+
+// .SECTION See Also
+// vtkPointData vtkCellData vtkPointDataToCellData
+
+// note from SALOME:
+// This file is a part of VTK library
+// It has been renamed and modified for SALOME project
+
+#ifndef __VISU_CellDataToPointData_h
+#define __VISU_CellDataToPointData_h
+
+#include "VISUPipeline.hxx"
+#include <vtkDataSetAlgorithm.h>
+
+class vtkDataSet;
+
+class VISU_PIPELINE_EXPORT VISU_CellDataToPointData : public vtkDataSetAlgorithm
+{
+public:
+ static VISU_CellDataToPointData *New();
+ vtkTypeRevisionMacro(VISU_CellDataToPointData,vtkDataSetAlgorithm);
+ void PrintSelf(ostream& os, vtkIndent indent);
+
+ // Description:
+ // Control whether the input cell data is to be passed to the output. If
+ // on, then the input cell data is passed through to the output; otherwise,
+ // only generated point data is placed into the output.
+ vtkSetMacro(PassCellData,int);
+ vtkGetMacro(PassCellData,int);
+ vtkBooleanMacro(PassCellData,int);
+
+protected:
+ VISU_CellDataToPointData();
+ ~VISU_CellDataToPointData() {};
+
+ virtual int RequestData(vtkInformation* request,
+ vtkInformationVector** inputVector,
+ vtkInformationVector* outputVector);
+
+ int PassCellData;
+private:
+ VISU_CellDataToPointData(const VISU_CellDataToPointData&); // Not implemented.
+ void operator=(const VISU_CellDataToPointData&); // Not implemented.
+};
+
+#endif
+
+
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_ColoredPL.cxx
// Author: Alexey PETROV
#include <vtkPassThroughFilter.h>
#include <vtkDoubleArray.h>
+#ifdef WNT
+#include <float.h>
+#define isnan _isnan
+#endif
//----------------------------------------------------------------------------
VISU_ColoredPL
myFieldTransform->Delete();
- myThreshold->AllScalarsOn();
+ myThreshold->AllScalarsOff();
myThreshold->Delete();
myPassFilter->Delete();
myDistribution->Delete();
void
VISU_ColoredPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
if ( theIsCopyInput ) {
SetScalarRange( aPipeLine->GetScalarRange() );
if ( this->IsScalarFilterUsed() )
- SetScalarFilterRange( aPipeLine->GetScalarFilterRange() );
+ SetScalarFilterRange( aPipeLine->GetScalarFilterRange() );
}
SetScalarMode(aPipeLine->GetScalarMode());
void
VISU_ColoredPL
::SetScalarMode(int theScalarMode,
- vtkDataSet *theInput,
- VISU_Extractor* theExtractor)
+ vtkDataSet *theInput,
+ VISU_Extractor* theExtractor)
{
if(theInput){
if(VISU::IsDataOnPoints(theInput)){
vtkPointData *aPointData = theInput->GetPointData();
if(!aPointData->GetAttribute(vtkDataSetAttributes::VECTORS)) {
- if(theScalarMode == 0){
- return;
- }
+ if(theScalarMode == 0){
+ return;
+ }
}
} else {
vtkCellData *aCellData = theInput->GetCellData();
if(!aCellData->GetAttribute(vtkDataSetAttributes::VECTORS)){
- if(theScalarMode == 0){
- return;
- }
+ if(theScalarMode == 0){
+ return;
+ }
}
}
}
VISU_ColoredPL
::SetScalarRange( vtkFloatingPointType theRange[2] )
{
+ if (isnan(theRange[0]) || isnan(theRange[1]))
+ throw std::runtime_error("NAN values in the presentation");
+
if ( theRange[0] > theRange[1] )
return;
unsigned long int aTime = this->GetMTime();
// If modified then update the distribution array
if (aTime > myDistribution->GetMTime()) {
- // Set number of colors for the distribution
+ // Set number of colors for the distribution
int nbColors = this->GetNbColors();
- this->myDistribution->SetNumberOfValues(nbColors);
- // Initialize numbers of colored cells with zero
- this->myDistribution->FillComponent(0, 0);
- // Create a lookup table to compute a color of a cell
+ this->myDistribution->SetNumberOfValues(nbColors);
+ // Initialize numbers of colored cells with zero
+ this->myDistribution->FillComponent(0, 0);
+ // Create a lookup table to compute a color of a cell
VISU_LookupTable* lut = GetMapperTable();
vtkFloatingPointType aMapScale = lut->GetMapScale();
// Get scalar values from the input data to calculate their distribution within cells
vtkDataArray* dataArr;
// Dtermine where we have to take scalars from: cells data or points data.
if(VISU::IsDataOnCells(this->GetOutput())) {
- dataArr = this->GetOutput()->GetCellData()->GetScalars();
+ dataArr = this->GetOutput()->GetCellData()->GetScalars();
} else {
- dataArr = this->GetOutput()->GetPointData()->GetScalars();
+ dataArr = this->GetOutput()->GetPointData()->GetScalars();
}
// If scalars data array is not defined then create an empty one to avoid exceptions
if (dataArr == NULL) {
- dataArr = vtkDoubleArray::New();
+ dataArr = vtkDoubleArray::New();
}
// Get range of scalars values
}
}
this->myDistribution->Modified();
-
+
}
return myDistribution;
{
myExtractor->Update();
myExtractor->GetOutput()->GetScalarRange( theRange );
+
+ if (isnan(theRange[0]) || isnan(theRange[1]))
+ throw std::runtime_error("NAN values in the presentation");
}
void
GetSourceRange( aRange );
SetScalarRange( aRange );
}
+
+//----------------------------------------------------------------------------
+void
+VISU_ColoredPL
+::UpdateMapperLookupTable()
+{
+ //rnv: This method update pointer to the myMapperTable in the MapperHolder
+ GetMapperHolder()->SetLookupTable(GetMapperTable());
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_ColoredPL.hxx
// Author: Alexey PETROV
void
SetSourceRange();
+ virtual
+ void
+ UpdateMapperLookupTable();
+
+
protected:
//----------------------------------------------------------------------------
VISU_ColoredPL();
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
//----------------------------------------------------------------------------
VISU_Extractor*
static
void
SetScalarMode(int theScalarMode,
- vtkDataSet *theInput,
- VISU_Extractor* theExtractor);
+ vtkDataSet *theInput,
+ VISU_Extractor* theExtractor);
private:
vtkSmartPointer< VISU_LookupTable > myMapperTable;
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File: VISU_CutLinesBasePL.cxx
+// Author: Oleg UVAROV
+// Module : VISU
+//
+#include "VISU_CutLinesBasePL.hxx"
+
+#include <vtkObjectFactory.h>
+
+//----------------------------------------------------------------------------
+vtkStandardNewMacro(VISU_CutLinesBasePL);
+
+
+//----------------------------------------------------------------------------
+VISU_CutLinesBasePL
+::VISU_CutLinesBasePL()
+{
+ SetIsShrinkable(false);
+ SetIsFeatureEdgesAllowed(false);
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File: VISU_CutLinesBasePL.hxx
+// Author: Oleg UVAROV
+// Module : VISU
+//
+#ifndef VISU_CutLinesBasePL_HeaderFile
+#define VISU_CutLinesBasePL_HeaderFile
+
+#include "VISUPipeline.hxx"
+#include "VISU_CutPlanesPL.hxx"
+
+//----------------------------------------------------------------------------
+class VISU_PIPELINE_EXPORT VISU_CutLinesBasePL : public VISU_CutPlanesPL
+{
+public:
+ vtkTypeMacro(VISU_CutLinesBasePL,VISU_CutPlanesPL);
+
+ static
+ VISU_CutLinesBasePL*
+ New();
+
+public:
+ //! Returns direction that is defined by position & orientation of the basic and tool planes
+ const vtkFloatingPointType*
+ GetRealDirLn()
+ {
+ return myRealDirLn;
+ }
+
+ /*!
+ Returns direction that corresponds to the myRealDirLn,
+ but has the same direction as main axis.
+ */
+ const vtkFloatingPointType*
+ GetDirLn()
+ {
+ return myDirLn;
+ }
+
+ /*!
+ Returns coordinates of 3D point that shows
+ where is the first intersection of the given mesh.
+ with the defined direction.
+ */
+ const vtkFloatingPointType*
+ GetBasePnt()
+ {
+ return myBasePnt;
+ }
+
+ /*!
+ Returns three floating point numbers that defines the following values:
+ 1. Distance between the initial point of intersection and origin of coordinates;
+ 2. Distance between the last point of intersection and origin of coordinates;
+ 3. Distance between the last point and initial points of intersection.
+ with the defined direction.
+ */
+ const vtkFloatingPointType*
+ GetBoundPrjLn()
+ {
+ return myBoundPrjLn;
+ }
+
+protected:
+ VISU_CutLinesBasePL();
+
+ vtkFloatingPointType myDirLn[3];
+ vtkFloatingPointType myRealDirLn[3];
+ vtkFloatingPointType myBoundPrjLn[3];
+ vtkFloatingPointType myBasePnt[3];
+
+private:
+ VISU_CutLinesBasePL(const VISU_CutLinesBasePL&); // Not implemented.
+ void operator=(const VISU_CutLinesBasePL&); // Not implemented.
+};
+
+
+#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: VISU_PipeLine.cxx
// Author: Alexey PETROV
// Module : VISU
VISU_CutLinesPL
::VISU_CutLinesPL()
{
- SetIsShrinkable(false);
- SetIsFeatureEdgesAllowed(false);
-
myCondition = 1;
myPosition = 0;
}
void
VISU_CutLinesPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
if(VISU_CutLinesPL *aPipeLine = dynamic_cast<VISU_CutLinesPL*>(thePipeLine)){
SetOrientation(aPipeLine->GetPlaneOrientation(1),
- aPipeLine->GetRotateX(1),aPipeLine->GetRotateY(1),1);
+ aPipeLine->GetRotateX(1),aPipeLine->GetRotateY(1),1);
SetDisplacement(aPipeLine->GetDisplacement(1),1);
if (aPipeLine->IsDefault())
SetDefault();
vtkFloatingPointType aDir[3];
GetDir(aDir,
- myAng[0],
- myBasePlane[0]);
+ myAng[0],
+ myBasePlane[0]);
vtkFloatingPointType aBoundPrj[3];
GetBoundProject(aBoundPrj,
- aBounds,
- aDir);
+ aBounds,
+ aDir);
aPosition = aBoundPrj[0] + aBoundPrj[2] * myDisplacement[0];
}
VISU_CutLinesPL
::Update()
{
+ vtkDataSet* aMergedInput = GetMergedInput();
+ if(VISU::IsQuadraticData(aMergedInput)) // Bug 0020123, note 0005343
+ throw std::runtime_error("Impossible to build presentation");
+
ClearAppendPolyData(myAppendPolyData);
SetPartPosition(1);
vtkFloatingPointType aDir[2][3];
GetDir(aDir[0],
- myAng[0],
- myBasePlane[0]);
+ myAng[0],
+ myBasePlane[0]);
CutWithPlanes(anAppendPolyData,
- GetMergedInput(),
- 1,
- aDir[0],
- aBaseBounds,
- myPosition,
- myCondition,
- myDisplacement[0]);
+ GetMergedInput(),
+ 1,
+ aDir[0],
+ aBaseBounds,
+ myPosition,
+ myCondition,
+ myDisplacement[0]);
//Build lines
vtkDataSet *aDataSet = anAppendPolyData->GetOutput();
aDataSet->Update();
aDataSet->GetBounds(aBounds);
GetDir(aDir[1],
- myAng[1],
- myBasePlane[1]);
+ myAng[1],
+ myBasePlane[1]);
VISU_CutPlanesPL::CutWithPlanes(myAppendPolyData,
- aDataSet,
- GetNbParts(),
- aDir[1],
- aBounds,
- myPartPosition,
- myPartCondition,
- myDisplacement[1]);
+ aDataSet,
+ GetNbParts(),
+ aDir[1],
+ aBounds,
+ myPartPosition,
+ myPartCondition,
+ myDisplacement[1]);
//{
// std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myAppendPolyData.vtk";
// VISU::WriteToFile(myAppendPolyData->GetOutput(), aFileName);
}
GetBoundProject(myBoundPrjLn,
- aBaseBounds,
- myDirLn);
+ aBaseBounds,
+ myDirLn);
VISU::Mul(myDirLn,
- myBoundPrjLn[0],
- myBasePnt);
+ myBoundPrjLn[0],
+ myBasePnt);
CorrectPnt(myBasePnt,
- aBaseBounds);
+ aBaseBounds);
VISU_ScalarMapPL::Update();
}
void
VISU_CutLinesPL
::CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
- vtkDataSet* theDataSet,
- int theNbPlanes,
- vtkFloatingPointType theDir[3],
- vtkFloatingPointType theBounds[6],
- vtkFloatingPointType thePartPosition,
- int thePartCondition,
- vtkFloatingPointType theDisplacement)
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ vtkFloatingPointType thePartPosition,
+ int thePartCondition,
+ vtkFloatingPointType theDisplacement)
{
std::vector<vtkFloatingPointType> aPartPosition(1,thePartPosition);
std::vector<int> aPartCondition(1,thePartCondition);
VISU_CutPlanesPL::CutWithPlanes(theAppendPolyData,
- theDataSet,
- theNbPlanes,
- theDir,
- theBounds,
- aPartPosition,
- aPartCondition,
- theDisplacement);
+ theDataSet,
+ theNbPlanes,
+ theDir,
+ theBounds,
+ aPartPosition,
+ aPartCondition,
+ theDisplacement);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.hxx
// Author: Alexey PETROV
#define VISU_CutLinesPL_HeaderFile
#include "VISUPipeline.hxx"
-#include "VISU_CutPlanesPL.hxx"
+#include "VISU_CutLinesBasePL.hxx"
class vtkAppendPolyData;
//----------------------------------------------------------------------------
-class VISU_PIPELINE_EXPORT VISU_CutLinesPL : public VISU_CutPlanesPL
+class VISU_PIPELINE_EXPORT VISU_CutLinesPL : public VISU_CutLinesBasePL
{
public:
- vtkTypeMacro(VISU_CutLinesPL,VISU_CutPlanesPL);
+ vtkTypeMacro(VISU_CutLinesPL,VISU_CutLinesBasePL);
static
VISU_CutLinesPL*
static
void
CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
- vtkDataSet* theDataSet,
- int theNbPlanes,
- vtkFloatingPointType theDir[3],
- vtkFloatingPointType theBounds[6],
- vtkFloatingPointType thePlanePosition,
- int thePlaneCondition,
- vtkFloatingPointType theDisplacement);
-
- //! Returns direction that is defined by position & orientation of the basic and tool planes
- const vtkFloatingPointType*
- GetRealDirLn()
- {
- return myRealDirLn;
- }
-
- /*!
- Returns direction that corresponds to the myRealDirLn,
- but has the same direction as main axis.
- */
- const vtkFloatingPointType*
- GetDirLn()
- {
- return myDirLn;
- }
-
- /*!
- Returns coordinates of 3D point that shows
- where is the first intersection of the given mesh.
- with the defined direction.
- */
- const vtkFloatingPointType*
- GetBasePnt()
- {
- return myBasePnt;
- }
-
- /*!
- Returns three floating point numbers that defines the following values:
- 1. Distance between the initial point of intersection and origin of coordinates;
- 2. Distance between the last point of intersection and origin of coordinates;
- 3. Distance between the last point and initial points of intersection.
- with the defined direction.
- */
- const vtkFloatingPointType*
- GetBoundPrjLn()
- {
- return myBoundPrjLn;
- }
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ vtkFloatingPointType thePlanePosition,
+ int thePlaneCondition,
+ vtkFloatingPointType theDisplacement);
protected:
VISU_CutLinesPL();
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
- vtkFloatingPointType myDirLn[3];
- vtkFloatingPointType myRealDirLn[3];
- vtkFloatingPointType myBoundPrjLn[3];
- vtkFloatingPointType myBasePnt[3];
vtkFloatingPointType myPosition;
int myCondition;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.cxx
// Author: Alexey PETROV
#include "VISU_DeformationPL.hxx"
#include <vtkAppendPolyData.h>
-#include <vtkCutter.h>
+#include <vtkEDFCutter.h>
#include <vtkPlane.h>
//#include <vtkUnstructuredGrid.h>
void
VISU_CutPlanesPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
if(VISU_CutPlanesPL *aPipeLine = dynamic_cast<VISU_CutPlanesPL*>(thePipeLine)){
SetOrientation(aPipeLine->GetPlaneOrientation(),
- aPipeLine->GetRotateX(),
- aPipeLine->GetRotateY());
+ aPipeLine->GetRotateX(),
+ aPipeLine->GetRotateY());
SetDisplacement(aPipeLine->GetDisplacement());
SetNbParts(aPipeLine->GetNbParts());
- for (int i = 0, iEnd = GetNbParts(); i < iEnd; i++)
- if(!aPipeLine->IsPartDefault(i))
- SetPartPosition(i, aPipeLine->GetPartPosition(i));
+ for (int i = 0, iEnd = GetNbParts(); i < iEnd; i++) {
+ if(!aPipeLine->IsPartDefault(i))
+ SetPartPosition(i, aPipeLine->GetPartPosition(i));
+ else
+ SetPartDefault(i);
+ }
}
}
VISU_CutPlanesPL
::Update()
{
+ vtkDataSet* aMergedInput = GetMergedInput();
+ if(VISU::IsQuadraticData(aMergedInput)) // Bug 0020123, note 0005343
+ throw std::runtime_error("Impossible to build presentation");
+
ClearAppendPolyData(myAppendPolyData);
if(!myVectorialField || !IsDeformed()){
- SetMergeFilterInput(GetMergedInput(),GetMergedInput());
+ SetMergeFilterInput(aMergedInput,aMergedInput);
}
- if(VISU::IsDataOnCells(GetMergedInput()))
+ if(VISU::IsDataOnCells(aMergedInput))
GetMapper()->SetScalarModeToUseCellData();
else
GetMapper()->SetScalarModeToUsePointData();
vtkFloatingPointType aDir[3];
GetDir(aDir,
- myAng[0],
- myBasePlane[0]);
+ myAng[0],
+ myBasePlane[0]);
vtkFloatingPointType aBounds[6];
CutWithPlanes(myAppendPolyData,
aFilterOutput,
- myNbParts,
- aDir,
- aBounds,
- myPartPosition,
- myPartCondition,
- myDisplacement[0]);
+ myNbParts,
+ aDir,
+ aBounds,
+ myPartPosition,
+ myPartCondition,
+ myDisplacement[0]);
vtkFloatingPointType*
VISU_CutPlanesPL
::GetRy(vtkFloatingPointType theRy[3][3],
- vtkFloatingPointType thaAng)
+ vtkFloatingPointType thaAng)
{
theRy[0][0] = cos(thaAng); theRy[0][1] = 0.0; theRy[0][2] = sin(thaAng);
theRy[1][0] = 0.0; theRy[1][1] = 1.0; theRy[1][2] = 0.0;
vtkFloatingPointType*
VISU_CutPlanesPL
::GetRz(vtkFloatingPointType theRz[3][3],
- vtkFloatingPointType thaAng)
+ vtkFloatingPointType thaAng)
{
theRz[0][0] = cos(thaAng); theRz[0][1] = -sin(thaAng); theRz[0][2] = 0.0;
theRz[1][0] = sin(thaAng); theRz[1][1] = cos(thaAng); theRz[1][2] = 0.0;
void
VISU_CutPlanesPL
::CorrectPnt(vtkFloatingPointType thePnt[3],
- const vtkFloatingPointType BoundPrj[6])
+ const vtkFloatingPointType BoundPrj[6])
{
for(int i = 0, j = 0; i < 3; ++i, j=2*i){
if(thePnt[i] < BoundPrj[j]) thePnt[i] = BoundPrj[j];
void
VISU_CutPlanesPL
::GetBoundProject(vtkFloatingPointType BoundPrj[3],
- const vtkFloatingPointType BoundBox[6],
- const vtkFloatingPointType Dir[3])
+ const vtkFloatingPointType BoundBox[6],
+ const vtkFloatingPointType Dir[3])
{
vtkFloatingPointType BoundPoints[8][3] = { {BoundBox[0],BoundBox[2],BoundBox[4]},
- {BoundBox[1],BoundBox[2],BoundBox[4]},
- {BoundBox[0],BoundBox[3],BoundBox[4]},
- {BoundBox[1],BoundBox[3],BoundBox[4]},
- {BoundBox[0],BoundBox[2],BoundBox[5]},
- {BoundBox[1],BoundBox[2],BoundBox[5]},
- {BoundBox[0],BoundBox[3],BoundBox[5]},
- {BoundBox[1],BoundBox[3],BoundBox[5]}};
+ {BoundBox[1],BoundBox[2],BoundBox[4]},
+ {BoundBox[0],BoundBox[3],BoundBox[4]},
+ {BoundBox[1],BoundBox[3],BoundBox[4]},
+ {BoundBox[0],BoundBox[2],BoundBox[5]},
+ {BoundBox[1],BoundBox[2],BoundBox[5]},
+ {BoundBox[0],BoundBox[3],BoundBox[5]},
+ {BoundBox[1],BoundBox[3],BoundBox[5]}};
BoundPrj[0] = vtkMath::Dot(Dir,BoundPoints[0]), BoundPrj[1] = BoundPrj[0];
for(int i = 1; i < 8; i++){
vtkFloatingPointType tmp = vtkMath::Dot(Dir,BoundPoints[i]);
void
VISU_CutPlanesPL
::SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient,
- vtkFloatingPointType theXAng,
- vtkFloatingPointType theYAng,
- int theNum)
+ vtkFloatingPointType theXAng,
+ vtkFloatingPointType theYAng,
+ int theNum)
{
myBasePlane[theNum] = theOrient;
switch(myBasePlane[theNum]){
void
VISU_CutPlanesPL
::SetDisplacement(vtkFloatingPointType theDisp,
- int theNum)
+ int theNum)
{
if(VISU::CheckIsSameValue(myDisplacement[theNum], theDisp))
return;
void
VISU_CutPlanesPL
::SetPartPosition(int thePartNumber,
- vtkFloatingPointType thePartPosition)
+ vtkFloatingPointType thePartPosition)
{
if(thePartNumber >= myNbParts)
return;
vtkFloatingPointType
VISU_CutPlanesPL
::GetPartPosition(int thePartNumber,
- int theNum)
+ int theNum)
{
if(thePartNumber >= myNbParts)
return 0;
GetDir(aDir,
- myAng[theNum],
- myBasePlane[theNum]);
+ myAng[theNum],
+ myBasePlane[theNum]);
GetBoundProject(aBoundPrj,
- aBounds,
- aDir);
+ aBounds,
+ aDir);
if(myNbParts > 1){
- vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(myNbParts - 1);
- vtkFloatingPointType aDisplacement = aDBoundPrj * myDisplacement[theNum];
- vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
- aPosition = aStartPosition + thePartNumber*aDBoundPrj;
+ vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(myNbParts - 1);
+ vtkFloatingPointType aDisplacement = aDBoundPrj * myDisplacement[theNum];
+ vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
+ aPosition = aStartPosition + thePartNumber*aDBoundPrj;
}else
- aPosition = aBoundPrj[0] + aBoundPrj[2]*myDisplacement[theNum];
+ aPosition = aBoundPrj[0] + aBoundPrj[2]*myDisplacement[theNum];
}
return aPosition;
void
VISU_CutPlanesPL
::GetDir(vtkFloatingPointType theDir[3],
- const vtkFloatingPointType theAng[3],
- const PlaneOrientation& theBasePlane)
+ const vtkFloatingPointType theAng[3],
+ const PlaneOrientation& theBasePlane)
{
int iPlane = 0;
vtkFloatingPointType aRx[3][3], aRy[3][3], aRz[3][3], aRotation[3][3];
void
VISU_CutPlanesPL
::CutWithPlane(vtkAppendPolyData* theAppendPolyData,
- vtkDataSet* theDataSet,
- vtkFloatingPointType theDir[3],
- vtkFloatingPointType theOrig[3])
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theOrig[3])
{
- vtkCutter *aCutPlane = vtkCutter::New();
+ vtkEDFCutter *aCutPlane = vtkEDFCutter::New();
aCutPlane->SetInput(theDataSet);
vtkPlane *aPlane = vtkPlane::New();
aPlane->SetOrigin(theOrig);
void
VISU_CutPlanesPL
::CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
- vtkDataSet* theDataSet,
- int theNbPlanes,
- vtkFloatingPointType theDir[3],
- vtkFloatingPointType theBounds[6],
- const std::vector<vtkFloatingPointType>& thePlanePosition,
- const std::vector<int>& thePlaneCondition,
- vtkFloatingPointType theDisplacement)
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ const std::vector<vtkFloatingPointType>& thePlanePosition,
+ const std::vector<int>& thePlaneCondition,
+ vtkFloatingPointType theDisplacement)
{
vtkFloatingPointType aBoundPrj[3], aOrig[3], aPosition;
GetBoundProject(aBoundPrj, theBounds, theDir);
for (int i = 0; i < theNbPlanes; i++){
aPosition = aStartPosition + i*aDBoundPrj;
if(thePlaneCondition[i]){
- aPosition = aStartPosition + i*aDBoundPrj;
+ aPosition = aStartPosition + i*aDBoundPrj;
}else
- aPosition = thePlanePosition[i];
+ aPosition = thePlanePosition[i];
VISU::Mul(theDir,aPosition,aOrig);
CutWithPlane(theAppendPolyData,theDataSet,theDir,aOrig);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_CutPlanesPL.hxx
// Author: Alexey PETROV
virtual
void
SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient,
- vtkFloatingPointType theXAng,
- vtkFloatingPointType theYAng,
- int theNum = 0);
+ vtkFloatingPointType theXAng,
+ vtkFloatingPointType theYAng,
+ int theNum = 0);
virtual
const PlaneOrientation&
virtual
void
SetDisplacement(vtkFloatingPointType theDisp,
- int theNum = 0);
+ int theNum = 0);
virtual
void
SetPartPosition(int thePartNumber,
- vtkFloatingPointType thePartPosition);
+ vtkFloatingPointType thePartPosition);
virtual
vtkFloatingPointType
GetPartPosition(int thePartNumber,
- int theNum = 0);
+ int theNum = 0);
virtual
void
static
vtkFloatingPointType*
GetRx(vtkFloatingPointType theRx[3][3],
- vtkFloatingPointType thaAng);
+ vtkFloatingPointType thaAng);
static
vtkFloatingPointType*
GetRy(vtkFloatingPointType theRy[3][3],
- vtkFloatingPointType thaAng);
+ vtkFloatingPointType thaAng);
static
vtkFloatingPointType*
GetRz(vtkFloatingPointType theRz[3][3],
- vtkFloatingPointType thaAng);
+ vtkFloatingPointType thaAng);
static
void
CorrectPnt(vtkFloatingPointType thePnt[3],
- const vtkFloatingPointType BoundPrj[6]);
+ const vtkFloatingPointType BoundPrj[6]);
static
void
GetBoundProject(vtkFloatingPointType BoundPrj[3],
- const vtkFloatingPointType BoundBox[6],
- const vtkFloatingPointType Dir[3]);
+ const vtkFloatingPointType BoundBox[6],
+ const vtkFloatingPointType Dir[3]);
static
void
GetDir(vtkFloatingPointType theDir[3],
- const vtkFloatingPointType theAng[3],
- const PlaneOrientation& theBasePlane);
+ const vtkFloatingPointType theAng[3],
+ const PlaneOrientation& theBasePlane);
static
void
static
void
CutWithPlane(vtkAppendPolyData* theAppendPolyData,
- vtkDataSet* theDataSet,
- vtkFloatingPointType theDir[3],
- vtkFloatingPointType theOrig[3]);
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theOrig[3]);
static
void
CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
- vtkDataSet* theDataSet,
- int theNbPlanes,
- vtkFloatingPointType theDir[3],
- vtkFloatingPointType theBounds[6],
- const std::vector<vtkFloatingPointType>& thePlanePosition,
- const std::vector<int>& thePlaneCondition,
- vtkFloatingPointType theDisplacement);
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ const std::vector<vtkFloatingPointType>& thePlanePosition,
+ const std::vector<int>& thePlaneCondition,
+ vtkFloatingPointType theDisplacement);
virtual void SetVectorialField(VISU::PUnstructuredGridIDMapper);
VISU::PUnstructuredGridIDMapper getVectorialField();
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
void
SetPartPosition(int theNum = 0);
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File: VISU_CutSegmentPL.hxx
+// Author: Oleg UVAROV
+// Module : VISU
+//
+#include "VISU_CutSegmentPL.hxx"
+#include "VISU_PipeLineUtils.hxx"
+
+#include <vtkAppendPolyData.h>
+
+//----------------------------------------------------------------------------
+vtkStandardNewMacro(VISU_CutSegmentPL);
+
+
+//----------------------------------------------------------------------------
+VISU_CutSegmentPL
+::VISU_CutSegmentPL()
+{
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_CutSegmentPL
+::DoShallowCopy(VISU_PipeLine *thePipeLine,
+ bool theIsCopyInput)
+{
+ Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
+
+ if(VISU_CutSegmentPL *aPipeLine = dynamic_cast<VISU_CutSegmentPL*>(thePipeLine)){
+ vtkFloatingPointType x, y, z;
+ aPipeLine->GetPoint1(x, y, z);
+ SetPoint1(x, y, z);
+ aPipeLine->GetPoint2(x, y, z);
+ SetPoint2(x, y, z);
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_CutSegmentPL
+::Init()
+{
+ Superclass::Init();
+
+ vtkFloatingPointType aBounds[6];
+ GetMergedInput()->GetBounds(aBounds);
+
+ for( int i = 0; i < 3; i++ ) {
+ vtkFloatingPointType min = aBounds[ 2*i ];
+ vtkFloatingPointType max = aBounds[ 2*i+1 ];
+ myPoint1[ i ] = i == 1 ? min : ( min + max ) / 2;
+ myPoint2[ i ] = i == 1 ? max : ( min + max ) / 2;
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_CutSegmentPL
+::SetPoint1(vtkFloatingPointType theX,
+ vtkFloatingPointType theY,
+ vtkFloatingPointType theZ )
+{
+ myPoint1[0] = theX;
+ myPoint1[1] = theY;
+ myPoint1[2] = theZ;
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_CutSegmentPL
+::GetPoint1(vtkFloatingPointType& theX,
+ vtkFloatingPointType& theY,
+ vtkFloatingPointType& theZ )
+{
+ theX = myPoint1[0];
+ theY = myPoint1[1];
+ theZ = myPoint1[2];
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_CutSegmentPL
+::SetPoint2(vtkFloatingPointType theX,
+ vtkFloatingPointType theY,
+ vtkFloatingPointType theZ )
+{
+ myPoint2[0] = theX;
+ myPoint2[1] = theY;
+ myPoint2[2] = theZ;
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_CutSegmentPL
+::GetPoint2(vtkFloatingPointType& theX,
+ vtkFloatingPointType& theY,
+ vtkFloatingPointType& theZ )
+{
+ theX = myPoint2[0];
+ theY = myPoint2[1];
+ theZ = myPoint2[2];
+}
+
+//----------------------------------------------------------------------------
+vtkDataSet*
+VISU_CutSegmentPL
+::InsertCustomPL()
+{
+ return myAppendPolyData->GetOutput();
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_CutSegmentPL
+::Update()
+{
+ vtkDataSet* aMergedInput = GetMergedInput();
+ if(VISU::IsQuadraticData(aMergedInput)) // Bug 0020123, note 0005343
+ throw std::runtime_error("Impossible to build presentation");
+
+ vtkFloatingPointType aVector12[3], aVector21[3];
+ VISU::Sub( myPoint2, myPoint1, aVector12 );
+ VISU::Sub( myPoint1, myPoint2, aVector21 );
+
+ double aPrecision = 1.0 / VTK_LARGE_FLOAT;
+ double aNorm = vtkMath::Normalize( aVector12 );
+ if( aNorm < aPrecision )
+ return;
+
+ // compute two vectors which are orthogonal to the line between the input points
+ // these vectors could be used as normals of two planes, intersected exactly at this line
+ // origin of these planes should be places at one of the input points
+ vtkFloatingPointType aVector1[3], aVector2[3];
+ vtkMath::Perpendiculars( aVector12, aVector1, aVector2, 0 );
+
+ ClearAppendPolyData(myAppendPolyData);
+
+ SetPartPosition(1);
+
+ vtkFloatingPointType aBounds[6];
+ GetMergedInput()->GetBounds(aBounds);
+
+ // check if the input is planar - in this case one cut plane will be enough
+ // (besides, the second cut corrupts the resulting output, splitting it to points)
+ bool isPlanar = true;
+ vtkFloatingPointType aNormal[3] = { 0.0, 0.0, 0.0 };
+ if( fabs( aBounds[0] - aBounds[1] ) < aPrecision )
+ aNormal[0] = 1.0;
+ else if( fabs( aBounds[2] - aBounds[3] ) < aPrecision )
+ aNormal[1] = 1.0;
+ else if( fabs( aBounds[4] - aBounds[5] ) < aPrecision )
+ aNormal[2] = 1.0;
+ else
+ isPlanar = false;
+
+ if( isPlanar ) {
+ // choose a vector which is not collinear with normal of the plane
+ vtkFloatingPointType aCross[3];
+ vtkMath::Cross( aVector1, aNormal, aCross );
+ bool isFirst = vtkMath::Norm( aCross ) > aPrecision;
+ VISU_CutPlanesPL::CutWithPlane(myAppendPolyData, GetMergedInput(), isFirst ? aVector1 : aVector2, myPoint1);
+ myAppendPolyData->Update();
+ }
+ else {
+ vtkAppendPolyData *anAppendPolyData = vtkAppendPolyData::New();
+
+ VISU_CutPlanesPL::CutWithPlane(anAppendPolyData, GetMergedInput(), aVector1, myPoint1);
+ vtkDataSet *aDataSet = anAppendPolyData->GetOutput();
+ aDataSet->Update();
+
+ VISU_CutPlanesPL::CutWithPlane(myAppendPolyData, aDataSet, aVector2, myPoint1);
+ myAppendPolyData->Update();
+
+ anAppendPolyData->Delete();
+ }
+
+ // calculate values for building of table
+ for (int i = 0; i<3 ; i++) {
+ myRealDirLn[i] = myDirLn[i] = aVector12[i];
+ if(myDirLn[i] < 0.0)
+ myDirLn[i] = -1.0*myDirLn[i]; //enk:: correction of bug Bug PAL10401
+ }
+
+ GetBoundProject(myBoundPrjLn,
+ aBounds,
+ myDirLn);
+
+ VISU::Mul(myDirLn,
+ myBoundPrjLn[0],
+ myBasePnt);
+
+ CorrectPnt(myBasePnt,
+ aBounds);
+
+ VISU_ScalarMapPL::Update();
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File: VISU_CutSegmentPL.hxx
+// Author: Oleg UVAROV
+// Module : VISU
+//
+#ifndef VISU_CutSegmentPL_HeaderFile
+#define VISU_CutSegmentPL_HeaderFile
+
+#include "VISUPipeline.hxx"
+#include "VISU_CutLinesBasePL.hxx"
+
+
+//----------------------------------------------------------------------------
+class VISU_PIPELINE_EXPORT VISU_CutSegmentPL : public VISU_CutLinesBasePL
+{
+public:
+ vtkTypeMacro(VISU_CutSegmentPL,VISU_CutLinesBasePL);
+
+ static
+ VISU_CutSegmentPL*
+ New();
+
+ virtual
+ void
+ SetPoint1(vtkFloatingPointType theX,
+ vtkFloatingPointType theY,
+ vtkFloatingPointType theZ);
+
+ virtual
+ void
+ GetPoint1(vtkFloatingPointType& theX,
+ vtkFloatingPointType& theY,
+ vtkFloatingPointType& theZ);
+
+ virtual
+ void
+ SetPoint2(vtkFloatingPointType theX,
+ vtkFloatingPointType theY,
+ vtkFloatingPointType theZ);
+
+ virtual
+ void
+ GetPoint2(vtkFloatingPointType& theX,
+ vtkFloatingPointType& theY,
+ vtkFloatingPointType& theZ);
+
+public:
+ virtual
+ void
+ Init();
+
+ vtkDataSet*
+ InsertCustomPL();
+
+ virtual
+ void
+ Update();
+
+protected:
+ VISU_CutSegmentPL();
+
+ virtual
+ void
+ DoShallowCopy(VISU_PipeLine *thePipeLine,
+ bool theIsCopyInput);
+
+ vtkFloatingPointType myPoint1[3];
+ vtkFloatingPointType myPoint2[3];
+
+private:
+ VISU_CutSegmentPL(const VISU_CutSegmentPL&); // Not implemented.
+ void operator=(const VISU_CutSegmentPL&); // Not implemented.
+};
+
+
+#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_DataSetMapperHolder.cxx
// Author: Alexey PETROV
void
VISU_DataSetMapperHolder
::ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
if(VISU_DataSetMapperHolder* aMapperHolder = dynamic_cast<VISU_DataSetMapperHolder*>(theMapperHolder)){
if(theIsCopyInput)
SetUnstructuredGridIDMapper(aMapperHolder->GetUnstructuredGridIDMapper());
VISU::CopyDataSetMapper(GetDataSetMapper(),
- aMapperHolder->GetDataSetMapper(),
- theIsCopyInput);
+ aMapperHolder->GetDataSetMapper(),
+ theIsCopyInput);
myExtractGeometry->SetImplicitFunction(aMapperHolder->GetImplicitFunction());
}
}
vtkImplicitFunction* aFun = NULL;
aFunction->InitTraversal();
for(vtkIdType anID = 0; anID <= theID; anID++)
- aFun = aFunction->GetNextItem();
+ aFun = aFunction->GetNextItem();
aPlane = dynamic_cast<vtkPlane*>(aFun);
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_DataSetMapperHolder.hxx
// Author: Alexey PETROV
virtual
void
ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput);
+ bool theIsCopyInput);
void
SetElnoDisassembleState( bool theIsShrunk );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: VISU_ScalarMapPL.cxx
// Author: Roman NIKOLAEV
// Module : VISU
#include <vtkDataSet.h>
#include <vtkPassThroughFilter.h>
#include <vtkWarpVector.h>
-#include <vtkCellDataToPointData.h>
#include <vtkUnstructuredGrid.h>
#ifdef _DEBUG_
static int MYDEBUG = 0;
myVectorMergeFilter->SetMergingInputs(true);
myInputPassFilter = vtkPassThroughFilter::New();
myOutputPassFiler = vtkPassThroughFilter::New();
- myCellDataToPointData = vtkCellDataToPointData::New();
+ myCellDataToPointData = VISU_CellDataToPointData::New();
myCellDataToPointData->PassCellDataOn();
myInputPassFilter->SetInput(vtkUnstructuredGrid::New());
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_DeformationPL.hxx
// Author :
// Module : SALOME
class VISU_MergeFilter;
class vtkPassThroughFilter;
class vtkWarpVector;
-class vtkCellDataToPointData;
+class VISU_CellDataToPointData;
class VISU_PIPELINE_EXPORT VISU_DeformationPL {
vtkSmartPointer<VISU_MergeFilter> myVectorMergeFilter;
vtkPassThroughFilter *myInputPassFilter;
vtkPassThroughFilter *myOutputPassFiler;
- vtkCellDataToPointData *myCellDataToPointData;
+ VISU_CellDataToPointData *myCellDataToPointData;
private:
vtkFloatingPointType myScaleFactor;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_DeformedGridPL.cxx
// Author: Alexey PETROV
void
VISU_DeformedGridPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_ScalarMapPL.hxx
// Author: Alexey PETROV
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
private:
VISU_DeformedGridPL(const VISU_DeformedGridPL&); // Not implemented.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU DeformedShapeAndScalarMapPL
// File: VISU_DeformedShapeAndScalarMapPL.cxx
// Author: Eugeny Nikolaev
#include <vtkImplicitBoolean.h>
#include <vtkImplicitFunction.h>
#include <vtkUnstructuredGrid.h>
-#include <vtkCellDataToPointData.h>
#include <vtkPointDataToCellData.h>
#include <vtkImplicitFunctionCollection.h>
+#ifdef WNT
+#include <float.h>
+#define isnan _isnan
+#endif
//----------------------------------------------------------------------------
vtkStandardNewMacro(VISU_DeformedShapeAndScalarMapPL)
myScalarsFieldTransform = VISU_FieldTransform::New();
- myCellDataToPointData = vtkCellDataToPointData::New();
+ myCellDataToPointData = VISU_CellDataToPointData::New();
myScalarsElnoDisassembleFilter = VISU_ElnoDisassembleFilter::New();
vtkImplicitBoolean* anImplicitBoolean = vtkImplicitBoolean::New();
GetMapper()->ScalarVisibilityOn();
VISU::CellDataToPoint(myWarpVector,
- myCellDataToPointData,
- GetMergedInput());
+ myCellDataToPointData,
+ GetMergedInput());
- myScalars = GetMergedInput();
+ myScalars = vtkUnstructuredGrid::SafeDownCast(GetMergedInput());
UpdateScalars();
void
VISU_DeformedShapeAndScalarMapPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
if(GetScalars() == theScalars)
return;
- myScalars = theScalars;
+ myScalars = vtkUnstructuredGrid::SafeDownCast(theScalars);
UpdateScalars();
}
VISU_DeformedShapeAndScalarMapPL
::SetScalarRange(vtkFloatingPointType theRange[2])
{
+ if (isnan(theRange[0]) || isnan(theRange[1]))
+ throw std::runtime_error("NAN values in the presentation");
+
if(VISU::CheckIsSameRange(theRange, GetScalarRange()))
return;
{
myScalarsExtractor->Update();
myScalarsExtractor->GetUnstructuredGridOutput()->GetScalarRange(theRange);
+
+ if (isnan(theRange[0]) || isnan(theRange[1]))
+ throw std::runtime_error("NAN values in the presentation");
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetGaussMetric(VISU::TGaussMetric theGaussMetric)
+{
+ if(GetGaussMetric() == theGaussMetric)
+ return;
+
+ myScalarsExtractor->SetGaussMetric(theGaussMetric);
+}
+
+
+//----------------------------------------------------------------------------
+VISU::TGaussMetric
+VISU_DeformedShapeAndScalarMapPL
+::GetGaussMetric()
+{
+ return myScalarsExtractor->GetGaussMetric();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_DeformedShapeAndScalarMapPL.hxx
// Author: Eugeny Nikolaev
class VISU_MergeFilter;
class vtkWarpVector;
class vtkUnstructuredGrid;
-class vtkCellDataToPointData;
+class VISU_CellDataToPointData;
class vtkPointDataToCellData;
class VISU_ElnoDisassembleFilter;
class SALOME_ExtractGeometry;
void
GetSourceRange(vtkFloatingPointType theRange[2]);
+ virtual
+ void
+ SetGaussMetric(VISU::TGaussMetric theGaussMetric);
+
+ virtual
+ VISU::TGaussMetric
+ GetGaussMetric();
+
virtual
void
SetScalars(vtkDataSet *theScalars);
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
private:
VISU_DeformedShapeAndScalarMapPL(const VISU_DeformedShapeAndScalarMapPL&);
vtkWarpVector *myWarpVector;
VISU_MergeFilter *myScalarsMergeFilter;
vtkSmartPointer<vtkUnstructuredGrid> myScalars;
- vtkCellDataToPointData* myCellDataToPointData;
+ VISU_CellDataToPointData* myCellDataToPointData;
VISU_FieldTransform* myScalarsFieldTransform;
VISU_Extractor* myScalarsExtractor;
VISU_ElnoDisassembleFilter* myScalarsElnoDisassembleFilter;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.cxx
// Author: Alexey PETROV
SetIsFeatureEdgesAllowed(true);
myWarpVector = vtkWarpVector::New();
- myCellDataToPointData = vtkCellDataToPointData::New();
+ myCellDataToPointData = VISU_CellDataToPointData::New();
}
void
VISU_DeformedShapePL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
::InsertCustomPL()
{
VISU::CellDataToPoint(myWarpVector,
- myCellDataToPointData,
- GetMergedInput());
+ myCellDataToPointData,
+ GetMergedInput());
return myWarpVector->GetOutput();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.hxx
// Author: Alexey PETROV
#include "VISUPipeline.hxx"
#include "VISU_ScalarMapPL.hxx"
-class vtkCellDataToPointData;
+class VISU_CellDataToPointData;
class SALOME_Transform;
class vtkWarpVector;
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
vtkFloatingPointType myScaleFactor;
vtkFloatingPointType myMapScaleFactor;
vtkWarpVector *myWarpVector;
- vtkCellDataToPointData* myCellDataToPointData;
+ VISU_CellDataToPointData* myCellDataToPointData;
private:
VISU_DeformedShapePL(const VISU_DeformedShapePL&); // Not implemented.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VISU_ElnoAssembleFilter.hxx"
#include "VISU_PipeLineUtils.hxx"
#include "VISU_ElnoMeshValue.hxx"
VISU_ElnoAssembleFilter::VISU_ElnoAssembleFilter()
{
this->SetInputArrayToProcess( 0, // idx
- 0, // port
- 0, // connection
- vtkDataObject::FIELD_ASSOCIATION_POINTS, // field association
- "ELNO_POINT_COORDS" ); // name
+ 0, // port
+ 0, // connection
+ vtkDataObject::FIELD_ASSOCIATION_POINTS, // field association
+ "ELNO_POINT_COORDS" ); // name
this->myIsRestorePoints = false;
}
//----------------------------------------------------------------------------
template < int points_type, int elno_type >
int Execute2( vtkPointSet *theInput,
- vtkPointSet *theOutput,
- vtkDataArray *theElnoPointCoords )
+ vtkPointSet *theOutput,
+ vtkDataArray *theElnoPointCoords )
{
theOutput->CopyStructure( theInput );
//----------------------------------------------------------------------------
template < int points_type >
int Execute( vtkPointSet *theInput,
- vtkPointSet *theOutput,
- vtkDataArray *theElnoPointCoords )
+ vtkPointSet *theOutput,
+ vtkDataArray *theElnoPointCoords )
{
switch( theElnoPointCoords->GetDataType() ){
case VTK_DOUBLE:
//----------------------------------------------------------------------------
int VISU_ElnoAssembleFilter::RequestData( vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector )
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector )
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VISU_ElnoAssembleFilter_H
#define VISU_ElnoAssembleFilter_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VISU_ElnoDisassembleFilter.hxx"
#include "VISU_PipeLineUtils.hxx"
#include "VISU_ElnoMeshValue.hxx"
VISU_ElnoDisassembleFilter::VISU_ElnoDisassembleFilter()
{
this->SetInputArrayToProcess( 0, // idx
- 0, // port
- 0, // connection
- vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association
- "ELNO_FIELD" ); // name
+ 0, // port
+ 0, // connection
+ vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association
+ "ELNO_FIELD" ); // name
this->SetInputArrayToProcess( 1, // idx
- 0, // port
- 0, // connection
- vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association
- "ELNO_COMPONENT_MAPPER" ); // name
+ 0, // port
+ 0, // connection
+ vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association
+ "ELNO_COMPONENT_MAPPER" ); // name
this->myShrinkFactor = -0.999;
}
//----------------------------------------------------------------------------
TExecute2( vtkUnstructuredGrid *theInput,
- vtkUnstructuredGrid *theOutput,
- vtkDataArray *theElnoDataArray,
- vtkDataArray *theElnoDataMapper,
- vtkFloatingPointType theShrinkFactor )
+ vtkUnstructuredGrid *theOutput,
+ vtkDataArray *theElnoDataArray,
+ vtkDataArray *theElnoDataMapper,
+ vtkFloatingPointType theShrinkFactor )
: myGetElnoNodeData( theElnoDataArray, theElnoDataMapper )
, myInput( theInput )
, myOutput( theOutput )
myElnoPartialDataArray = TElnoDataArray::New();
// This partial data can be represented as in terms of vectors as scalars
if ( anInputCellData->GetVectors() != NULL )
- myElnoPartialDataArray->SetNumberOfComponents( 3 );
+ myElnoPartialDataArray->SetNumberOfComponents( 3 );
else
- myElnoPartialDataArray->SetNumberOfComponents( 1 );
+ myElnoPartialDataArray->SetNumberOfComponents( 1 );
myElnoPartialDataArray->SetNumberOfTuples( aNbPoints );
myElnoPointCoords = TPointsDataArray::New();
myOutputPointsMapper->SetNumberOfTuples( aNbPoints );
if ( theShrinkFactor > 0.0 )
- this->ShrinkExecute();
+ this->ShrinkExecute();
else
- this->SimpleExecute();
+ this->SimpleExecute();
theOutput->SetPoints( aPoints );
theOutput->SetCells( theInput->GetCellTypesArray(),
- theInput->GetCellLocationsArray(),
- myConnectivity );
+ theInput->GetCellLocationsArray(),
+ myConnectivity );
myConnectivity->Delete();
myElnoFullDataArray->Delete();
if ( anInputCellData->GetVectors() != NULL )
- myOutputPointData->SetVectors( myElnoPartialDataArray );
+ myOutputPointData->SetVectors( myElnoPartialDataArray );
else
- myOutputPointData->SetScalars( myElnoPartialDataArray );
+ myOutputPointData->SetScalars( myElnoPartialDataArray );
myElnoPartialDataArray->Delete();
myOutputPointData->AddArray( myElnoPointCoords );
vtkIdType aNbPts = 0, *aPts = 0;
for ( vtkIdType aCellId = 0; myConnectivity->GetNextCell( aNbPts, aPts ); aCellId++ ) {
for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
- TPointsDataType aCoords[ 3 ];
- vtkIdType aCurrentPntId = aPts[ aPntId ];
- myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords );
-
- aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aCoords );
- vtkIdType aNewPntId = aPts[ aPntId ];
-
- myElnoPointCoords->SetTupleValue( aNewPntId, aCoords );
-
- myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId );
-
- TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId );
- myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData );
-
- myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
- myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
-
- myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] );
- myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] );
+ TPointsDataType aCoords[ 3 ];
+ vtkIdType aCurrentPntId = aPts[ aPntId ];
+ myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords );
+
+ aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aCoords );
+ vtkIdType aNewPntId = aPts[ aPntId ];
+
+ myElnoPointCoords->SetTupleValue( aNewPntId, aCoords );
+
+ myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId );
+
+ TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId );
+ myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData );
+
+ myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+ myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+
+ myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] );
+ myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] );
}
}
}
myConnectivity->InitTraversal();
vtkIdType aNbPts = 0, *aPts = 0;
for ( vtkIdType aCellId = 0; myConnectivity->GetNextCell( aNbPts, aPts ); aCellId++ ) {
-
- TPointsDataType aCenter[ 3 ] = { TPointsDataType(), TPointsDataType(), TPointsDataType() };
-
- for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
- TPointsDataType aCoords[ 3 ];
- myInputPointsArray->GetTupleValue( aPts[ aPntId ], aCoords );
-
- aCenter[ 0 ] += aCoords[ 0 ];
- aCenter[ 1 ] += aCoords[ 1 ];
- aCenter[ 2 ] += aCoords[ 2 ];
- }
-
- aCenter[ 0 ] /= aNbPts;
- aCenter[ 1 ] /= aNbPts;
- aCenter[ 2 ] /= aNbPts;
-
- for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
- TPointsDataType aCoords[ 3 ];
- vtkIdType aCurrentPntId = aPts[ aPntId ];
- myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords );
-
- TPointsDataType aNewCoords[ 3 ];
-
- aNewCoords[ 0 ] = aCenter[ 0 ] +
- TPointsDataType( myShrinkFactor * ( aCoords[ 0 ] - aCenter[ 0 ] ) );
- aNewCoords[ 1 ] = aCenter[ 1 ] +
- TPointsDataType( myShrinkFactor * ( aCoords[ 1 ] - aCenter[ 1 ] ) );
- aNewCoords[ 2 ] = aCenter[ 2 ] +
- TPointsDataType( myShrinkFactor * ( aCoords[ 2 ] - aCenter[ 2 ] ) );
-
- aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aNewCoords );
- vtkIdType aNewPntId = aPts[ aPntId ];
-
- myElnoPointCoords->SetTupleValue( aNewPntId, aCoords );
-
- myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId );
-
- TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId );
- myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData );
-
- myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
- myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
-
- myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] );
- myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] );
- }
+
+ TPointsDataType aCenter[ 3 ] = { TPointsDataType(), TPointsDataType(), TPointsDataType() };
+
+ for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
+ TPointsDataType aCoords[ 3 ];
+ myInputPointsArray->GetTupleValue( aPts[ aPntId ], aCoords );
+
+ aCenter[ 0 ] += aCoords[ 0 ];
+ aCenter[ 1 ] += aCoords[ 1 ];
+ aCenter[ 2 ] += aCoords[ 2 ];
+ }
+
+ aCenter[ 0 ] /= aNbPts;
+ aCenter[ 1 ] /= aNbPts;
+ aCenter[ 2 ] /= aNbPts;
+
+ for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
+ TPointsDataType aCoords[ 3 ];
+ vtkIdType aCurrentPntId = aPts[ aPntId ];
+ myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords );
+
+ TPointsDataType aNewCoords[ 3 ];
+
+ aNewCoords[ 0 ] = aCenter[ 0 ] +
+ TPointsDataType( myShrinkFactor * ( aCoords[ 0 ] - aCenter[ 0 ] ) );
+ aNewCoords[ 1 ] = aCenter[ 1 ] +
+ TPointsDataType( myShrinkFactor * ( aCoords[ 1 ] - aCenter[ 1 ] ) );
+ aNewCoords[ 2 ] = aCenter[ 2 ] +
+ TPointsDataType( myShrinkFactor * ( aCoords[ 2 ] - aCenter[ 2 ] ) );
+
+ aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aNewCoords );
+ vtkIdType aNewPntId = aPts[ aPntId ];
+
+ myElnoPointCoords->SetTupleValue( aNewPntId, aCoords );
+
+ myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId );
+
+ TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId );
+ myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData );
+
+ myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+ myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+
+ myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] );
+ myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] );
+ }
}
}
};
//----------------------------------------------------------------------------
template < int points_type, int elno_type >
int Execute2( vtkUnstructuredGrid *theInput,
- vtkUnstructuredGrid *theOutput,
- vtkDataArray *theElnoDataArray,
- vtkDataArray *theElnoDataMapper,
- vtkFloatingPointType theShrinkFactor )
+ vtkUnstructuredGrid *theOutput,
+ vtkDataArray *theElnoDataArray,
+ vtkDataArray *theElnoDataMapper,
+ vtkFloatingPointType theShrinkFactor )
{
TExecute2< points_type, elno_type >( theInput,
- theOutput,
- theElnoDataArray,
- theElnoDataMapper,
- theShrinkFactor );
+ theOutput,
+ theElnoDataArray,
+ theElnoDataMapper,
+ theShrinkFactor );
return 1;
}
//----------------------------------------------------------------------------
template < int points_type >
int Execute( vtkUnstructuredGrid *theInput,
- vtkUnstructuredGrid *theOutput,
- vtkDataArray *theElnoDataArray,
- vtkDataArray *theElnoDataMapper,
- vtkFloatingPointType theShrinkFactor )
+ vtkUnstructuredGrid *theOutput,
+ vtkDataArray *theElnoDataArray,
+ vtkDataArray *theElnoDataMapper,
+ vtkFloatingPointType theShrinkFactor )
{
switch( theElnoDataArray->GetDataType() ){
case VTK_DOUBLE:
return Execute2< points_type, VTK_DOUBLE >
- ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
+ ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
case VTK_FLOAT:
return Execute2< points_type, VTK_FLOAT >
- ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
+ ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
case VTK_INT:
return Execute2< points_type, VTK_INT >
- ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
+ ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
case VTK_LONG:
return Execute2< points_type, VTK_LONG >
- ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
+ ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
default:
break;
}
//----------------------------------------------------------------------------
int VISU_ElnoDisassembleFilter::RequestData( vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector )
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector )
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VISU_ElnoDisassembleFilter_H
#define VISU_ElnoDisassembleFilter_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Extractor.cxx
// Module : VISU
#include "VISU_Extractor.hxx"
#include "VISU_PipeLineUtils.hxx"
#include "VISU_ConvertorUtils.hxx"
+#include "VISU_MeshValue.hxx"
+
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
#include <sstream>
+#include <cmath> // to use std::abs( int )
#include <vtkObjectFactory.h>
#include <vtkUnstructuredGrid.h>
#include <vtkInformation.h>
#include <vtkInformationVector.h>
-
+// Algorithm to cut values (see CutValue())
+// Use sprintf function
+#define USE_SPRINTF
+// Use new algorithm (works only when USE_SPRINTF is disabled)
+#define USE_NEW_ALGORITHM
//----------------------------------------------------------------------------
vtkStandardNewMacro(VISU_Extractor);
//----------------------------------------------------------------------------
VISU_Extractor
::VISU_Extractor():
- myScalarMode(1)
+ myScalarMode(1),
+ myGaussMetric(VISU::AVERAGE_METRIC)
{
}
//----------------------------------------------------------------------------
-template<typename TValueType>
+void
+VISU_Extractor
+::SetGaussMetric(VISU::TGaussMetric theGaussMetric)
+{
+ if(myGaussMetric != theGaussMetric){
+ myGaussMetric = theGaussMetric;
+ Modified();
+ }
+}
+
+//----------------------------------------------------------------------------
+VISU::TGaussMetric
+VISU_Extractor
+::GetGaussMetric()
+{
+ return myGaussMetric;
+}
+
+//----------------------------------------------------------------------------
+vtkFloatingPointType CutValue (vtkFloatingPointType theValue, int theDecimals)
+{
+ vtkFloatingPointType v = theValue;
+
+#if defined(USE_SPRINTF)
+ char aFormat[16];
+ sprintf(aFormat, "%%.%dg", theDecimals);
+ char aStr [256];
+ sprintf(aStr, aFormat, theValue);
+ v = atof(aStr);
+#elif defined(USE_NEW_ALGORITHM)
+ //
+ // VSR 19/10/2009: new algorithm does not use long long type
+ //
+ long n1 = 0;
+ // calculate order of the integral part
+ while ( v > 1. ) {
+ v = v / 10.;
+ n1++;
+ }
+ // calculate length of the fractional part
+ long n2 = theDecimals - n1;
+ v = theValue;
+ if ( n2 > 0 )
+ while ( n2-- > 0 ) v = v * 10.;
+ else
+ while ( n2++ < 0 ) v = v / 10.;
+ v = floor( (double) v );
+ n2 = theDecimals - n1;
+ if ( n2 > 0 )
+ while ( n2-- > 0 ) v = v / 10.;
+ else
+ while ( n2++ < 0 ) v = v * 10.;
+#else
+ //
+ // VSR 19/10/2009: old algorithm uses long long type -
+ // causes incompatibility with some platforms (Windows?)
+ //
+ vtkFloatingPointType aDegree = 0.0;
+ if (abs((long long)v) > 1)
+ aDegree = (long long)log10((double)abs((long long)v)) + 1;
+ aDegree = theDecimals - aDegree;
+ //printf("$$$ 1 v = %.20g , aDegree = %lld \n", v, (long long)aDegree);
+
+ aDegree = pow(10, aDegree);
+ v = ((vtkFloatingPointType)((long long)(v * aDegree))) / aDegree;
+ //printf("$$$ 2 v = %.20g , aDegree = %lld \n", v, (long long)aDegree);
+#endif
+
+ return v;
+}
+
+//----------------------------------------------------------------------------
+template<typename TValueType>
void
Module2Scalars(vtkDataArray *theInputDataArray,
- TValueType* theOutputPtr,
- vtkIdType theNbOfTuples)
+ TValueType* theOutputPtr,
+ vtkIdType theNbOfTuples)
{
vtkIdType aNbComp = theInputDataArray->GetNumberOfComponents();
std::vector<vtkFloatingPointType> anArray(aNbComp < 3? 3: aNbComp);
for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){
theInputDataArray->GetTuple(aTupleId, &anArray[0]);
vtkFloatingPointType aVector[3] = {anArray[0], anArray[1], anArray[2]};
- vtkFloatingPointType aScalar = sqrt(aVector[0]*aVector[0] +
- aVector[1]*aVector[1] +
- aVector[2]*aVector[2]);
+ vtkFloatingPointType aScalar = sqrt(aVector[0]*aVector[0] +
+ aVector[1]*aVector[1] +
+ aVector[2]*aVector[2]);
*theOutputPtr = TValueType(aScalar);
theOutputPtr++;
}
}
+template<typename TValueType>
+void
+Module2ScalarsMOD(vtkDataArray *theInputDataArray,
+ TValueType* theOutputPtr,
+ vtkIdType theNbOfTuples,
+ VISU::TGaussMetric theGaussMetric)
+{
+ vtkIdType aNbComp = theInputDataArray->GetNumberOfComponents();
+ if (aNbComp != 3) // Min, Max, Avg
+ return;
+ std::vector<vtkFloatingPointType> anArray (3);
+ for (vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) {
+ theInputDataArray->GetTuple(aTupleId, &anArray[0]);
+ switch (theGaussMetric) {
+ case VISU::MINIMUM_METRIC: *theOutputPtr = TValueType(anArray[0]); break;
+ case VISU::MAXIMUM_METRIC: *theOutputPtr = TValueType(anArray[1]); break;
+ case VISU::AVERAGE_METRIC: *theOutputPtr = TValueType(anArray[2]); break;
+ }
+ theOutputPtr++;
+ }
+}
+
//----------------------------------------------------------------------------
-template<typename TValueType>
+template<typename TValueType>
void
Component2Scalars(vtkDataArray *theInputDataArray,
- TValueType* theInputPtr,
- TValueType* theOutputPtr,
- vtkIdType theNbOfTuples,
- vtkIdType theComponentId)
+ TValueType* theInputPtr,
+ TValueType* theOutputPtr,
+ vtkIdType theNbOfTuples,
+ vtkIdType theComponentId)
{
vtkIdType aNbComp = theInputDataArray->GetNumberOfComponents();
- for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){
+ for (vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) {
*theOutputPtr = *(theInputPtr + theComponentId);
theInputPtr += aNbComp;
theOutputPtr++;
}
}
+//----------------------------------------------------------------------------
+template<typename TValueType>
+void
+CutScalarsTempl(TValueType* theDataPtr,
+ vtkIdType theNbOfTuples,
+ int theDecimals)
+{
+ for (vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) {
+ *theDataPtr = TValueType(CutValue(*theDataPtr, theDecimals));
+ theDataPtr++;
+ }
+}
//----------------------------------------------------------------------------
template<typename TDataSetAttributesType> void
-ExecuteScalars(vtkIdType theNbOfTuples,
- vtkIdType theScalarMode,
- TDataSetAttributesType* theInputData,
- TDataSetAttributesType* theOutputData)
+ExecuteScalars(vtkIdType theNbOfTuples,
+ vtkIdType theScalarMode,
+ VISU::TGaussMetric theGaussMetric,
+ TDataSetAttributesType* theInputData,
+ TDataSetAttributesType* theOutputData)
{
- if(theNbOfTuples < 1)
+ if (theNbOfTuples < 1)
+ return;
+
+ vtkDataArray* aFieldArray = NULL;
+ switch (theGaussMetric) {
+ case VISU::AVERAGE_METRIC: aFieldArray = theInputData->GetArray("VISU_FIELD"); break;
+ case VISU::MINIMUM_METRIC: aFieldArray = theInputData->GetArray("VISU_FIELD_GAUSS_MIN"); break;
+ case VISU::MAXIMUM_METRIC: aFieldArray = theInputData->GetArray("VISU_FIELD_GAUSS_MAX"); break;
+ }
+ if( !aFieldArray )
return;
- vtkDataArray* aFieldArray = theInputData->GetArray("VISU_FIELD");
vtkIdType anInputDataType = aFieldArray->GetDataType();
vtkDataArray *anOutputScalars = vtkDataArray::CreateDataArray(anInputDataType);
anOutputScalars->SetNumberOfComponents(1);
void *anInputPtr = aFieldArray->GetVoidPointer(0);
void *anOutputPtr = anOutputScalars->GetVoidPointer(0);
- if(theScalarMode == 0){
- switch(anInputDataType){
- vtkTemplateMacro3(Module2Scalars,
- aFieldArray,
- (VTK_TT *)(anOutputPtr),
- theNbOfTuples);
- default:
- break;
+ if (theScalarMode == 0) {
+ vtkDataArray* aFieldArrayMOD = theInputData->GetArray("VISU_FIELD_GAUSS_MOD");
+ if (aFieldArrayMOD) {
+ switch (anInputDataType) {
+ vtkTemplateMacro4(Module2ScalarsMOD,
+ aFieldArrayMOD,
+ (VTK_TT *)(anOutputPtr),
+ theNbOfTuples,
+ theGaussMetric);
+ default:
+ break;
+ }
}
- }else{
- switch(anInputDataType){
+ else {
+ switch (anInputDataType) {
+ vtkTemplateMacro3(Module2Scalars,
+ aFieldArray,
+ (VTK_TT *)(anOutputPtr),
+ theNbOfTuples);
+ default:
+ break;
+ }
+ }
+ } else {
+ switch (anInputDataType) {
vtkTemplateMacro5(Component2Scalars,
- aFieldArray,
- (VTK_TT *)(anInputPtr),
- (VTK_TT *)(anOutputPtr),
- theNbOfTuples,
- theScalarMode - 1);
+ aFieldArray,
+ (VTK_TT *)(anInputPtr),
+ (VTK_TT *)(anOutputPtr),
+ theNbOfTuples,
+ theScalarMode - 1);
default:
break;
}
}
-
+
theOutputData->SetScalars(anOutputScalars);
anOutputScalars->Delete();
}
+//---------------------------------------------------------------
+template<typename TDataSetAttributesType> void
+CutScalars(vtkIdType theNbOfTuples,
+ TDataSetAttributesType* theData)
+{
+ if (theNbOfTuples < 1)
+ return;
+
+ vtkDataArray *aScalars = theData->GetScalars();
+ if (!aScalars)
+ return;
+
+ vtkIdType aDataType = aScalars->GetDataType();
+ void *aPtr = aScalars->GetVoidPointer(0);
+
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+ // san: precision can be negative - this is used by double spin boxes
+ int aDecimals = std::abs( aResourceMgr->integerValue("VISU", "visual_data_precision", 6) );
+
+ switch(aDataType) {
+ vtkTemplateMacro3(CutScalarsTempl,
+ (VTK_TT *)(aPtr),
+ theNbOfTuples,
+ aDecimals);
+ default:
+ break;
+ }
+}
//---------------------------------------------------------------
int
VISU_Extractor
::RequestData(vtkInformation *theRequest,
- vtkInformationVector **theInputVector,
- vtkInformationVector *theOutputVector)
+ vtkInformationVector **theInputVector,
+ vtkInformationVector *theOutputVector)
{
vtkDataSet *anInput = VISU::GetInput( theInputVector, 0 );
vtkDataSet *anOutput = VISU::GetOutput( theOutputVector );
vtkPointData *anInputPointData = anInput->GetPointData();
vtkPointData *anOutputPointData = anOutput->GetPointData();
- anOutputPointData->PassData( anInputPointData );
+ anOutputPointData->PassData( anInputPointData );
if ( VISU::IsDataOnPoints( anInput ) ) {
int aNbElems = anInput->GetNumberOfPoints();
if ( anInputPointData->GetAttribute( vtkDataSetAttributes::VECTORS ) )
- ExecuteScalars( aNbElems, myScalarMode, anInputPointData, anOutputPointData );
+ ExecuteScalars( aNbElems, myScalarMode, myGaussMetric, anInputPointData, anOutputPointData );
+ CutScalars( aNbElems, anOutputPointData );
}
-
+
vtkCellData *anInputCellData = anInput->GetCellData();
vtkCellData *anOutputCellData = anOutput->GetCellData();
- anOutputCellData->PassData( anInputCellData );
+ anOutputCellData->PassData( anInputCellData );
if ( VISU::IsDataOnCells( anInput ) ) {
int aNbElems = anInput->GetNumberOfCells();
if ( anInputCellData->GetAttribute( vtkDataSetAttributes::VECTORS ) )
- ExecuteScalars( aNbElems, myScalarMode, anInputCellData, anOutputCellData );
+ ExecuteScalars( aNbElems, myScalarMode, myGaussMetric, anInputCellData, anOutputCellData );
+ CutScalars( aNbElems, anOutputCellData );
}
return 1;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Extractor.hxx
// Author : Alexey PETROV
#define VISU_Extractor_HeaderFile
#include "VISUPipeline.hxx"
+#include "VISU_ConvertorDef.hxx"
#include <vtkDataSetAlgorithm.h>
void
SetScalarMode(int theScalarMode = 0);
+ virtual
+ VISU::TGaussMetric
+ GetGaussMetric();
+
+ virtual
+ void
+ SetGaussMetric(VISU::TGaussMetric theGaussMetric = VISU::AVERAGE_METRIC);
+
protected:
VISU_Extractor();
VISU_Extractor(const VISU_Extractor&);
RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
int myScalarMode;
+ VISU::TGaussMetric myGaussMetric;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_FieldTransform.cxx
// Module : VISU
//
template<typename TValueType>
void
LinearTransformVectors(TValueType* theInputPtr,
- TValueType* theOutputPtr,
- vtkIdType theNbOfTuples,
- vtkFloatingPointType theScale[3])
+ TValueType* theOutputPtr,
+ vtkIdType theNbOfTuples,
+ vtkFloatingPointType theScale[3])
{
for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){
for(vtkIdType aComponentId = 0; aComponentId < 3; aComponentId++){
template<typename TValueType>
void
NonLinearTransformVectors(vtkDataArray *theInputVectors,
- TValueType* theInputPtr,
- TValueType* theOutputPtr,
- vtkIdType theNbOfTuples,
- vtkFloatingPointType theScale[3],
- VISU_FieldTransform::TTransformFun theFunction,
- vtkFloatingPointType theModifiedScalarMin,
- vtkFloatingPointType theModifiedScalarDelta,
- vtkFloatingPointType theSourceScalarMax)
+ TValueType* theInputPtr,
+ TValueType* theOutputPtr,
+ vtkIdType theNbOfTuples,
+ vtkFloatingPointType theScale[3],
+ VISU_FieldTransform::TTransformFun theFunction,
+ vtkFloatingPointType theModifiedScalarMin,
+ vtkFloatingPointType theModifiedScalarDelta,
+ vtkFloatingPointType theSourceScalarMax)
{
for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){
vtkFloatingPointType anInputVector[3];
vtkFloatingPointType aMagnification = vtkMath::Norm(anInputVector);
if(aMagnification > Tolerance)
aMagnification =
- ((*theFunction)(aMagnification) - theModifiedScalarMin) /
- theModifiedScalarDelta * theSourceScalarMax /
- aMagnification;
+ ((*theFunction)(aMagnification) - theModifiedScalarMin) /
+ theModifiedScalarDelta * theSourceScalarMax /
+ aMagnification;
if(aMagnification < 0.0)
aMagnification = 0.0;
for(vtkIdType aComponentId = 0; aComponentId < 3; aComponentId++){
template<typename TDataSetAttributesType>
void
ExecuteVectors(VISU_FieldTransform::TTransformFun theFunction,
- VTKViewer_Transform* theTransform,
- vtkFloatingPointType theScalarRange[2],
- vtkIdType theNbOfTuples,
- TDataSetAttributesType* theInputData,
- TDataSetAttributesType* theOutputData)
+ VTKViewer_Transform* theTransform,
+ vtkFloatingPointType theScalarRange[2],
+ vtkIdType theNbOfTuples,
+ TDataSetAttributesType* theInputData,
+ TDataSetAttributesType* theOutputData)
{
vtkDataArray *anInputVectors = theInputData->GetVectors();
if(!anInputVectors || theNbOfTuples < 1)
if(theFunction == &(VISU_FieldTransform::Ident)){
switch(anInputDataType){
vtkTemplateMacro4(LinearTransformVectors,
- (VTK_TT *)(anInputPtr),
- (VTK_TT *)(anOutputPtr),
- theNbOfTuples,
- aScale);
+ (VTK_TT *)(anInputPtr),
+ (VTK_TT *)(anOutputPtr),
+ theNbOfTuples,
+ aScale);
default:
break;
}
}else{
switch(anInputDataType){
vtkTemplateMacro9(NonLinearTransformVectors,
- anInputVectors,
- (VTK_TT *)(anInputPtr),
- (VTK_TT *)(anOutputPtr),
- theNbOfTuples,
- aScale,
- theFunction,
- aScalarRange[0],
- aScalarDelta,
- theScalarRange[1]);
+ anInputVectors,
+ (VTK_TT *)(anInputPtr),
+ (VTK_TT *)(anOutputPtr),
+ theNbOfTuples,
+ aScale,
+ theFunction,
+ aScalarRange[0],
+ aScalarDelta,
+ theScalarRange[1]);
default:
break;
}
template<typename TValueType>
void
NonLinearTransformScalars(vtkDataArray *theInputScalars,
- TValueType* theInputPtr,
- TValueType* theOutputPtr,
- vtkIdType theNbOfTuples,
- VISU_FieldTransform::TTransformFun theFunction,
- vtkFloatingPointType theModifiedScalarMin)
+ TValueType* theInputPtr,
+ TValueType* theOutputPtr,
+ vtkIdType theNbOfTuples,
+ VISU_FieldTransform::TTransformFun theFunction,
+ vtkFloatingPointType theModifiedScalarMin)
{
for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){
vtkFloatingPointType aScalar = (*theFunction)(vtkFloatingPointType(*theInputPtr));
template<typename TDataSetAttributesType>
void
ExecuteScalars(VISU_FieldTransform::TTransformFun theFunction,
- vtkFloatingPointType theScalarRange[2],
- vtkIdType theNbOfTuples,
- TDataSetAttributesType* theInputData,
- TDataSetAttributesType* theOutputData)
+ vtkFloatingPointType theScalarRange[2],
+ vtkIdType theNbOfTuples,
+ TDataSetAttributesType* theInputData,
+ TDataSetAttributesType* theOutputData)
{
vtkDataArray *anInputScalars = theInputData->GetScalars();
if(!anInputScalars || theNbOfTuples < 1)
switch(anInputDataType){
vtkTemplateMacro6(NonLinearTransformScalars,
- anInputScalars,
- (VTK_TT *)(anInputPtr),
- (VTK_TT *)(anOutputPtr),
- theNbOfTuples,
- theFunction,
- aScalarRange[0]);
+ anInputScalars,
+ (VTK_TT *)(anInputPtr),
+ (VTK_TT *)(anOutputPtr),
+ theNbOfTuples,
+ theFunction,
+ aScalarRange[0]);
default:
break;
}
int
VISU_FieldTransform
::RequestData(vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector)
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
output->GetCellData()->CopyVectorsOff();
ExecuteScalars(myFunction,
- myScalarRange,
- input->GetNumberOfPoints(),
- input->GetPointData(),
- output->GetPointData());
+ myScalarRange,
+ input->GetNumberOfPoints(),
+ input->GetPointData(),
+ output->GetPointData());
ExecuteVectors(myFunction,
- myTransform,
- myScalarRange,
- input->GetNumberOfPoints(),
- input->GetPointData(),
- output->GetPointData());
+ myTransform,
+ myScalarRange,
+ input->GetNumberOfPoints(),
+ input->GetPointData(),
+ output->GetPointData());
ExecuteScalars(myFunction,
- myScalarRange,
- input->GetNumberOfCells(),
- input->GetCellData(),
- output->GetCellData());
+ myScalarRange,
+ input->GetNumberOfCells(),
+ input->GetCellData(),
+ output->GetCellData());
ExecuteVectors(myFunction,
- myTransform,
- myScalarRange,
- input->GetNumberOfCells(),
- input->GetCellData(),
- output->GetCellData());
+ myTransform,
+ myScalarRange,
+ input->GetNumberOfCells(),
+ input->GetCellData(),
+ output->GetCellData());
}else{
output->GetPointData()->CopyAllOn();
output->GetCellData()->CopyAllOn();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_FieldTransform.hxx
// Author : Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_GaussPoints.cxx
// Author: Alexey PETROV
void
VISU_GaussPointsPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
VISU_MergedPL::DoShallowCopy(thePipeLine, theIsCopyInput);
}
+//----------------------------------------------------------------------------
+void
+VISU_GaussPointsPL
+::SetOpacity(vtkFloatingPointType theOpacity)
+{
+ GetPointSpriteMapper()->SetPointSpriteOpacity( theOpacity );
+}
+
+
+//----------------------------------------------------------------------------
+vtkFloatingPointType
+VISU_GaussPointsPL
+::GetOpacity()
+{
+ return GetPointSpriteMapper()->GetPointSpriteOpacity();
+}
+
+
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
vtkFloatingPointType* aScalarRange = GetScalarRange();
vtkFloatingPointType aDeltaScalarRange = aScalarRange[1] - aScalarRange[0];
+ // to avoid FPE if the minimum is equal to maximum
+ if( aDeltaScalarRange < 1.0 / VTK_LARGE_FLOAT )
+ return aMinSize;
+
return aMinSize + aDelta*(aVal - aScalarRange[0]) / aDeltaScalarRange;
}
vtkSmartPointer<vtkImageData>
VISU_GaussPointsPL
::MakeTexture( const char* theMainTexture,
- const char* theAlphaTexture )
+ const char* theAlphaTexture )
{
if( !theMainTexture || !theAlphaTexture )
return 0;
int
VISU_GaussPointsPL
-::AddGeometry(vtkDataSet* theGeometry)
+::AddGeometry(vtkDataSet* theGeometry, const VISU::TName& theGeomName)
{
+ // Fix for issue 0020167 (like in VISU_ScalarMapPL)
+ if(!IsExternalGeometryUsed())
+ ClearGeometry();
+ AddGeometryName(theGeomName);
myAppendFilter->AddInput(theGeometry);
return GetNumberOfGeometry();
}
vtkDataSet*
VISU_GaussPointsPL
-::GetGeometry(int theGeomNumber)
+::GetGeometry(int theGeomNumber, VISU::TName& theGeomName)
{
+ theGeomName = GetGeometryName(theGeomNumber);
return vtkDataSet::SafeDownCast(myAppendFilter->GetInput(theGeomNumber));
}
VISU_GaussPointsPL
::ClearGeometry()
{
+ ClearGeometryNames();
myAppendFilter->RemoveAllInputs();
}
+void
+VISU_GaussPointsPL
+::GetSourceRange(vtkFloatingPointType theRange[2])
+{
+ if(!IsExternalGeometryUsed())
+ Superclass::GetSourceRange(theRange);
+ else
+ GetMergedInput()->GetScalarRange( theRange );
+}
+
vtkPointSet*
VISU_GaussPointsPL
::GetMergedInput()
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_GaussPointsPL.hxx
// Author:
* for rendering the Gauss Points as Point Sprites.
*/
class VISU_PIPELINE_EXPORT VISU_GaussPointsPL : public VISU_MergedPL,
- public VISU_ColoredPL
+ public VISU_ColoredPL
{
public:
//----------------------------------------------------------------------------
vtkFloatingPointType
GetAlphaThreshold();
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteOpacity.
+ void
+ SetOpacity(vtkFloatingPointType theOpacity);
+
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteOpacity, vtkFloatingPointType).
+ vtkFloatingPointType
+ GetOpacity();
+
//! Set resolution of the Geometrical Sphere.
void
SetResolution(int theResolution);
static
vtkSmartPointer<vtkImageData>
MakeTexture( const char* theMainTexture,
- const char* theAlphaTexture );
+ const char* theAlphaTexture );
public:
//----------------------------------------------------------------------------
virtual
int
- AddGeometry(vtkDataSet* theGeometry);
+ AddGeometry(vtkDataSet* theGeometry, const VISU::TName& theGeomName);
virtual
vtkDataSet*
- GetGeometry(int theGeomNumber);
+ GetGeometry(int theGeomNumber, VISU::TName& theGeomName);
virtual
int
void
ClearGeometry();
+ virtual
+ void
+ GetSourceRange(vtkFloatingPointType theRange[2]);
+
virtual
vtkPointSet*
GetMergedInput();
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
private:
//----------------------------------------------------------------------------
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : VVTK_ImplicitFunctionWidget.cxx
// Author : Peter KURNEV
theRenderer->ViewToWorld(P[0][0],P[0][1],P[0][2]);
theRenderer->ViewToWorld(P[1][0],P[1][1],P[1][2]);
vtkFloatingPointType aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+
- (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+
- (P[1][2]-P[0][2])*(P[1][2]-P[0][2]));
+ (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+
+ (P[1][2]-P[0][2])*(P[1][2]-P[0][2]));
int* aSize = theRenderer->GetRenderWindow()->GetSize();
vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1]));
vtkDataSet* aDataSet = GetMapper()->GetInput();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : VISU_PlanesWidget.h
// Author : Peter KURNEV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.cxx
// Author: Alexey PETROV
#include <vtkContourFilter.h>
+#define GAP_COEFFICIENT 0.0001
//----------------------------------------------------------------------------
myContourFilter = vtkContourFilter::New();
- myCellDataToPointData = vtkCellDataToPointData::New();
+ myCellDataToPointData = VISU_CellDataToPointData::New();
}
void
VISU_IsoSurfacesPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
SetNbParts(aPipeLine->GetNbParts());
vtkFloatingPointType aRange[2] = {aPipeLine->GetMin(), aPipeLine->GetMax()};
SetRange(aRange);
+ SetRangeFixed(aPipeLine->IsRangeFixed());
}
}
//----------------------------------------------------------------------------
void
VISU_IsoSurfacesPL
-::SetRange(vtkFloatingPointType theRange[2])
+::SetRange(vtkFloatingPointType theRange[2], bool theIsForced)
{
- if(VISU::CheckIsSameRange(myRange, theRange))
+ if(VISU::CheckIsSameRange(myRange, theRange) && !theIsForced)
return;
if(theRange[0] <= theRange[1]){
myRange[0] = theRange[0];
myRange[1] = theRange[1];
vtkFloatingPointType aRange[2] = {theRange[0], theRange[1]};
+ if( IsRangeFixed() ) {
+ double aDelta = fabs( aRange[1] - aRange[0] ) * GAP_COEFFICIENT;
+ aRange[0] += aDelta;
+ aRange[1] -= aDelta;
+ }
if(GetScaling() == VTK_SCALE_LOG10)
VISU_LookupTable::ComputeLogRange(theRange, aRange);
myContourFilter->GenerateValues(GetNbParts(), aRange);
}
+//----------------------------------------------------------------------------
+void
+VISU_IsoSurfacesPL
+::SetRangeFixed(bool theIsFixed)
+{
+ myIsRangeFixed = theIsFixed;
+ SetRange( myRange, true );
+}
+
+
+//----------------------------------------------------------------------------
+bool
+VISU_IsoSurfacesPL
+::IsRangeFixed()
+{
+ return myIsRangeFixed;
+}
+
+
void
//----------------------------------------------------------------------------
VISU_IsoSurfacesPL
vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
SetRange(aScalarRange);
+
+ SetRangeFixed(true);
}
//----------------------------------------------------------------------------
Superclass::Build();
VISU::CellDataToPoint(myContourFilter,
- myCellDataToPointData,
- GetMergedInput());
+ myCellDataToPointData,
+ GetMergedInput());
}
vtkFloatingPointType aRange[2] = {GetMax() - theMapScale*(GetMax()-GetMin()), GetMax()};
vtkFloatingPointType aNewRange[2] = {aRange[0], aRange[1]};
+ if( IsRangeFixed() ) {
+ double aDelta = fabs( aNewRange[1] - aNewRange[0] ) * GAP_COEFFICIENT;
+ aNewRange[0] += aDelta;
+ aNewRange[1] -= aDelta;
+ }
if(GetScaling() == VTK_SCALE_LOG10)
VISU_LookupTable::ComputeLogRange(aRange,aNewRange);
myContourFilter->GenerateValues(GetNbParts(), aNewRange);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.hxx
// Author: Alexey PETROV
#include "VISU_ScalarMapPL.hxx"
class vtkContourFilter;
-class vtkCellDataToPointData;
+class VISU_CellDataToPointData;
//----------------------------------------------------------------------------
virtual
void
- SetRange(vtkFloatingPointType theRange[2]);
+ SetRange(vtkFloatingPointType theRange[2], bool theIsForced = false);
virtual
vtkFloatingPointType
virtual
vtkFloatingPointType
GetMax();
+
+ virtual
+ void
+ SetRangeFixed(bool theIsFixed);
+
+ virtual
+ bool
+ IsRangeFixed();
public:
virtual
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
int myNbParts;
vtkFloatingPointType myRange[2];
- vtkCellDataToPointData* myCellDataToPointData;
+ bool myIsRangeFixed;
+ VISU_CellDataToPointData* myCellDataToPointData;
vtkContourFilter *myContourFilter;
private:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_LabelPointsFilter.cxx
// Author: Vitaly Smetannikov
//----------------------------------------------------------------------------
int VISU_LabelPointsFilter::RequestData(vtkInformation* vtkNotUsed(request),
- vtkInformationVector** inputVector,
- vtkInformationVector* outputVector)
+ vtkInformationVector** inputVector,
+ vtkInformationVector* outputVector)
{
// get the info objects
vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
}
int VISU_LabelPointsFilter::RequestUpdateExtent(vtkInformation* vtkNotUsed(request),
- vtkInformationVector** inputVector,
- vtkInformationVector* outputVector)
+ vtkInformationVector** inputVector,
+ vtkInformationVector* outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
int VISU_LabelPointsFilter::GetRegions(vtkPolyData* theInput,
- vtkPolyData* theOutput)
+ vtkPolyData* theOutput)
{
vtkIdType cellId, i;
vtkIdType numPts, numCells;
aWave->InsertNextId(cellId);
aPointNumber = 0;
TraverseAndMark(aWave, aWave2, aVisited, aPointMap,
- aRegionNumber, aPointNumber, aMesh);
+ aRegionNumber, aPointNumber, aMesh);
if (aPointNumber >= myPointsNb) {
- std::set<vtkIdType, ltIdType> aIdxSet;
- for (i=0; i < numPts; i++) {
- if ( aPointMap[i] > -1 ) {
- aIdxSet.insert(i);
- aPointMap[i] = -1;
- }
- }
- std::vector<vtkIdType> aIdx(aIdxSet.begin(), aIdxSet.end());
- int aActualPts = aIdx.size();
- int aNewId;
- if (myPointsNb > 2) {
- int k = aActualPts/(myPointsNb - 1);
- int count;
- for (i=0, count = 0; i < aActualPts; i+=k, count++) {
- aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[i]));
- aOutPD->CopyData(aInpPD, aIdx[i], aNewId);
- }
- if (count < myPointsNb) {
- aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1]));
- aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId);
- }
- } else {
- aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[0]));
- aOutPD->CopyData(aInpPD, aIdx[0], aNewId);
- if (myPointsNb == 2) {
- aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1]));
- aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId);
- }
- }
+ std::set<vtkIdType, ltIdType> aIdxSet;
+ for (i=0; i < numPts; i++) {
+ if ( aPointMap[i] > -1 ) {
+ aIdxSet.insert(i);
+ aPointMap[i] = -1;
+ }
+ }
+ std::vector<vtkIdType> aIdx(aIdxSet.begin(), aIdxSet.end());
+ int aActualPts = aIdx.size();
+ int aNewId;
+ if (myPointsNb > 2) {
+ int k = aActualPts/(myPointsNb - 1);
+ int count;
+ for (i=0, count = 0; i < aActualPts; i+=k, count++) {
+ aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[i]));
+ aOutPD->CopyData(aInpPD, aIdx[i], aNewId);
+ }
+ if (count < myPointsNb) {
+ aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1]));
+ aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId);
+ }
+ } else {
+ aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[0]));
+ aOutPD->CopyData(aInpPD, aIdx[0], aNewId);
+ if (myPointsNb == 2) {
+ aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1]));
+ aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId);
+ }
+ }
}
aWave->Reset();
aWave2->Reset();
// traversal occurs across shared vertices.
//
void VISU_LabelPointsFilter::TraverseAndMark (vtkIdList* theWave,
- vtkIdList* theWave2,
- int* theVisited,
- vtkIdType* thePointMap,
- int& theRegionNumber,
- vtkIdType& thePointNumber,
- vtkPolyData* theMesh)
+ vtkIdList* theWave2,
+ int* theVisited,
+ vtkIdType* thePointMap,
+ int& theRegionNumber,
+ vtkIdType& thePointNumber,
+ vtkPolyData* theMesh)
{
vtkIdType cellId, ptId, numIds, i;
int j, k;
if ( theVisited[cellId] < 0 ) {
theVisited[cellId] = theRegionNumber;
theMesh->GetCellPoints(cellId, npts, pts);
-
+
for (j=0; j < npts; j++) {
if ( thePointMap[ptId=pts[j]] < 0 ) {
thePointMap[ptId] = thePointNumber++;
- }
+ }
theMesh->GetPointCells(ptId,ncells,cells);
-
+
// check connectivity criterion (geometric + scalar)
for (k=0; k < ncells; k++) {
cellId = cells[k];
- theWave2->InsertNextId(cellId);
- // }
- }//for all cells using this point
- }//for all points of this cell
+ theWave2->InsertNextId(cellId);
+ // }
+ }//for all cells using this point
+ }//for all points of this cell
}//if cell not yet visited
}//for all cells in this wave
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_LabelPointsFilter.hxx
// Author: Vitaly Smetannikov
void TraverseAndMark (vtkIdList* theWave,
- vtkIdList* theWave2,
- int* theVisited,
- vtkIdType* thePointMap,
- int& theRegionNumber,
- vtkIdType& thePointNumber,
- vtkPolyData* theMesh);
+ vtkIdList* theWave2,
+ int* theVisited,
+ vtkIdType* thePointMap,
+ int& theRegionNumber,
+ vtkIdType& thePointNumber,
+ vtkPolyData* theMesh);
int GetRegions(vtkPolyData* theInput,
- vtkPolyData* theOutput);
+ vtkPolyData* theOutput);
int myPointsNb;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_LookupTable.cxx
// Author : Vitaliy Smetannikov
//----------------------------------------------------------------------------
VISU_LookupTable
::VISU_LookupTable(int sze, int ext):
- vtkLookupTable(sze, ext),
- myScale(1.0),
- myBicolor(false)
+ vtkLookupTable(sze, ext),
+ myScale(1.0),
+ myBicolor(false),
+ myHasMarkedValues(false)
{}
//----------------------------------------------------------------------------
void
VISU_LookupTable
::MarkValueByColor( vtkFloatingPointType theValue,
- unsigned char* theColor )
-{
+ unsigned char* theColor )
+{
vtkIdType anIndex = this->GetIndex( theValue );
unsigned char *aTablePtr = this->GetPointer( anIndex );
CopyColor( aTablePtr, theColor );
+ myHasMarkedValues = true;
}
{
unsigned char aRedPtr[3] = {255, 0, 0};
unsigned char aBluePtr[3] = {0, 0, 255};
-
+
vtkFloatingPointType aRange[2];
this->GetTableRange(aRange);
vtkIdType aNbColors = this->GetNumberOfColors();
-
+
vtkFloatingPointType aDelta = (aRange[1]-aRange[0])/aNbColors;
vtkFloatingPointType aValue = aRange[0]+0.5*aDelta;
for(int i = 0; i < aNbColors; i++){
//----------------------------------------------------------------------------
-void
+void
VISU_LookupTable
::SetMapScale(vtkFloatingPointType theScale)
{
}
-int
+int
VISU_LookupTable
-::ComputeLogRange(vtkFloatingPointType inRange[2],
- vtkFloatingPointType outRange[2])
+::ComputeLogRange(vtkFloatingPointType inRange[2],
+ vtkFloatingPointType outRange[2])
{
if(inRange[0] >= inRange[1])
return -1;
return -1;
}
-unsigned char*
+unsigned char*
VISU_LookupTable
-::MapValue(vtkFloatingPointType v)
+::MapValue(vtkFloatingPointType v)
{
if(GetScale() == VTK_SCALE_LOG10) {
vtkFloatingPointType aLowBound = log10(this->TableRange[0]);
}
}
+void
+VISU_LookupTable
+::ForceBuild()
+{
+ Superclass::ForceBuild();
+ myHasMarkedValues = false;
+}
+
// Apply log to value, with appropriate constraints.
-inline
-vtkFloatingPointType
-VISU_ApplyLogScale(vtkFloatingPointType v,
- vtkFloatingPointType range[2],
- vtkFloatingPointType logRange[2])
+inline
+vtkFloatingPointType
+VISU_ApplyLogScale(vtkFloatingPointType v,
+ vtkFloatingPointType range[2],
+ vtkFloatingPointType logRange[2])
{
// is the range set for negative numbers?
- if (range[0] < 0)
- {
- if (v < 0)
- {
+ if (range[0] < 0) {
+ if (v < 0) {
v = log10(-static_cast<double>(v));
- }
- else if (range[0] > range[1])
- {
+ }
+ else if (range[0] > range[1]) {
v = logRange[0];
- }
- else
- {
+ }
+ else {
v = logRange[1];
- }
}
- else
- {
- if (v > 0)
- {
+ }
+ else {
+ if (v > 0) {
v = log10(static_cast<double>(v));
- }
- else if (range[0] < range[1])
- {
+ }
+ else if (range[0] < range[1]) {
v = logRange[0];
- }
- else
- {
+ }
+ else {
v = logRange[1];
- }
}
+ }
return v;
-}
+}
// Apply shift/scale to the scalar value v and do table lookup.
-inline
+inline
unsigned char *
-VISU_LinearLookup(vtkFloatingPointType v,
- unsigned char *table,
- vtkFloatingPointType maxIndex,
- vtkFloatingPointType shift,
- vtkFloatingPointType scale,
- bool bicolor)
+VISU_LinearLookup(vtkFloatingPointType v,
+ unsigned char *table,
+ vtkFloatingPointType maxIndex,
+ vtkFloatingPointType shift,
+ vtkFloatingPointType scale,
+ bool bicolor)
{
if( !bicolor )
{
// of 8-bit chunks
template<class T>
void
-VISU_LookupTableMapData(vtkLookupTable *self,
- T *input,
- unsigned char *output,
- int length,
- int inIncr,
- int outFormat,
- vtkFloatingPointType theMapScale,
- bool bicolor)
+VISU_LookupTableMapData(vtkLookupTable *self,
+ T *input,
+ unsigned char *output,
+ int length,
+ int inIncr,
+ int outFormat,
+ vtkFloatingPointType theMapScale,
+ bool bicolor)
{
int i = length;
vtkFloatingPointType *range = self->GetTableRange();
unsigned char *cptr;
vtkFloatingPointType alpha;
- if ( (alpha=self->GetAlpha()) >= 1.0 ) //no blending required
- {
+ if ( (alpha=self->GetAlpha()) >= 1.0 ) //no blending required
+ {
if (self->GetScale() == VTK_SCALE_LOG10)
- {
+ {
vtkFloatingPointType val;
vtkFloatingPointType logRange[2];
VISU_LookupTable::ComputeLogRange(range, logRange);
shift = -logRange[0];
if (logRange[1] <= logRange[0])
- {
+ {
scale = VTK_LARGE_FLOAT;
- }
+ }
else
- {
+ {
scale = (maxIndex + 1)/(logRange[1] - logRange[0]);
- }
+ }
/* correct scale
scale = maxIndex/(logRange[1] - logRange[0]);
*/
if (outFormat == VTK_RGBA)
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
- *output++ = *cptr++;
input += inIncr;
- }
}
+ }
else if (outFormat == VTK_RGB)
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
input += inIncr;
- }
}
+ }
else if (outFormat == VTK_LUMINANCE_ALPHA)
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
*output++ = cptr[3];
input += inIncr;
- }
}
+ }
else // outFormat == VTK_LUMINANCE
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
input += inIncr;
- }
}
- }//if log scale
+ }
+ }//if log scale
else //not log scale
- {
+ {
shift = -range[0];
if (range[1] <= range[0])
- {
+ {
scale = VTK_LARGE_FLOAT;
- }
+ }
else
- {
+ {
scale = (maxIndex + 1)/(range[1] - range[0]);
- }
+ }
/* correct scale
scale = maxIndex/(range[1] - range[0]);
*/
if (outFormat == VTK_RGBA)
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
- *output++ = *cptr++;
input += inIncr;
- }
}
+ }
else if (outFormat == VTK_RGB)
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
input += inIncr;
- }
}
+ }
else if (outFormat == VTK_LUMINANCE_ALPHA)
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
*output++ = cptr[3];
input += inIncr;
- }
}
+ }
else // outFormat == VTK_LUMINANCE
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
input += inIncr;
- }
}
- }//if not log lookup
- }//if blending not needed
+ }
+ }//if not log lookup
+ }//if blending not needed
else //blend with the specified alpha
- {
+ {
if (self->GetScale() == VTK_SCALE_LOG10)
- {
+ {
vtkFloatingPointType val;
vtkFloatingPointType logRange[2];
VISU_LookupTable::ComputeLogRange(range, logRange);
shift = -logRange[0];
if (logRange[1] <= logRange[0])
- {
+ {
scale = VTK_LARGE_FLOAT;
- }
+ }
else
- {
+ {
scale = (maxIndex + 1)/(logRange[1] - logRange[0]);
- }
+ }
/* correct scale
scale = maxIndex/(logRange[1] - logRange[0]);
*/
if (outFormat == VTK_RGBA)
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = static_cast<unsigned char>((*cptr)*alpha); cptr++;
input += inIncr;
- }
}
+ }
else if (outFormat == VTK_RGB)
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
input += inIncr;
- }
}
+ }
else if (outFormat == VTK_LUMINANCE_ALPHA)
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
*output++ = static_cast<unsigned char>(alpha*cptr[3]);
input += inIncr;
- }
}
+ }
else // outFormat == VTK_LUMINANCE
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
val = VISU_ApplyLogScale(*input, range, logRange);
- cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
input += inIncr;
- }
}
- }//log scale with blending
+ }
+ }//log scale with blending
else //no log scale with blending
- {
+ {
shift = -range[0];
if (range[1] <= range[0])
- {
+ {
scale = VTK_LARGE_FLOAT;
- }
+ }
else
- {
+ {
scale = (maxIndex + 1)/(range[1] - range[0]);
- }
+ }
/* correct scale
scale = maxIndex/(range[1] - range[0]);
*/
if (outFormat == VTK_RGBA)
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = static_cast<unsigned char>((*cptr)*alpha); cptr++;
input += inIncr;
- }
}
+ }
else if (outFormat == VTK_RGB)
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
*output++ = *cptr++;
*output++ = *cptr++;
*output++ = *cptr++;
input += inIncr;
- }
}
+ }
else if (outFormat == VTK_LUMINANCE_ALPHA)
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
*output++ = static_cast<unsigned char>(cptr[3]*alpha);
input += inIncr;
- }
}
+ }
else // outFormat == VTK_LUMINANCE
+ {
+ while (--i >= 0)
{
- while (--i >= 0)
- {
- cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
- *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
+ cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
+ *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
cptr[2]*0.11 + 0.5);
input += inIncr;
- }
}
- }//no log scale
- }//alpha blending
+ }
+ }//no log scale
+ }//alpha blending
}
// Although this is a relatively expensive calculation,
// for subsequent renders.
template<class T>
void
-VISU_LookupTableMapMag(vtkLookupTable *self,
- T *input,
- unsigned char *output,
- int length,
- int inIncr,
- int outFormat,
- vtkFloatingPointType theMapScale,
- bool bicolor)
+VISU_LookupTableMapMag(vtkLookupTable *self,
+ T *input,
+ unsigned char *output,
+ int length,
+ int inIncr,
+ int outFormat,
+ vtkFloatingPointType theMapScale,
+ bool bicolor)
{
double tmp, sum;
double *mag;
mag = new double[length];
for (i = 0; i < length; ++i)
- {
+ {
sum = 0;
for (j = 0; j < inIncr; ++j)
- {
- tmp = (double)(*input);
+ {
+ tmp = (double)(*input);
sum += (tmp * tmp);
++input;
- }
- mag[i] = sqrt(sum);
}
+ mag[i] = sqrt(sum);
+ }
VISU_LookupTableMapData(self, mag, output, length, 1, outFormat, theMapScale, bicolor);
}
-void VISU_LookupTable::MapScalarsThroughTable2(void *input,
- unsigned char *output,
- int inputDataType,
- int numberOfValues,
- int inputIncrement,
- int outputFormat)
+void VISU_LookupTable::MapScalarsThroughTable2(void *input,
+ unsigned char *output,
+ int inputDataType,
+ int numberOfValues,
+ int inputIncrement,
+ int outputFormat)
{
if (this->UseMagnitude && inputIncrement > 1)
- {
+ {
switch (inputDataType)
- {
+ {
case VTK_BIT:
vtkErrorMacro("Cannot comput magnitude of bit array.");
break;
case VTK_CHAR:
VISU_LookupTableMapMag(this,static_cast<char *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
- return;
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ return;
case VTK_UNSIGNED_CHAR:
VISU_LookupTableMapMag(this,static_cast<unsigned char *>(input),output,
numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
default:
vtkErrorMacro(<< "MapImageThroughTable: Unknown input ScalarType");
return;
- }
}
+ }
switch (inputDataType)
- {
+ {
case VTK_BIT:
- {
+ {
vtkIdType i, id;
vtkBitArray *bitArray = vtkBitArray::New();
bitArray->SetVoidArray(input,numberOfValues,1);
vtkUnsignedCharArray *newInput = vtkUnsignedCharArray::New();
newInput->SetNumberOfValues(numberOfValues);
for (id=i=0; i<numberOfValues; i++, id+=inputIncrement)
- {
+ {
newInput->SetValue(i, bitArray->GetValue(id));
- }
+ }
VISU_LookupTableMapData(this,
- static_cast<unsigned char*>(newInput->GetPointer(0)),
- output,numberOfValues,
- inputIncrement,outputFormat,myScale,myBicolor);
+ static_cast<unsigned char*>(newInput->GetPointer(0)),
+ output,numberOfValues,
+ inputIncrement,outputFormat,myScale,myBicolor);
newInput->Delete();
bitArray->Delete();
- }
- break;
-
+ }
+ break;
+
case VTK_CHAR:
VISU_LookupTableMapData(this,static_cast<char *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_UNSIGNED_CHAR:
VISU_LookupTableMapData(this,static_cast<unsigned char *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_SHORT:
VISU_LookupTableMapData(this,static_cast<short *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_UNSIGNED_SHORT:
VISU_LookupTableMapData(this,static_cast<unsigned short *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_INT:
VISU_LookupTableMapData(this,static_cast<int *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_UNSIGNED_INT:
VISU_LookupTableMapData(this,static_cast<unsigned int *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_LONG:
VISU_LookupTableMapData(this,static_cast<long *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_UNSIGNED_LONG:
VISU_LookupTableMapData(this,static_cast<unsigned long *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_FLOAT:
VISU_LookupTableMapData(this,static_cast<float *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
case VTK_DOUBLE:
VISU_LookupTableMapData(this,static_cast<double *>(input),output,
- numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
+ numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
break;
-
+
default:
vtkErrorMacro(<< "MapImageThroughTable: Unknown input ScalarType");
return;
- }
-}
-
+ }
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_LookupTable.h
// Author : Vitaliy Smetannikov
// Module : VISU
vtkTypeMacro(VISU_LookupTable,vtkLookupTable);
static VISU_LookupTable *New();
+ virtual void ForceBuild();
+
virtual void MapScalarsThroughTable2(void *input, unsigned char *output,
- int inputDataType, int numberOfValues,
- int inputIncrement, int outputIncrement);
+ int inputDataType, int numberOfValues,
+ int inputIncrement, int outputIncrement);
vtkFloatingPointType GetMapScale() { return myScale; }
void SetMapScale(vtkFloatingPointType theScale = 1.0);
void SetBicolor( bool theBicolor );
static int ComputeLogRange( vtkFloatingPointType inRange[2],
- vtkFloatingPointType outRange[2] );
+ vtkFloatingPointType outRange[2] );
unsigned char *MapValue(vtkFloatingPointType v);
void MarkValueByColor( vtkFloatingPointType theValue,
- unsigned char* theColor );
+ unsigned char* theColor );
+
+ bool HasMarkedValues() const { return myHasMarkedValues; }
void FillByColor( unsigned char* theColor );
vtkFloatingPointType myScale;
bool myBicolor;
+ bool myHasMarkedValues;
};
#endif // VISU_LookupTable_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_MapperHolder.cxx
// Author: Alexey PETROV
void
VISU_MapperHolder
::ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
if(theIsCopyInput)
SetIDMapper(theMapperHolder->GetIDMapper());
VISU::CopyMapper(GetMapper(),
- theMapperHolder->GetMapper(),
- theIsCopyInput);
+ theMapperHolder->GetMapper(),
+ theIsCopyInput);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_MapperHolder.hxx
// Author: Alexey PETROV
virtual
void
ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput);
+ bool theIsCopyInput);
//! Gets memory size used by the instance (bytes).
virtual
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_StreamLinesPL.cxx
// Author: Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_MaskPointsFilter.hxx
// Author: Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_MergedPL.cxx
// Author: Alexey PETROV
void
VISU_MergedPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
if(VISU_MergedPL *aPipeLine = dynamic_cast<VISU_MergedPL*>(thePipeLine)){
if ( this == aPipeLine )
if ( aPipeLine->IsExternalGeometryUsed() ) {
ClearGeometry();
int aNbOfGeometry = aPipeLine->GetNumberOfGeometry();
- for ( int aGeomNumber = 0; aGeomNumber < aNbOfGeometry; aGeomNumber++ )
- AddGeometry( aPipeLine->GetGeometry( aGeomNumber ) );
+ for ( int aGeomNumber = 0; aGeomNumber < aNbOfGeometry; aGeomNumber++ ) {
+ VISU::TName aGeomName;
+ AddGeometry( aPipeLine->GetGeometry( aGeomNumber, aGeomName ), aGeomName );
+ }
}else
SetSourceGeometry();
}
}
+
+//----------------------------------------------------------------------------
+void
+VISU_MergedPL
+::AddGeometryName(const VISU::TName& theGeomName)
+{
+ myGeometryNames.push_back( theGeomName );
+}
+
+//----------------------------------------------------------------------------
+VISU::TName
+VISU_MergedPL
+::GetGeometryName( int theGeomNumber ) const
+{
+ if( theGeomNumber < myGeometryNames.size() )
+ return myGeometryNames[ theGeomNumber ];
+ return VISU::TName();
+}
+
+//----------------------------------------------------------------------------
+const VISU::TNames&
+VISU_MergedPL
+::GetGeometryNames() const
+{
+ return myGeometryNames;
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_MergedPL
+::ClearGeometryNames()
+{
+ myGeometryNames.clear();
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_MergedPL.hxx
// Author: Alexey PETROV
#define VISU_MergedPL_HeaderFile
#include "VISUPipeline.hxx"
+#include "VISU_Structures.hxx"
class vtkDataSet;
class vtkPointSet;
virtual
int
- AddGeometry( vtkDataSet* theGeometry ) = 0;
+ AddGeometry( vtkDataSet* theGeometry, const VISU::TName& theGeomName ) = 0;
virtual
vtkDataSet*
- GetGeometry( int theGeomNumber ) = 0;
+ GetGeometry( int theGeomNumber, VISU::TName& theGeomName ) = 0;
virtual
int
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
+
+ virtual
+ void
+ AddGeometryName(const VISU::TName& theGeomName);
+
+ virtual
+ VISU::TName
+ GetGeometryName( int theGeomNumber ) const;
+
+ virtual
+ const VISU::TNames&
+ GetGeometryNames() const;
+
+ virtual
+ void
+ ClearGeometryNames();
+
+ VISU::TNames myGeometryNames;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_MeshPL.cxx
// Author: Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_MeshPL.hxx
// Author: Alexey PETROV
//----------------------------------------------------------------------------
class VISU_PIPELINE_EXPORT VISU_MeshPL : public VISU_PipeLine,
- public VISU_UnstructuredGridPL
+ public VISU_UnstructuredGridPL
{
public:
vtkTypeMacro(VISU_MeshPL, VISU_PipeLine);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_OpenGLPointSpriteMapper.cxx
// Author:
//
#include "VISU_OpenGLPointSpriteMapper.hxx"
-#include "SVTK_Extension.h"
+//#include "SVTK_Extension.h"
#include <vtkCamera.h>
#include <vtkCellArray.h>
this->PointSpriteMagnification = 1.0;
this->PointSpriteAlphaThreshold = 0.5;
+ this->PointSpriteOpacity = 1.0;
this->PointSpriteTexture = 0;
this->UseOpenGLMapper = false;
return;
this->PointSpriteClamp = theClamp;
+ this->Modified();
}
//-----------------------------------------------------------------------------
return;
this->AverageCellSize = theSize;
+ this->Modified();
}
//-----------------------------------------------------------------------------
return;
this->PointSpriteSize = theSize;
+ this->Modified();
}
//-----------------------------------------------------------------------------
return;
this->PointSpriteMinSize = theMinSize;
+ this->Modified();
}
//-----------------------------------------------------------------------------
return;
this->PointSpriteMaxSize = theMaxSize;
+ this->Modified();
}
//-----------------------------------------------------------------------------
return;
this->PointSpriteMagnification = theMagnification;
+ this->Modified();
}
//-----------------------------------------------------------------------------
return;
this->PointSpriteAlphaThreshold = theAlphaThreshold;
+ this->Modified();
}
//-----------------------------------------------------------------------------
if( this->ExtensionsInitialized )
return true;
- InitializeARB();
+ IsARBInitialized = InitializeARB();
char* ext = (char*)glGetString( GL_EXTENSIONS );
//cout << "OpenGL extensions : " << ext << endl;
glEnable( GL_POINT_SPRITE_ARB );
glEnable( GL_VERTEX_PROGRAM_POINT_SIZE_ARB );
+ glPushAttrib( GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT | GL_DEPTH_BUFFER_BIT | GL_ENABLE_BIT | GL_LIGHTING_BIT );
+
+ this->RenderMode = this->PointSpriteOpacity < 1.0 ? VISU_OpenGLPointSpriteMapper::Accumulate : VISU_OpenGLPointSpriteMapper::Occlude;
+
switch (this->RenderMode)
{
case VISU_OpenGLPointSpriteMapper::Accumulate:
{
- glDisable(GL_DEPTH_TEST);
+ glDepthFunc( GL_LESS );
+ glEnable( GL_DEPTH_TEST );
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE );
void VISU_OpenGLPointSpriteMapper::CleanupPointSprites()
{
// Set GL params back to normal to stop other vtkMappers displaying wrongly
- glDisable( GL_ALPHA_TEST );
-
- glEnable( GL_BLEND );
-
- glEnable( GL_DEPTH_TEST );
- glEnable( GL_LIGHTING );
- glEnable( GL_COLOR_MATERIAL );
+ glPopAttrib();
glDisable( GL_VERTEX_PROGRAM_POINT_SIZE_ARB );
glDisable( GL_POINT_SPRITE_ARB );
int* aSize = GetImageData()->GetDimensions();
unsigned char* dataPtr = (unsigned char*)GetImageData()->GetScalarPointer();
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, aSize[0], aSize[1], 0,
- GL_RGBA, GL_UNSIGNED_BYTE, dataPtr );
+ GL_RGBA, GL_UNSIGNED_BYTE, dataPtr );
//glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glEnable( GL_TEXTURE_2D );
//-----------------------------------------------------------------------------
template < class TCoordinates >
void DrawPoints( TCoordinates *theStartPoints,
- vtkCellArray *theCells,
- TColorFunctorBase* theColorFunctor,
- TVertex* theVertexArr,
- vtkIdType &theCellId,
- vtkIdType &theVertexId )
+ vtkCellArray *theCells,
+ TColorFunctorBase* theColorFunctor,
+ TVertex* theVertexArr,
+ vtkIdType &theCellId,
+ vtkIdType &theVertexId )
{
vtkIdType *ptIds = theCells->GetPointer();
vtkIdType *endPtIds = ptIds + theCells->GetNumberOfConnectivityEntries();
//-----------------------------------------------------------------------------
template < class TCoordinates >
void DrawCellsPoints( vtkPolyData *theInput,
- vtkPoints* thePoints,
- TColorFunctorBase* theColorFunctor,
- TVertex* theVertexArr )
+ vtkPoints* thePoints,
+ TColorFunctorBase* theColorFunctor,
+ TVertex* theVertexArr )
{
vtkIdType aCellId = 0, aVertexId = 0;
vtkPoints *points;
int noAbort = 1;
int cellScalars = 0;
- float tran;
-
- // get the transparency
- tran = theActor->GetProperty()->GetOpacity();
// if the primitives are invisable then get out of here
- if (tran <= 0.0)
+ if (this->PointSpriteOpacity <= 0.0)
{
return noAbort;
}
glPointSize( this->DefaultPointSize );
{
- TColorFunctorBase* aColorFunctor = NULL;
- if( colors && this->PointSpriteMode != 1 ) {
- if ( cellScalars )
- aColorFunctor = new TCellColors2Color( colors );
- else
- aColorFunctor = new TPointColors2Color( colors );
- } else {
- aColorFunctor = new TPropertyColor( theActor->GetProperty() );
- }
- if ( points->GetDataType() == VTK_FLOAT )
- ::DrawCellsPoints< float >( input, points, aColorFunctor, aVertexArr );
- else
- ::DrawCellsPoints< double >( input, points, aColorFunctor, aVertexArr );
-
- delete aColorFunctor;
+ TColorFunctorBase* aColorFunctor = NULL;
+ if( colors && this->PointSpriteMode != 1 ) {
+ if ( cellScalars )
+ aColorFunctor = new TCellColors2Color( colors );
+ else
+ aColorFunctor = new TPointColors2Color( colors );
+ } else {
+ aColorFunctor = new TPropertyColor( theActor->GetProperty() );
+ }
+ if ( points->GetDataType() == VTK_FLOAT )
+ ::DrawCellsPoints< float >( input, points, aColorFunctor, aVertexArr );
+ else
+ ::DrawCellsPoints< double >( input, points, aColorFunctor, aVertexArr );
+
+ delete aColorFunctor;
}
if( this->ExtensionsInitialized ) {
- GLuint aBufferObjectID = 0;
- vglGenBuffersARB( 1, &aBufferObjectID );
- vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID );
-
- int anArrayObjectSize = sizeof( TVertex ) * aTotalConnectivitySize;
- vglBufferDataARB( GL_ARRAY_BUFFER_ARB, anArrayObjectSize, aVertexArr, GL_STATIC_DRAW_ARB );
-
- delete [] aVertexArr;
-
- vglBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 );
- vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID );
-
- glColorPointer( 4, GL_FLOAT, sizeof(TVertex), (void*)0 );
- glVertexPointer( 3, GL_FLOAT, sizeof(TVertex), (void*)(4*sizeof(GLfloat)) );
-
- glEnableClientState( GL_VERTEX_ARRAY );
- glEnableClientState( GL_COLOR_ARRAY );
-
- glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize );
-
- glDisableClientState( GL_COLOR_ARRAY );
- glDisableClientState( GL_VERTEX_ARRAY );
-
- vglDeleteBuffersARB( 1, &aBufferObjectID );
+ GLuint aBufferObjectID = 0;
+ vglGenBuffersARB( 1, &aBufferObjectID );
+ vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID );
+
+ int anArrayObjectSize = sizeof( TVertex ) * aTotalConnectivitySize;
+ vglBufferDataARB( GL_ARRAY_BUFFER_ARB, anArrayObjectSize, aVertexArr, GL_STATIC_DRAW_ARB );
+
+ delete [] aVertexArr;
+
+ vglBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 );
+ vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID );
+
+ glColorPointer( 4, GL_FLOAT, sizeof(TVertex), (void*)0 );
+ glVertexPointer( 3, GL_FLOAT, sizeof(TVertex), (void*)(4*sizeof(GLfloat)) );
+
+ glEnableClientState( GL_VERTEX_ARRAY );
+ glEnableClientState( GL_COLOR_ARRAY );
+
+ glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize );
+
+ glDisableClientState( GL_COLOR_ARRAY );
+ glDisableClientState( GL_VERTEX_ARRAY );
+
+ vglDeleteBuffersARB( 1, &aBufferObjectID );
} else { // there are not extensions
- glColorPointer( 4, GL_FLOAT, sizeof(TVertex), aVertexArr );
- glVertexPointer( 3, GL_FLOAT, sizeof(TVertex),
- (void*)((GLfloat*)((void*)(aVertexArr)) + 4));
-
- glEnableClientState( GL_VERTEX_ARRAY );
- glEnableClientState( GL_COLOR_ARRAY );
-
- glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize );
-
- glDisableClientState( GL_COLOR_ARRAY );
- glDisableClientState( GL_VERTEX_ARRAY );
-
- delete [] aVertexArr;
+ glColorPointer( 4, GL_FLOAT, sizeof(TVertex), aVertexArr );
+ glVertexPointer( 3, GL_FLOAT, sizeof(TVertex),
+ (void*)((GLfloat*)((void*)(aVertexArr)) + 4));
+
+ glEnableClientState( GL_VERTEX_ARRAY );
+ glEnableClientState( GL_COLOR_ARRAY );
+
+ glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize );
+
+ glDisableClientState( GL_COLOR_ARRAY );
+ glDisableClientState( GL_VERTEX_ARRAY );
+
+ delete [] aVertexArr;
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_OpenGLPointSpriteMapper.hxx
// Author:
//! Get Point Sprite AlphaThreshold.
vtkGetMacro(PointSpriteAlphaThreshold, float);
+ //! Set Point Sprite Opacity
+ vtkSetMacro(PointSpriteOpacity, float);
+
+ //! Get Point Sprite Opacity
+ vtkGetMacro(PointSpriteOpacity, float);
+
//! Set ImageData for Point Sprite Texture.
void SetImageData(vtkImageData* theImageData);
GLuint PointSpriteTexture;
float PointSpriteAlphaThreshold;
+ float PointSpriteOpacity;
float AverageCellSize;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: VISU_ScalarMapPL.cxx
// Author: Roman NIKOLAEV
// Module : VISU
#include <vtkDataSet.h>
#include <vtkPassThroughFilter.h>
#include <vtkWarpVector.h>
-#include <vtkCellDataToPointData.h>
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_OptionalDeformationPL.hxx
// Author :
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.cxx
// Author: Alexey PETROV
myIsFeatureEdgesAllowed(true)
{
if(MYDEBUG) MESSAGE("VISU_PipeLine::VISU_PipeLine - "<<this);
+
+ vtkMath::UninitializeBounds(myVisibleBounds);
}
void
VISU_PipeLine
::ShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
SetImplicitFunction(thePipeLine->GetImplicitFunction());
DoShallowCopy(thePipeLine, theIsCopyInput);
void
VISU_PipeLine
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
GetMapperHolder()->ShallowCopy(thePipeLine->GetMapperHolder(),
- theIsCopyInput);
+ theIsCopyInput);
+ for( int i =0 ; i < 6 ; i++)
+ myVisibleBounds[i] = thePipeLine->myVisibleBounds[i];
+
+ myVisibleComputeTime = thePipeLine->myVisibleComputeTime;
}
void
VISU_PipeLine
::SetPlaneParam(vtkFloatingPointType theDir[3],
- vtkFloatingPointType theDist,
- vtkPlane* thePlane)
+ vtkFloatingPointType theDist,
+ vtkPlane* thePlane)
{
thePlane->SetNormal(theDir);
vtkFloatingPointType anOrigin[3];
- VISU::DistanceToPosition(GetInput(),
- theDir,
- theDist,
- anOrigin);
+
+ //Make sure that bounds are calculated
+ ComputeVisibleBounds();
+ VISU::DistanceToPosition(myVisibleBounds,
+ theDir,
+ theDist,
+ anOrigin);
thePlane->SetOrigin(anOrigin);
}
void
VISU_PipeLine
::GetPlaneParam(vtkFloatingPointType theDir[3],
- vtkFloatingPointType& theDist,
- vtkPlane* thePlane)
+ vtkFloatingPointType& theDist,
+ vtkPlane* thePlane)
{
thePlane->GetNormal(theDir);
-
+
vtkFloatingPointType anOrigin[3];
thePlane->GetOrigin(anOrigin);
-
- VISU::PositionToDistance(GetInput(),
- theDir,
- anOrigin,
- theDist);
+
+ //Make sure that bounds are calculated
+ ComputeVisibleBounds();
+ VISU::PositionToDistance(myVisibleBounds,
+ theDir,
+ anOrigin,
+ theDist);
}
try{
size_t aSize = size_t(theSize);
if(char *aCheck = new char[aSize]){
- delete [] aCheck;
- return aSize;
+ delete [] aCheck;
+ return aSize;
}
}catch(std::bad_alloc& exc){
}catch(...){
//----------------------------------------------------------------------------
size_t
VISU_PipeLine
-::GetAvailableMemory(size_t theSize,
- size_t theMinSize)
+::GetAvailableMemory(double theSize,
+ double theMinSize)
{
// Finds acceptable memory size by half-deflection methods
static double EPSILON = 2 * 1024;
}
+//----------------------------------------------------------------------------
+// Re-compute visible bounds if need
+void VISU_PipeLine::ComputeVisibleBounds() {
+ if(GetMTime() > myVisibleComputeTime) {
+ VISU::ComputeVisibleBounds(GetMapperHolder()->GetOutput(), myVisibleBounds);
+ myVisibleComputeTime.Modified();
+ }
+}
+
+//----------------------------------------------------------------------------
+void VISU_PipeLine::GetVisibleBounds(vtkFloatingPointType theBounds[6]) {
+ // Compute or get cached bounds
+ ComputeVisibleBounds();
+ for (int i=0; i<6; i++) {
+ theBounds[i] = myVisibleBounds[i];
+ }
+}
+
//----------------------------------------------------------------------------
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.hxx
// Author: Alexey PETROV
class vtkDataSet;
class vtkPointSet;
class vtkImplicitFunction;
+class vtkTimeStamp;
class VISU_MapperHolder;
virtual
void
ShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
virtual
void
virtual
void
SetPlaneParam(vtkFloatingPointType theDir[3],
- vtkFloatingPointType theDist,
- vtkPlane* thePlane);
+ vtkFloatingPointType theDist,
+ vtkPlane* thePlane);
virtual
void
GetPlaneParam(vtkFloatingPointType theDir[3],
- vtkFloatingPointType& theDist,
- vtkPlane* thePlane);
+ vtkFloatingPointType& theDist,
+ vtkPlane* thePlane);
+
+ void
+ GetVisibleBounds(vtkFloatingPointType theBounds[6]);
//----------------------------------------------------------------------------
static
static
size_t
- GetAvailableMemory(size_t theSize,
- size_t theMinSize = 1024*1024);
+ GetAvailableMemory(double theSize,
+ double theMinSize = 1024*1024);
protected:
//----------------------------------------------------------------------------
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
+
+ virtual
+ void
+ ComputeVisibleBounds();
//----------------------------------------------------------------------------
vtkDataSet*
void
SetIsFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
+
+ //Visible bounds xmin, xmax, ymin, ymax, zmin, zmax
+ vtkFloatingPointType myVisibleBounds[6];
+ vtkTimeStamp myVisibleComputeTime; // Time at which visible bounds computed
private:
//----------------------------------------------------------------------------
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.hxx
// Author: Alexey PETROV
#include "VISU_OpenGLPointSpriteMapper.hxx"
+#include <vtkCell.h>
#include <vtkDataSetMapper.h>
#include <vtkPolyDataMapper.h>
//----------------------------------------------------------------------------
void
Sub(const vtkFloatingPointType A[3],
- const vtkFloatingPointType B[3],
- vtkFloatingPointType C[3])
+ const vtkFloatingPointType B[3],
+ vtkFloatingPointType C[3])
{ //A-B
for(int i = 0; i < 3; i++)
C[i] = A[i] - B[i];
//----------------------------------------------------------------------------
bool
CheckIsSameValue(vtkFloatingPointType theTarget,
- vtkFloatingPointType theSource)
+ vtkFloatingPointType theSource)
{
static vtkFloatingPointType TOL = 10.0 / VTK_LARGE_FLOAT;
if(fabs(theTarget - theSource) < TOL)
//----------------------------------------------------------------------------
bool
CheckIsSameRange(vtkFloatingPointType* theTarget,
- vtkFloatingPointType* theSource)
+ vtkFloatingPointType* theSource)
{
return CheckIsSameValue(theTarget[0], theSource[0]) &&
CheckIsSameValue(theTarget[1], theSource[1]);
//----------------------------------------------------------------------------
void
CopyMapper(vtkMapper* theTarget,
- vtkMapper* theSource,
- bool theIsCopyInput)
+ vtkMapper* theSource,
+ bool theIsCopyInput)
{
// To customize vtkMapper::ShallowCopy ...
theTarget->SetLookupTable(theSource->GetLookupTable());
if(theIsCopyInput){
vtkFloatingPointType* aScalarRange = theSource->GetScalarRange();
if(!CheckIsSameRange(theTarget->GetScalarRange(), aScalarRange))
- theTarget->SetScalarRange(aScalarRange);
+ theTarget->SetScalarRange(aScalarRange);
}
theTarget->SetColorMode(theSource->GetColorMode());
theTarget->SetScalarMode(theSource->GetScalarMode());
//----------------------------------------------------------------------------
void
CopyDataSetMapper(vtkDataSetMapper* theTarget,
- vtkDataSetMapper* theSource,
- bool theIsCopyInput)
+ vtkDataSetMapper* theSource,
+ bool theIsCopyInput)
{
// To customize vtkDataSetMapper::ShallowCopy ...
//theTarget->SetInput(theSource->GetInput());
//----------------------------------------------------------------------------
void
CopyPolyDataMapper(vtkPolyDataMapper* theTarget,
- vtkPolyDataMapper* theSource,
- bool theIsCopyInput)
+ vtkPolyDataMapper* theSource,
+ bool theIsCopyInput)
{
// To customize vtkPolyDataMapper::ShallowCopy ...
//theTarget->SetInput(theSource->GetInput());
//----------------------------------------------------------------------------
void
CopyPointSpriteDataMapper(VISU_OpenGLPointSpriteMapper* theTarget,
- VISU_OpenGLPointSpriteMapper* theSource,
- bool theIsCopyInput)
+ VISU_OpenGLPointSpriteMapper* theSource,
+ bool theIsCopyInput)
{
// To customize VISU_OpenGLPointSpriteMapper::ShallowCopy ...
theTarget->SetPrimitiveType( theSource->GetPrimitiveType() );
//----------------------------------------------------------------------------
void
- ComputeBoundsParam(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3],
- vtkFloatingPointType theMinPnt[3],
- vtkFloatingPointType& theMaxBoundPrj,
- vtkFloatingPointType& theMinBoundPrj)
+ ComputeBoundsParam(vtkFloatingPointType theBounds[6],
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType theMinPnt[3],
+ vtkFloatingPointType& theMaxBoundPrj,
+ vtkFloatingPointType& theMinBoundPrj)
{
vtkFloatingPointType aBounds[6];
- theDataSet->GetBounds(aBounds);
+ for(int i = 0; i < 6; i++)
+ aBounds[i] = theBounds[i];
//Enlarge bounds in order to avoid conflicts of precision
for(int i = 0; i < 6; i += 2){
}
vtkFloatingPointType aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]},
- {aBounds[1],aBounds[2],aBounds[4]},
- {aBounds[0],aBounds[3],aBounds[4]},
- {aBounds[1],aBounds[3],aBounds[4]},
- {aBounds[0],aBounds[2],aBounds[5]},
- {aBounds[1],aBounds[2],aBounds[5]},
- {aBounds[0],aBounds[3],aBounds[5]},
- {aBounds[1],aBounds[3],aBounds[5]}};
+ {aBounds[1],aBounds[2],aBounds[4]},
+ {aBounds[0],aBounds[3],aBounds[4]},
+ {aBounds[1],aBounds[3],aBounds[4]},
+ {aBounds[0],aBounds[2],aBounds[5]},
+ {aBounds[1],aBounds[2],aBounds[5]},
+ {aBounds[0],aBounds[3],aBounds[5]},
+ {aBounds[1],aBounds[3],aBounds[5]}};
int aMaxId = 0, aMinId = aMaxId;
theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]);
for(int i = 1; i < 8; i++){
vtkFloatingPointType aTmp = vtkMath::Dot(theDirection,aBoundPoints[i]);
if(theMaxBoundPrj < aTmp){
- theMaxBoundPrj = aTmp;
- aMaxId = i;
+ theMaxBoundPrj = aTmp;
+ aMaxId = i;
}
if(theMinBoundPrj > aTmp){
- theMinBoundPrj = aTmp;
- aMinId = i;
+ theMinBoundPrj = aTmp;
+ aMinId = i;
}
}
vtkFloatingPointType *aMinPnt = aBoundPoints[aMaxId];
//----------------------------------------------------------------------------
void
- DistanceToPosition(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3],
- vtkFloatingPointType theDist,
- vtkFloatingPointType thePos[3])
+ DistanceToPosition(vtkFloatingPointType theBounds[6],
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType theDist,
+ vtkFloatingPointType thePos[3])
{
vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
- ComputeBoundsParam(theDataSet,
- theDirection,
- aMinPnt,
- aMaxBoundPrj,
- aMinBoundPrj);
+ ComputeBoundsParam(theBounds,
+ theDirection,
+ aMinPnt,
+ aMaxBoundPrj,
+ aMinBoundPrj);
vtkFloatingPointType aLength = (aMaxBoundPrj-aMinBoundPrj)*theDist;
thePos[0] = aMinPnt[0] - theDirection[0] * aLength;
thePos[1] = aMinPnt[1] - theDirection[1] * aLength;
//----------------------------------------------------------------------------
void
- PositionToDistance(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3],
- vtkFloatingPointType thePos[3],
- vtkFloatingPointType& theDist)
+ PositionToDistance(vtkFloatingPointType theBounds[6],
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType thePos[3],
+ vtkFloatingPointType& theDist)
{
vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
- ComputeBoundsParam(theDataSet,
- theDirection,
- aMinPnt,
- aMaxBoundPrj,
- aMinBoundPrj);
+ ComputeBoundsParam(theBounds,
+ theDirection,
+ aMinPnt,
+ aMaxBoundPrj,
+ aMinBoundPrj);
vtkFloatingPointType aPrj = vtkMath::Dot(theDirection,thePos);
theDist = (aPrj-aMinBoundPrj)/(aMaxBoundPrj-aMinBoundPrj);
}
-
+
+ //----------------------------------------------------------------------------
+ bool
+ IsQuadraticData(vtkDataSet* theDataSet)
+ {
+ for(int i = 0, n = theDataSet->GetNumberOfCells(); i < n; i++)
+ if(vtkCell* aCell = theDataSet->GetCell(i))
+ if(!aCell->IsLinear())
+ return true;
+ return false;
+ }
//----------------------------------------------------------------------------
+ //Compute bounds of the visible part of the dataset
+ void
+ ComputeVisibleBounds(vtkDataSet* theDataSet, vtkFloatingPointType theBounds[6]) {
+ int nbCells, i, j, minIdx, maxIdx;
+ vtkFloatingPointType cellBounds[6];
+
+ if( theDataSet && (nbCells = theDataSet->GetNumberOfCells()) ) {
+ theDataSet->GetCellBounds(0,theBounds);
+ for ( i = 1; i < nbCells; i++ ) {
+ theDataSet->GetCellBounds(i, cellBounds);
+ for ( j = 0; j < 3; j++ ) {
+ minIdx = 2*j;
+ maxIdx = 2*j+1;
+ if ( cellBounds[minIdx] < theBounds[minIdx] ) {
+ theBounds[minIdx] = cellBounds[minIdx];
+ }
+ if ( cellBounds[maxIdx] > theBounds[maxIdx] ) {
+ theBounds[maxIdx] = cellBounds[maxIdx];
+ }
+ }
+ }
+ } else {
+ vtkMath::UninitializeBounds(theBounds);
+ }
+ }
+
+ //----------------------------------------------------------------------------
+ //Compute center of the box, box defined as xmin, xmax, ymin, ymax, zmin, zmax
+ void
+ ComputeBoxCenter(vtkFloatingPointType theBounds[6], vtkFloatingPointType theCenter[3]) {
+ for (int i=0; i<3; i++) {
+ theCenter[i] = (theBounds[2*i+1] + theBounds[2*i]) / 2.0;
+ }
+ }
+
+ //----------------------------------------------------------------------------
+ //Compute length of the box diagonal, box defined as xmin, xmax, ymin, ymax, zmin, zmax
+ double
+ ComputeBoxDiagonal(vtkFloatingPointType theBounds[6]) {
+ double diff, len=0.0;
+ int i;
+ for (i=0; i<3; i++) {
+ diff = (double)(theBounds[2*i+1]) - (double)(theBounds[2*i]);
+ len += diff * diff;
+ }
+ diff = sqrt(len);
+ return diff;
+ }
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.hxx
// Author: Alexey PETROV
#include "VISUPipeline.hxx"
#include "VISU_ConvertorUtils.hxx"
+#include "VISU_CellDataToPointData.hxx"
#include <vtkProperty.h>
#include <vtkObjectFactory.h>
#include <vtkDataSetMapper.h>
#include <vtkUnstructuredGrid.h>
-#include <vtkCellDataToPointData.h>
-#include <vtkCellCenters.h>
#include <vtkPointData.h>
#include <vtkCellData.h>
#include <vtkPolyData.h>
template<class TOutputFilter>
void
CellDataToPoint(TOutputFilter* theOutputFilter,
- vtkCellDataToPointData *theCellDataToPointData,
- vtkDataSet* theDataSet)
+ VISU_CellDataToPointData *theCellDataToPointData,
+ vtkDataSet* theDataSet)
{
if(VISU::IsDataOnCells(theDataSet)){
//! Checks whether the float values are the same or not
bool VISU_PIPELINE_EXPORT
CheckIsSameValue(vtkFloatingPointType theTarget,
- vtkFloatingPointType theSource);
+ vtkFloatingPointType theSource);
//! Checks whether the scalar range is the same or not
bool VISU_PIPELINE_EXPORT
CheckIsSameRange(vtkFloatingPointType* theTarget,
- vtkFloatingPointType* theSource);
+ vtkFloatingPointType* theSource);
//! Customizes vtkMapper::ShallowCopy
void VISU_PIPELINE_EXPORT
CopyMapper(vtkMapper* theTarget,
- vtkMapper* theSource,
- bool theIsCopyInput);
+ vtkMapper* theSource,
+ bool theIsCopyInput);
//! Customizes vtkDataSetMapper::ShallowCopy
void VISU_PIPELINE_EXPORT
CopyDataSetMapper(vtkDataSetMapper* theTarget,
- vtkDataSetMapper* theSource,
- bool theIsCopyInput);
+ vtkDataSetMapper* theSource,
+ bool theIsCopyInput);
//! Customizes vtkPolyDataMapper::ShallowCopy
void VISU_PIPELINE_EXPORT
CopyPolyDataMapper(vtkPolyDataMapper* theTarget,
- vtkPolyDataMapper* theSource,
- bool theIsCopyInput);
+ vtkPolyDataMapper* theSource,
+ bool theIsCopyInput);
//! Customizes VISU_OpenGLPointSpriteMapper::ShallowCopy
void VISU_PIPELINE_EXPORT
CopyPointSpriteDataMapper(VISU_OpenGLPointSpriteMapper* theTarget,
- VISU_OpenGLPointSpriteMapper* theSource,
- bool theIsCopyInput);
+ VISU_OpenGLPointSpriteMapper* theSource,
+ bool theIsCopyInput);
//----------------------------------------------------------------------------
void VISU_PIPELINE_EXPORT
- ComputeBoundsParam(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3],
- vtkFloatingPointType theMinPnt[3],
- vtkFloatingPointType& theMaxBoundPrj,
- vtkFloatingPointType& theMinBoundPrj);
+ ComputeBoundsParam(vtkFloatingPointType theBounds[6],
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType theMinPnt[3],
+ vtkFloatingPointType& theMaxBoundPrj,
+ vtkFloatingPointType& theMinBoundPrj);
//----------------------------------------------------------------------------
void VISU_PIPELINE_EXPORT
- DistanceToPosition(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3],
- vtkFloatingPointType theDist,
- vtkFloatingPointType thePos[3]);
+ DistanceToPosition(vtkFloatingPointType theBounds[6],
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType theDist,
+ vtkFloatingPointType thePos[3]);
+
+
+ //----------------------------------------------------------------------------
+ void VISU_PIPELINE_EXPORT
+ PositionToDistance(vtkFloatingPointType theBounds[6],
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType thePos[3],
+ vtkFloatingPointType& theDist);
+
+
+ //----------------------------------------------------------------------------
+ bool VISU_PIPELINE_EXPORT
+ IsQuadraticData(vtkDataSet* theDataSet);
+ //----------------------------------------------------------------------------
+ void VISU_PIPELINE_EXPORT
+ ComputeVisibleBounds(vtkDataSet* theDataSet,
+ vtkFloatingPointType theBounds[6]);
//----------------------------------------------------------------------------
void VISU_PIPELINE_EXPORT
- PositionToDistance(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3],
- vtkFloatingPointType thePos[3],
- vtkFloatingPointType& theDist);
+ ComputeBoxCenter(vtkFloatingPointType theBounds[6], vtkFloatingPointType theCenter[3]);
+
+ //----------------------------------------------------------------------------
+ double VISU_PIPELINE_EXPORT
+ ComputeBoxDiagonal(vtkFloatingPointType theBounds[6]);
+
}
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : VVTK_ImplicitFunctionWidget.cxx
// Author : Peter KURNEV
#include <vtkCamera.h>
#include <vtkCellPicker.h>
#include <vtkConeSource.h>
-#include <vtkCutter.h>
+#include <vtkEDFCutter.h>
#include <vtkFeatureEdges.h>
#include <vtkImageData.h>
#include <vtkLineSource.h>
static
bool
IsValidPlane2Position(vtkPlane *pPx,
- vtkDataSet *pDataSet,
- vtkFloatingPointType aTol=0.003);
+ vtkDataSet *pDataSet,
+ vtkFloatingPointType aTol=0.003);
static
void
GetBndPoints(vtkDataSet *pDataSet,
- vtkFloatingPointType aPnts[24]);
+ vtkFloatingPointType aPnts[24]);
static
vtkFloatingPointType
DistanceToPlane(const vtkFloatingPointType x[3],
- const vtkFloatingPointType n[3],
- const vtkFloatingPointType p0[3]);
+ const vtkFloatingPointType n[3],
+ const vtkFloatingPointType p0[3]);
vtkCxxRevisionMacro(VISU_PlanesWidget, "$Revision$");
vtkStandardNewMacro(VISU_PlanesWidget);
this->myOutlineActor->PickableOff();
this->OutlineTranslation = 0;
- this->myCutter1 = vtkCutter::New();
+ this->myCutter1 = vtkEDFCutter::New();
this->myCutter1->SetInput(myBox);
this->myCutter1->SetCutFunction(myPlane1);
this->myCutMapper1 = vtkPolyDataMapper::New();
myEdgesActor1->GetProperty()->SetLineWidth(4.);
myEdgesActor1->GetProperty()->SetColor(0., .5, .7);
- this->myCutter2 = vtkCutter::New();
+ this->myCutter2 = vtkEDFCutter::New();
this->myCutter2->SetInput(myBox);
this->myCutter2->SetCutFunction(this->myPlane2);
this->myCutMapper2 = vtkPolyDataMapper::New();
vtkRenderWindowInteractor *i = this->Interactor;
if( this->HandleMoveEvent ) {
i->AddObserver(vtkCommand::MouseMoveEvent,
- this->EventCallbackCommand,
- this->Priority);
+ this->EventCallbackCommand,
+ this->Priority);
}
if( this->HandleLeftButtonEvent ) {
i->AddObserver(vtkCommand::LeftButtonPressEvent,
- this->EventCallbackCommand,
- this->Priority);
+ this->EventCallbackCommand,
+ this->Priority);
i->AddObserver(vtkCommand::LeftButtonReleaseEvent,
- this->EventCallbackCommand,
- this->Priority);
+ this->EventCallbackCommand,
+ this->Priority);
}
if( this->HandleMiddleButtonEvent ) {
i->AddObserver(vtkCommand::MiddleButtonPressEvent,
- this->EventCallbackCommand,
- this->Priority);
+ this->EventCallbackCommand,
+ this->Priority);
i->AddObserver(vtkCommand::MiddleButtonReleaseEvent,
- this->EventCallbackCommand,
- this->Priority);
+ this->EventCallbackCommand,
+ this->Priority);
}
if( this->HandleRightButtonEvent ) {
i->AddObserver(vtkCommand::RightButtonPressEvent,
- this->EventCallbackCommand,
- this->Priority);
+ this->EventCallbackCommand,
+ this->Priority);
i->AddObserver(vtkCommand::RightButtonReleaseEvent,
- this->EventCallbackCommand,
- this->Priority);
+ this->EventCallbackCommand,
+ this->Priority);
}
// add the outline
this->CurrentRenderer->AddActor(this->myOutlineActor);
// purpose :
//==================================================================
void VISU_PlanesWidget::ProcessEvents(vtkObject* vtkNotUsed(object),
- unsigned long event,
- void* clientdata,
- void* vtkNotUsed(calldata))
+ unsigned long event,
+ void* clientdata,
+ void* vtkNotUsed(calldata))
{
VISU_PlanesWidget* self =
reinterpret_cast<VISU_PlanesWidget *>( clientdata );
return;
}
- vtkProp *prop = path->GetFirstNode()->GetProp();
+ vtkProp *prop = path->GetFirstNode()->GetViewProp();
this->ValidPick = 1;
this->Picker->GetPickPosition(this->LastPickPosition);
//
// purpose :
//==================================================================
void VISU_PlanesWidget::Scale(double *p1, double *p2,
- int vtkNotUsed(X), int Y)
+ int vtkNotUsed(X), int Y)
{
//Get the motion vector
double v[3];
//
this->AdjustBounds(bds, bounds, origin);
this->SetOrigin((bounds[1]+bounds[0])/2.0,
- (bounds[3]+bounds[2])/2.0,
- (bounds[5]+bounds[4])/2.0);
+ (bounds[3]+bounds[2])/2.0,
+ (bounds[5]+bounds[4])/2.0);
static vtkFloatingPointType DIST_COEFF = 0.1;
SetDistance(this->InitialLength*DIST_COEFF);
for (i=0; i<24; i+=3){
aD=-DistanceToPlane(aPnts+i, aN, aOr);
if (aD>aDmax){
- aDmax=aD;
- iFound=1;
+ aDmax=aD;
+ iFound=1;
}
}
if (iFound && aDmax>aTol1) {
//==================================================================
void
GetBndPoints(vtkDataSet *pDataSet,
- vtkFloatingPointType aPnts[24])
+ vtkFloatingPointType aPnts[24])
{
int aIndx[24] = {
0,2,4,1,2,4,1,3,4,0,3,4,
//==================================================================
vtkFloatingPointType
DistanceToPlane(const vtkFloatingPointType x[3],
- const vtkFloatingPointType n[3],
- const vtkFloatingPointType p0[3])
+ const vtkFloatingPointType n[3],
+ const vtkFloatingPointType p0[3])
{
return ((n[0]*(x[0]-p0[0]) +
- n[1]*(x[1]-p0[1]) +
- n[2]*(x[2]-p0[2])));
+ n[1]*(x[1]-p0[1]) +
+ n[2]*(x[2]-p0[2])));
}
/*
//==================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : VISU_PlanesWidget.h
// Author : Peter KURNEV
class vtkLineSource;
class vtkSphereSource;
class vtkPlane;
-class vtkCutter;
+class vtkEDFCutter;
class vtkProperty;
class vtkImageData;
class vtkOutlineFilter;
// Get the origin of the plane.
void
SetOrigin(vtkFloatingPointType x,
- vtkFloatingPointType y,
- vtkFloatingPointType z);
+ vtkFloatingPointType y,
+ vtkFloatingPointType z);
void
SetOrigin(vtkFloatingPointType x[3]);
// Get the normal to the plane.
void
SetNormal(vtkFloatingPointType x,
- vtkFloatingPointType y,
- vtkFloatingPointType z);
+ vtkFloatingPointType y,
+ vtkFloatingPointType z);
void
SetNormal(vtkFloatingPointType x[3]);
static
void
ProcessEvents(vtkObject* object, unsigned long event,
- void* clientdata, void* calldata);
+ void* clientdata, void* calldata);
// ProcessEvents() dispatches to these methods.
void OnLeftButtonDown();
int OutlineTranslation; //whether the outline can be moved
- // The cut plane is produced with a vtkCutter
- vtkCutter *myCutter1;
+ // The cut plane is produced with a vtkEDFCutter
+ vtkEDFCutter *myCutter1;
vtkPolyDataMapper *myCutMapper1;
vtkActor *myCutActor1;
- vtkCutter *myCutter2;
+ vtkEDFCutter *myCutter2;
vtkPolyDataMapper *myCutMapper2;
vtkActor *myCutActor2;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.cxx
// Author: Alexey PETROV
#include "VISU_PipeLineUtils.hxx"
#include <vtkAppendPolyData.h>
-#include <vtkCutter.h>
+#include <vtkEDFCutter.h>
#include <vtkPlane.h>
-#include <vtkCellDataToPointData.h>
#include <vtkGeometryFilter.h>
#include <vtkContourFilter.h>
#include <vtkWarpScalar.h>
//----------------------------------------------------------------------------
VISU_Plot3DPL
::VISU_Plot3DPL():
- myCellDataToPointData(vtkCellDataToPointData::New()),
+ myCellDataToPointData(VISU_CellDataToPointData::New()),
myAppendPolyData(vtkAppendPolyData::New()),
myGeometryFilter(vtkGeometryFilter::New()),
myContourFilter(vtkContourFilter::New()),
void
VISU_Plot3DPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
vtkFloatingPointType
VISU_Plot3DPL
::GetScaleFactor( VISU_ColoredPL* theColoredPL,
- vtkDataSet* theDataSet )
+ vtkDataSet* theDataSet )
{
theDataSet->Update();
vtkFloatingPointType aLength = theDataSet->GetLength(); // diagonal length
VISU_Plot3DPL
::Update()
{
+ vtkDataSet* aMergedInput = GetMergedInput();
+ if(VISU::IsQuadraticData(aMergedInput)) // Bug 0020123, note 0005343
+ throw std::runtime_error("Impossible to build presentation");
+
vtkFloatingPointType aPlaneNormal[3];
vtkFloatingPointType anOrigin[3];
GetBasePlane( anOrigin, aPlaneNormal );
vtkPolyData* aPolyData = 0;
- vtkCutter *aCutPlane = 0;
- vtkDataSet* aDataSet = GetMergedInput();
+ vtkEDFCutter *aCutPlane = 0;
if ( !IsPlanarInput() )
{
- aCutPlane = vtkCutter::New();
- aCutPlane->SetInput(aDataSet);
+ aCutPlane = vtkEDFCutter::New();
+ aCutPlane->SetInput(aMergedInput);
vtkPlane *aPlane = vtkPlane::New();
aPlane->SetOrigin(anOrigin);
}
if ( !aPolyData || aPolyData->GetNumberOfCells() == 0 ) {
- myGeometryFilter->SetInput(aDataSet);
+ myGeometryFilter->SetInput(aMergedInput);
aPolyData = myGeometryFilter->GetOutput();
aPolyData->Update();
}
void
VISU_Plot3DPL
::SetPlanePosition(vtkFloatingPointType thePosition,
- bool theIsRelative)
+ bool theIsRelative)
{
bool anIsSameValue = VISU::CheckIsSameValue(myIsRelative, theIsRelative);
anIsSameValue &= (myPosition == thePosition);
void
VISU_Plot3DPL::
SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
- vtkFloatingPointType theXAngle,
- vtkFloatingPointType theYAngle)
+ vtkFloatingPointType theXAngle,
+ vtkFloatingPointType theYAngle)
{
bool anIsSameValue = VISU::CheckIsSameValue(GetRotateX(), theXAngle);
anIsSameValue &= VISU::CheckIsSameValue(GetRotateY(), theYAngle);
void
VISU_Plot3DPL
::GetBasePlane(vtkFloatingPointType theOrigin[3],
- vtkFloatingPointType theNormal[3],
- bool theCenterOrigine )
+ vtkFloatingPointType theNormal[3],
+ bool theCenterOrigine )
{
VISU_CutPlanesPL::GetDir(theNormal,myAngle,myOrientation);
void
VISU_Plot3DPL
::GetMinMaxPosition( vtkFloatingPointType& minPos,
- vtkFloatingPointType& maxPos )
+ vtkFloatingPointType& maxPos )
{
vtkFloatingPointType aBounds[6], aBoundPrj[3], aNormal[3];
VISU_CutPlanesPL::GetDir(aNormal,myAngle,myOrientation);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_CutPlanesPL.hxx
// Author: Alexey PETROV
class vtkWarpScalar;
class vtkContourFilter;
class vtkGeometryFilter;
-class vtkCellDataToPointData;
+class VISU_CellDataToPointData;
//----------------------------------------------------------------------------
void
SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
- vtkFloatingPointType theXAngle = 0.0,
- vtkFloatingPointType theYAngle = 0.0);
+ vtkFloatingPointType theXAngle = 0.0,
+ vtkFloatingPointType theYAngle = 0.0);
vtkFloatingPointType
GetPlanePosition();
void
SetPlanePosition(vtkFloatingPointType thePosition,
- bool theIsRelative);
+ bool theIsRelative);
void
SetScaleFactor(vtkFloatingPointType theScaleFactor);
void
GetBasePlane (vtkFloatingPointType theOrigin[3],
- vtkFloatingPointType theNormal[3],
- bool theCenterOrigine = false );
+ vtkFloatingPointType theNormal[3],
+ bool theCenterOrigine = false );
void
GetMinMaxPosition( vtkFloatingPointType& minPos,
- vtkFloatingPointType& maxPos );
+ vtkFloatingPointType& maxPos );
public:
virtual
static
vtkFloatingPointType
GetScaleFactor( VISU_ColoredPL* theColoredPL,
- vtkDataSet* theDataSet );
+ vtkDataSet* theDataSet );
void
SetMapScale(vtkFloatingPointType theMapScale);
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
vtkFloatingPointType myAngle[3];
bool myIsRelative, myIsContour;
vtkFloatingPointType myPosition, myScaleFactor, myMapScaleFactor;
VISU_CutPlanesPL::PlaneOrientation myOrientation;
- vtkSmartPointer<vtkCellDataToPointData> myCellDataToPointData;
+ vtkSmartPointer<VISU_CellDataToPointData> myCellDataToPointData;
vtkSmartPointer<vtkAppendPolyData> myAppendPolyData;
vtkSmartPointer<vtkGeometryFilter> myGeometryFilter;
vtkSmartPointer<vtkContourFilter> myContourFilter;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PointSpriteMapperHolder.cxx
// Author: Alexey PETROV
void
VISU_PointSpriteMapperHolder
::ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
if(VISU_PointSpriteMapperHolder* aMapperHolder = dynamic_cast<VISU_PointSpriteMapperHolder*>(theMapperHolder)){
if(theIsCopyInput)
SetGaussPtsIDMapper(aMapperHolder->GetGaussPtsIDMapper());
VISU::CopyPointSpriteDataMapper(GetPointSpriteMapper(),
- aMapperHolder->GetPointSpriteMapper(),
- theIsCopyInput);
+ aMapperHolder->GetPointSpriteMapper(),
+ theIsCopyInput);
myExtractPolyDataGeometry->SetImplicitFunction(aMapperHolder->GetImplicitFunction());
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PointSpriteMapperHolder.hxx
// Author: Alexey PETROV
virtual
void
ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput);
+ bool theIsCopyInput);
//----------------------------------------------------------------------------
void
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PolyDataMapperHolder.cxx
// Author: Alexey PETROV
void
VISU_PolyDataMapperHolder
::ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
if(VISU_PolyDataMapperHolder* aMapperHolder = dynamic_cast<VISU_PolyDataMapperHolder*>(theMapperHolder)){
if(theIsCopyInput)
SetPolyDataIDMapper(aMapperHolder->GetPolyDataIDMapper());
VISU::CopyPolyDataMapper(GetPolyDataMapper(),
- aMapperHolder->GetPolyDataMapper(),
- theIsCopyInput);
+ aMapperHolder->GetPolyDataMapper(),
+ theIsCopyInput);
myExtractPolyDataGeometry->SetImplicitFunction(aMapperHolder->GetImplicitFunction());
}
}
vtkImplicitFunction* aFun = NULL;
aFunction->InitTraversal();
for(vtkIdType anID = 0; anID <= theID; anID++)
- aFun = aFunction->GetNextItem();
+ aFun = aFunction->GetNextItem();
aPlane = dynamic_cast<vtkPlane*>(aFun);
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PolyDataMapperHolder.hxx
// Author: Alexey PETROV
virtual
void
ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput);
+ bool theIsCopyInput);
//! Gets memory size used by the instance (bytes).
virtual
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PolyDataPL.cxx
// Author: Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_UnstructuredGripPL.hxx
// Author: Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.hxx
// Author: Alexey PETROV
// RKV : Begin
// If the distribution is changed then recalculate the total
if (this->Distribution->GetMTime() > this->BuildTime) {
- int aNbVals = this->Distribution->GetNumberOfTuples();
+ int aNbVals = this->Distribution->GetNumberOfTuples();
double range[2];
this->Distribution->GetRange(range);
this->DistributionActor->SetYRange(0, range[1]);
-/* int total = 0;
- for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){
- total += this->Distribution->GetValue(aValId);
- }
- this->DistributionActor->SetYRange(0, total);
+/* int total = 0;
+ for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){
+ total += this->Distribution->GetValue(aValId);
+ }
+ this->DistributionActor->SetYRange(0, total);
*/
}
if(LabelRatioWidth == 0)
if ( this->Orientation == VTK_ORIENT_VERTICAL )
- targetWidth = (int)(0.6*size[0]);
- else
- targetWidth = (int)(size[0]*0.8/this->NumberOfLabels);
+ targetWidth = (int)(0.6*size[0]);
+ else
+ targetWidth = (int)(size[0]*0.8/this->NumberOfLabels);
else
targetWidth = (int)(0.01*LabelRatioWidth*size[0]);
{
this->DistributionVisibility = v;
if (v) {
- this->DistributionActor->VisibilityOn();
+ this->DistributionActor->VisibilityOn();
} else {
- this->DistributionActor->VisibilityOff();
+ this->DistributionActor->VisibilityOff();
}
}
// int total = 0;
if (this->GetDebug()) {
for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){
-// if (this->GetDebug()) {
- if (this->Distribution->GetValue(aValId) > 0)
- vtkDebugMacro(<< "D(" << aValId << ") = " << this->Distribution->GetValue(aValId));
-// }
-// total += this->Distribution->GetValue(aValId);
+// if (this->GetDebug()) {
+ if (this->Distribution->GetValue(aValId) > 0)
+ vtkDebugMacro(<< "D(" << aValId << ") = " << this->Distribution->GetValue(aValId));
+// }
+// total += this->Distribution->GetValue(aValId);
}
}
// this->DistributionActor->SetYRange(0, total);
}
void VISU_ScalarBarActor::DebugOn() {
- this->DistributionActor->DebugOn();
- Superclass::DebugOn();
+ this->DistributionActor->DebugOn();
+ Superclass::DebugOn();
}
void VISU_ScalarBarActor::DebugOff() {
- this->DistributionActor->DebugOff();
- Superclass::DebugOff();
+ this->DistributionActor->DebugOff();
+ Superclass::DebugOff();
}
// RKV : End
void VISU_ScalarBarActor::SetRatios(int titleRatioSize, int labelRatioWidth,
- int barRatioWidth, int barRatioHeight)
+ int barRatioWidth, int barRatioHeight)
{
TitleRatioSize=titleRatioSize;
if(TitleRatioSize>100)
}
void VISU_ScalarBarActor::SizeBar(int& barSizeWidth, int& barSizeHeight, int *size,
- vtkViewport *viewport, vtkFloatingPointType *range)
+ vtkViewport *viewport, vtkFloatingPointType *range)
{
if(BarRatioWidth == 0)
if ( this->Orientation == VTK_ORIENT_VERTICAL )
{
- int labelSize[2];
- this->AllocateAndSizeLabels(labelSize, size, viewport,range);
- barSizeWidth = size[0] - 4 - labelSize[0];
+ int labelSize[2];
+ this->AllocateAndSizeLabels(labelSize, size, viewport,range);
+ barSizeWidth = size[0] - 4 - labelSize[0];
} else
- barSizeWidth = size[0];
+ barSizeWidth = size[0];
else
barSizeWidth = (int)(0.01*BarRatioWidth*size[0]);
if ( this->Orientation == VTK_ORIENT_VERTICAL ) {
// Position the distribution curve vertically
if (u > 0.5) {
- // X - UP, Y - TO THE LEFT
- this->DistributionActor->SetPlotLocation(VISU_XYPLOT_RIGHT);
- // Curve to be placed on the left side of the bar
+ // X - UP, Y - TO THE LEFT
+ this->DistributionActor->SetPlotLocation(VISU_XYPLOT_RIGHT);
+ // Curve to be placed on the left side of the bar
vtkDebugMacro(<< "Curve to be placed on the left side of the bar");
// relative to the bar origin
- u = 0;
- v = 0;
+ u = 0;
+ v = 0;
viewport->ViewportToNormalizedViewport(u, v);
vtkDebugMacro(<< "u=" << u << "; v=" << v);
this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0);
vtkDebugMacro("u2=" << u << "; v2=" << v);
this->DistributionActor->GetPosition2Coordinate()->SetValue(u, v, 0);
} else {
- // X - UP, Y - TO THE RIGHT
- this->DistributionActor->SetPlotLocation(VISU_XYPLOT_LEFT);
- // Curve to be placed on the right side of the bar
+ // X - UP, Y - TO THE RIGHT
+ this->DistributionActor->SetPlotLocation(VISU_XYPLOT_LEFT);
+ // Curve to be placed on the right side of the bar
vtkDebugMacro(<< "Curve to be placed on the right side of the bar");
// relative to the bar origin
u = barWidth;
- v = 0;
+ v = 0;
viewport->ViewportToNormalizedViewport(u, v);
vtkDebugMacro(<< "u=" << u << "; v=" << v);
this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0);
} else {
// Position the distribution curve horizontally
if (v > 0.5) {
- // X - TO THE LEFT, Y - DOWN
- this->DistributionActor->SetPlotLocation(VISU_XYPLOT_TOP);
- // Curve to be placed below the bar
+ // X - TO THE LEFT, Y - DOWN
+ this->DistributionActor->SetPlotLocation(VISU_XYPLOT_TOP);
+ // Curve to be placed below the bar
vtkDebugMacro(<< "Curve to be placed below the bar");
// relative to the bar origin
- u = 0;
- v = 0;
+ u = 0;
+ v = 0;
viewport->ViewportToNormalizedViewport(u, v);
vtkDebugMacro(<< "u=" << u << "; v=" << v);
this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0);
vtkDebugMacro("u2=" << u << "; v2=" << v);
this->DistributionActor->GetPosition2Coordinate()->SetValue(u, v, 0);
} else {
- // X - TO THE RIGHT, Y - UP
- this->DistributionActor->SetPlotLocation(VISU_XYPLOT_BOTTOM);
- // Curve to be placed on the top of the bar
+ // X - TO THE RIGHT, Y - UP
+ this->DistributionActor->SetPlotLocation(VISU_XYPLOT_BOTTOM);
+ // Curve to be placed on the top of the bar
vtkDebugMacro(<< "Curve to be placed on the top of the bar");
// relative to the bar origin
- u = 0;
- v = barHeight;
+ u = 0;
+ v = barHeight;
viewport->ViewportToNormalizedViewport(u, v);
vtkDebugMacro(<< "u=" << u << "; v=" << v);
this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.hxx
// Author: Alexey PETROV
// Set/Get the scalar bar dimention properties in persents.
// 0 <= ration <= 100
void SetRatios(int titleRatioSize,int labelRatioWidth,
- int barRatioWidth, int barRatioHeight);
+ int barRatioWidth, int barRatioHeight);
void GetRatios(int& titleRatioSize, int& labelRatioWidth,
- int& barRatioWidth, int& barRatioHeight);
+ int& barRatioWidth, int& barRatioHeight);
// Description:
// Set/Get the format with which to print the labels on the scalar
void SizeTitle(int *titleSize, int *size, vtkViewport *viewport);
void SizeBar(int& barSizeWidth, int& barSizeHeight, int *size,
- vtkViewport *viewport, vtkFloatingPointType *range);
-
+ vtkViewport *viewport, vtkFloatingPointType *range);
+
/** Place the distribution plot actor in the viewport according to the
* scalar bar location and orientation */
void PlaceDistribution(vtkViewport *viewport, const int barWidth, const int barHeight);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_ScalarBarCtrl.cxx
// Author: Peter KURNEV
// Module : VISU
//
#include "VISU_ScalarBarCtrl.hxx"
-#include <VISU_LookupTable.hxx>
-#include <VISU_ScalarBarActor.hxx>
+#include "VISU_LookupTable.hxx"
+#include "VISU_ScalarBarActor.hxx"
#include <vtkObjectFactory.h>
#include <vtkActor2D.h>
void
VISU_ScalarBarCtrl
::SetRangeLocal(vtkFloatingPointType theMin,
- vtkFloatingPointType theMax)
+ vtkFloatingPointType theMax)
{
myLocalLookupTable->SetTableRange(theMin,theMax);
}
void
VISU_ScalarBarCtrl
::SetRangeGlobal(vtkFloatingPointType theMin,
- vtkFloatingPointType theMax)
+ vtkFloatingPointType theMax)
{
myGlobalLookupTable->SetTableRange(theMin,theMax);
}
void
VISU_ScalarBarCtrl
::PrepareTables(VISU_ScalarBarActor* theScalarBarActor,
- VISU_LookupTable *theLookupTable,
- vtkIdType theId)
+ VISU_LookupTable *theLookupTable,
+ vtkIdType theId)
{
vtkCoordinate * aCoordinate = theScalarBarActor->GetPositionCoordinate();
aCoordinate->SetCoordinateSystemToNormalizedViewport();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_ScalarBarCtrl.hxx
// Author: Peter KURNEV
// Ranges
void
SetRangeGlobal(vtkFloatingPointType theMin,
- vtkFloatingPointType theMax);
+ vtkFloatingPointType theMax);
void
SetRangeGlobal(vtkFloatingPointType *theRange);
void
SetRangeLocal(vtkFloatingPointType theMin,
- vtkFloatingPointType theMax);
+ vtkFloatingPointType theMax);
void
SetRangeLocal(vtkFloatingPointType *theRange);
void
PrepareTables(VISU_ScalarBarActor* theScalarBarActor,
- VISU_LookupTable *theLookupTable,
- vtkIdType theId);
+ VISU_LookupTable *theLookupTable,
+ vtkIdType theId);
protected:
EMode myMode;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
-// File: VISU_ScalarMapPL.cxx
-// Author: Alexey PETROV
-// Module : VISU
+// File: VISU_ScalarMapPL.cxx
+// Author: Alexey PETROV
+// Module : VISU
//
#include "VISU_ScalarMapPL.hxx"
#include "VISU_DataSetMapperHolder.hxx"
#include "VISU_ElnoAssembleFilter.hxx"
+#include "VISU_Extractor.hxx"
#include "VISU_FieldTransform.hxx"
#include "VISU_AppendFilter.hxx"
//----------------------------------------------------------------------------
-unsigned long int
+unsigned long int
VISU_ScalarMapPL
::GetMTime()
{
//----------------------------------------------------------------------------
-void
+void
VISU_ScalarMapPL
::OnCreateMapperHolder()
{
//----------------------------------------------------------------------------
void
VISU_ScalarMapPL
-::Build()
+::Build()
{
Superclass::Build();
myMergeFilter->RemoveFields();
myMergeFilter->AddField("VISU_FIELD", aDataSet);
+ myMergeFilter->AddField("VISU_FIELD_GAUSS_MIN", aDataSet);
+ myMergeFilter->AddField("VISU_FIELD_GAUSS_MAX", aDataSet);
+ myMergeFilter->AddField("VISU_FIELD_GAUSS_MOD", aDataSet);
myMergeFilter->AddField("VISU_CELLS_MAPPER", aDataSet);
myMergeFilter->AddField("VISU_POINTS_MAPPER", aDataSet);
myMergeFilter->AddField("ELNO_POINT_COORDS", aDataSet);
//----------------------------------------------------------------------------
void
VISU_ScalarMapPL
-::Update()
+::Update()
{
Superclass::Update();
//{
void
VISU_ScalarMapPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
VISU_MergedPL::DoShallowCopy(thePipeLine, theIsCopyInput);
+
+ if(VISU_ScalarMapPL* aPipeLine = dynamic_cast<VISU_ScalarMapPL*>(thePipeLine))
+ SetGaussMetric(aPipeLine->GetGaussMetric());
}
myElnoAssembleFilter->SetElnoAssembleState( theIsShrunk );
}
+
//----------------------------------------------------------------------------
void
VISU_ScalarMapPL
//----------------------------------------------------------------------------
int
VISU_ScalarMapPL
-::AddGeometry(vtkDataSet* theGeometry)
+::AddGeometry(vtkDataSet* theGeometry, const VISU::TName& theGeomName)
{
+ // rnv: to fix issue 0020167 (AddMeshOnGroup is not fully taken into account)
+ // clear all inpust of the this->myAppendFilter in case if presentation
+ // constructed on the entire mesh.
+ if(!IsExternalGeometryUsed())
+ ClearGeometry();
+ AddGeometryName(theGeomName);
myAppendFilter->AddInput(theGeometry);
return GetNumberOfGeometry();
}
//----------------------------------------------------------------------------
vtkDataSet*
VISU_ScalarMapPL
-::GetGeometry(int theGeomNumber)
+::GetGeometry(int theGeomNumber, VISU::TName& theGeomName)
{
+ theGeomName = GetGeometryName(theGeomNumber);
return vtkDataSet::SafeDownCast(myAppendFilter->GetInput(theGeomNumber));
}
VISU_ScalarMapPL
::ClearGeometry()
{
+ ClearGeometryNames();
myAppendFilter->RemoveAllInputs();
}
//----------------------------------------------------------------------------
-vtkDataSet*
+void
+VISU_ScalarMapPL
+::GetSourceRange(vtkFloatingPointType theRange[2])
+{
+ if(!IsExternalGeometryUsed())
+ Superclass::GetSourceRange(theRange);
+ else
+ GetMergedInput()->GetScalarRange( theRange );
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_ScalarMapPL
+::SetGaussMetric(VISU::TGaussMetric theGaussMetric)
+{
+ if(GetGaussMetric() == theGaussMetric)
+ return;
+
+ GetExtractorFilter()->SetGaussMetric(theGaussMetric);
+}
+
+
+//----------------------------------------------------------------------------
+VISU::TGaussMetric
+VISU_ScalarMapPL
+::GetGaussMetric()
+{
+ return GetExtractorFilter()->GetGaussMetric();
+}
+
+
+//----------------------------------------------------------------------------
+vtkDataSet*
VISU_ScalarMapPL
::InsertCustomPL()
{
//----------------------------------------------------------------------------
-vtkPointSet*
+vtkPointSet*
VISU_ScalarMapPL
::GetMergedInput()
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_ScalarMapPL.hxx
// Author: Alexey PETROV
//----------------------------------------------------------------------------
class VISU_PIPELINE_EXPORT VISU_ScalarMapPL : public VISU_MergedPL,
- public VISU_ColoredPL,
- public VISU_UnstructuredGridPL
+ public VISU_ColoredPL,
+ public VISU_UnstructuredGridPL
{
public:
vtkTypeMacro(VISU_ScalarMapPL, VISU_ColoredPL);
virtual
int
- AddGeometry(vtkDataSet* theGeometry);
+ AddGeometry(vtkDataSet* theGeometry, const VISU::TName& theGeomName);
virtual
vtkDataSet*
- GetGeometry(int theGeomNumber);
+ GetGeometry(int theGeomNumber, VISU::TName& theGeomName);
virtual
int
void
ClearGeometry();
+ virtual
+ void
+ GetSourceRange(vtkFloatingPointType theRange[2]);
+
+ virtual
+ void
+ SetGaussMetric(VISU::TGaussMetric theGaussMetric);
+
+ virtual
+ VISU::TGaussMetric
+ GetGaussMetric();
+
//----------------------------------------------------------------------------
virtual
vtkPointSet*
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
void
SetElnoDisassembleState( bool theIsShrunk );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VISU_SphereWidget.hxx"
#include <vtkActor.h>
// if no places picked, then try to pick the sphere.
myPicker->Pick(X, Y, 0., CurrentRenderer);
if(vtkAssemblyPath *aPath = myPicker->GetPath()){
- if(aPath->GetFirstNode()->GetProp() == mySphereActor){
+ if(aPath->GetFirstNode()->GetViewProp() == mySphereActor){
myState = VISU_SphereWidget::Moving;
HighlightSphere(1);
}
// Compute the two points defining the motion vector
aCamera->GetFocalPoint(focalPoint);
ComputeWorldToDisplay(focalPoint[0],
- focalPoint[1],
- focalPoint[2],
- focalPoint);
+ focalPoint[1],
+ focalPoint[2],
+ focalPoint);
z = focalPoint[2];
ComputeDisplayToWorld(double(Interactor->GetLastEventPosition()[0]),
double(Interactor->GetLastEventPosition()[1]),
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __VISU_SphereWidget_h
#define __VISU_SphereWidget_h
// Description:
// Set/Get the center of the sphere.
void SetCenter(vtkFloatingPointType x,
- vtkFloatingPointType y,
- vtkFloatingPointType z);
+ vtkFloatingPointType y,
+ vtkFloatingPointType z);
void SetCenter(vtkFloatingPointType x[3]);
vtkFloatingPointType* GetCenter();
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "VISU_StreamLine.hxx"
+
+#include "vtkCellArray.h"
+#include "vtkDataSet.h"
+#include "vtkFloatArray.h"
+#include "vtkInformation.h"
+#include "vtkInformationVector.h"
+#include "vtkMath.h"
+#include "vtkObjectFactory.h"
+#include "vtkPointData.h"
+#include "vtkPolyData.h"
+#include "vtkPolyLine.h"
+
+vtkCxxRevisionMacro(VISU_StreamLine, "$Revision$");
+vtkStandardNewMacro(VISU_StreamLine);
+
+// Construct object with step size set to 1.0.
+VISU_StreamLine::VISU_StreamLine()
+{
+ this->StepLength = 1.0;
+ this->NumberOfStreamers = 0;
+}
+
+int VISU_StreamLine::RequestData(
+ vtkInformation *,
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
+{
+ vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
+ vtkInformation *outInfo = outputVector->GetInformationObject(0);
+ vtkInformation *sourceInfo = inputVector[1]->GetInformationObject(0);
+
+ vtkDataSet *input = vtkDataSet::SafeDownCast(
+ inInfo->Get(vtkDataObject::DATA_OBJECT()));
+ vtkPolyData *output = vtkPolyData::SafeDownCast(
+ outInfo->Get(vtkDataObject::DATA_OBJECT()));
+ vtkDataSet *source = 0;
+ if (sourceInfo)
+ {
+ source = vtkDataSet::SafeDownCast(
+ sourceInfo->Get(vtkDataObject::DATA_OBJECT()));
+ }
+
+ vtkStreamer::StreamPoint *sPrev, *sPtr;
+ vtkPoints *newPts;
+ vtkFloatArray *newVectors;
+ vtkFloatArray *newScalars=NULL;
+ vtkCellArray *newLines;
+ vtkIdType ptId, i, id;
+ int j;
+ vtkIdList *pts;
+ double tOffset, x[3], v[3], s, r;
+ double theta;
+ vtkPolyLine* lineNormalGenerator = NULL;
+ vtkFloatArray* normals = NULL;
+ vtkFloatArray* rotation = 0;
+
+ this->SavePointInterval = this->StepLength;
+ this->VISU_Streamer::Integrate(input, source);
+ if ( this->NumberOfStreamers <= 0 ) {return 1;}
+
+ pts = vtkIdList::New();
+ pts->Allocate(2500);
+
+ //
+ // Convert streamer into lines. Lines may be dashed.
+ //
+ newPts = vtkPoints::New();
+ newPts->Allocate(1000);
+ newVectors = vtkFloatArray::New();
+ newVectors->SetNumberOfComponents(3);
+ newVectors->Allocate(3000);
+ if ( this->Vorticity )
+ {
+ lineNormalGenerator = vtkPolyLine::New();
+ normals = vtkFloatArray::New();
+ normals->SetNumberOfComponents(3);
+ normals->Allocate(3000);
+ rotation = vtkFloatArray::New();
+ rotation->SetNumberOfComponents(1);
+ rotation->Allocate(1000);
+ rotation->SetName("Thetas");
+ output->GetPointData()->AddArray(rotation);
+ }
+
+ if ( input->GetPointData()->GetScalars() || this->SpeedScalars
+ || this->OrientationScalars)
+ {
+ newScalars = vtkFloatArray::New();
+ newScalars->Allocate(1000);
+ }
+ newLines = vtkCellArray::New();
+ newLines->Allocate(newLines->EstimateSize(2*this->NumberOfStreamers,
+ VTK_CELL_SIZE));
+ //
+ // Loop over all streamers generating points
+ //
+ for (ptId=0; ptId < this->NumberOfStreamers; ptId++)
+ {
+ if ( this->Streamers[ptId].GetNumberOfPoints() < 2 )
+ {
+ continue;
+ }
+ sPrev = this->Streamers[ptId].GetStreamPoint(0);
+ sPtr = this->Streamers[ptId].GetStreamPoint(1);
+
+ if ( this->Streamers[ptId].GetNumberOfPoints() == 2 && sPtr->cellId >= 0 )
+ {
+ continue;
+ }
+
+ tOffset = sPrev->t;
+
+ for ( i=1;
+ i < this->Streamers[ptId].GetNumberOfPoints() && sPtr->cellId >= 0;
+ i++, sPrev=sPtr, sPtr=this->Streamers[ptId].GetStreamPoint(i) )
+ {
+ //
+ // Create points for line
+ //
+ while ( tOffset >= sPrev->t && tOffset < sPtr->t )
+ {
+ r = (tOffset - sPrev->t) / (sPtr->t - sPrev->t);
+
+ for (j=0; j<3; j++)
+ {
+ x[j] = sPrev->x[j] + r * (sPtr->x[j] - sPrev->x[j]);
+ v[j] = sPrev->v[j] + r * (sPtr->v[j] - sPrev->v[j]);
+ }
+
+ // add point to line
+ id = newPts->InsertNextPoint(x);
+ pts->InsertNextId(id);
+ newVectors->InsertTuple(id,v);
+
+ if ( newScalars )
+ {
+ s = sPrev->s + r * (sPtr->s - sPrev->s);
+ newScalars->InsertTuple(id,&s);
+ }
+
+ if ( this->Vorticity )
+ {
+ // Store the rotation values. Used after all the streamlines
+ // are generated.
+ theta = sPrev->theta + r * (sPtr->theta - sPrev->theta);
+ rotation->InsertTuple(id, &theta);
+ }
+
+ tOffset += this->StepLength;
+
+ } // while
+ } //for this streamer
+
+ if ( pts->GetNumberOfIds() > 1 )
+ {
+ newLines->InsertNextCell(pts);
+ pts->Reset();
+ }
+ } //for all streamers
+
+ vtkDebugMacro(<<"Created " << newPts->GetNumberOfPoints() << " points, "
+ << newLines->GetNumberOfCells() << " lines");
+
+ if (this->Vorticity)
+ {
+ // Rotate the normal vectors with stream vorticity
+ vtkIdType nPts=0;
+ vtkIdType *linePts=0;
+ double normal[3], local1[3], local2[3], length, costheta, sintheta;
+
+ lineNormalGenerator->GenerateSlidingNormals(newPts,newLines,normals);
+
+ // Loop over all lines, from the above code we are know that each line
+ // will have at least two points and that no points will be shared
+ // between lines. It is important to loop over the points used by the
+ // lines because newPts may actually contain points that are not used by
+ // any lines. The normals are only calculated for points that are used
+ // in lines so referencing normals for all points can lead to UMRs
+ for (newLines->InitTraversal(); newLines->GetNextCell(nPts,linePts); )
+ {
+ for(i=0; i<nPts; i++)
+ {
+ normals->GetTuple(linePts[i], normal);
+ newVectors->GetTuple(linePts[i], v);
+ // obtain two unit orthogonal vectors on the plane perpendicular to
+ // the streamline
+ for(j=0; j<3; j++)
+ {
+ local1[j] = normal[j];
+ }
+ length = vtkMath::Normalize(local1);
+ vtkMath::Cross(local1, v, local2);
+ vtkMath::Normalize(local2);
+ // Rotate the normal with theta
+ rotation->GetTuple(linePts[i], &theta);
+ costheta = cos(theta);
+ sintheta = sin(theta);
+ for(j=0; j<3; j++)
+ {
+ normal[j] = length* (costheta*local1[j] + sintheta*local2[j]);
+ }
+ normals->SetTuple(linePts[i], normal);
+ }
+ }
+ output->GetPointData()->SetNormals(normals);
+ normals->Delete();
+ lineNormalGenerator->Delete();
+ rotation->Delete();
+ }
+
+ output->SetPoints(newPts);
+ newPts->Delete();
+
+ output->GetPointData()->SetVectors(newVectors);
+ newVectors->Delete();
+
+ if ( newScalars )
+ {
+ int idx = output->GetPointData()->AddArray(newScalars);
+ output->GetPointData()->SetActiveAttribute(idx, vtkDataSetAttributes::SCALARS);
+ newScalars->Delete();
+ }
+
+ pts->Delete();
+ output->SetLines(newLines);
+ newLines->Delete();
+
+ // Delete the streamers since they are no longer needed
+ delete[] this->Streamers;
+ this->Streamers = 0;
+ this->NumberOfStreamers = 0;
+
+ output->Squeeze();
+
+ return 1;
+}
+
+void VISU_StreamLine::PrintSelf(ostream& os, vtkIndent indent)
+{
+ this->Superclass::PrintSelf(os,indent);
+
+ os << indent << "Step Length: " << this->StepLength << "\n";
+
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef VISU_StreamLine_HeaderFile
+#define VISU_StreamLine_HeaderFile
+
+#include "VISUPipeline.hxx"
+#include "VISU_Streamer.hxx"
+
+class VISU_PIPELINE_EXPORT VISU_StreamLine : public VISU_Streamer
+{
+public:
+ vtkTypeRevisionMacro(VISU_StreamLine,VISU_Streamer);
+ void PrintSelf(ostream& os, vtkIndent indent);
+
+ // Description:
+ // Construct object with step size set to 1.0.
+ static VISU_StreamLine *New();
+
+ // Description:
+ // Specify the length of a line segment. The length is expressed in terms of
+ // elapsed time. Smaller values result in smoother appearing streamlines, but
+ // greater numbers of line primitives.
+ vtkSetClampMacro(StepLength,double,0.000001,VTK_DOUBLE_MAX);
+ vtkGetMacro(StepLength,double);
+
+protected:
+ VISU_StreamLine();
+ ~VISU_StreamLine() {};
+
+ // Convert streamer array into vtkPolyData
+ virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+
+ // the length of line primitives
+ double StepLength;
+
+private:
+ VISU_StreamLine(const VISU_StreamLine&); // Not implemented.
+ void operator=(const VISU_StreamLine&); // Not implemented.
+};
+
+#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_StreamLinesPL.cxx
// Author: Alexey PETROV
#include "VISU_MaskPointsFilter.hxx"
#include "VISU_PipeLineUtils.hxx"
+#include "VTKViewer_CellCenters.h"
#include "VTKViewer_GeometryFilter.h"
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+
#include <algorithm>
#include <vtkCell.h>
SetIsFeatureEdgesAllowed(false);
myStream = vtkStreamLine::New();
- myCenters = vtkCellCenters::New();
+ myCenters = VTKViewer_CellCenters::New();
myGeomFilter = VTKViewer_GeometryFilter::New();
myPointsFilter = VISU_MaskPointsFilter::New();
- myPercents = 0.3;
mySource = NULL;
+
+ myPercents = GetUsedPointsDefault();
}
void
VISU_StreamLinesPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
if(VISU_StreamLinesPL *aPipeLine = dynamic_cast<VISU_StreamLinesPL*>(thePipeLine)){
SetParams(aPipeLine->GetIntegrationStep(),
- aPipeLine->GetPropagationTime(),
- aPipeLine->GetStepLength(),
- aPipeLine->GetSource(),
- aPipeLine->GetUsedPoints(),
- aPipeLine->GetDirection());
+ aPipeLine->GetPropagationTime(),
+ aPipeLine->GetStepLength(),
+ aPipeLine->GetSource(),
+ aPipeLine->GetUsedPoints(),
+ aPipeLine->GetDirection());
}
}
//----------------------------------------------------------------------------
-size_t
+vtkFloatingPointType
VISU_StreamLinesPL
::GetNecasseryMemorySize(vtkIdType theNbOfPoints,
- vtkFloatingPointType theStepLength,
- vtkFloatingPointType thePropogationTime,
- vtkFloatingPointType thePercents)
+ vtkFloatingPointType theStepLength,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType thePercents)
{
static vtkFloatingPointType aStreamPointSize = sizeof(vtkFloatingPointType)*15 + sizeof(vtkIdType)*2;
static vtkFloatingPointType aStreamArraySize = aStreamPointSize*1024; // == 69632
vtkFloatingPointType anAssignedDataSize = aCellsSize*4.0*sizeof(vtkFloatingPointType);
vtkFloatingPointType anOutputDataSetSize = aMeshSize + anAssignedDataSize;
- size_t aResult = size_t(aStreamArraySize*aNbCells + anOutputDataSetSize);
+ vtkFloatingPointType aResult = aStreamArraySize*aNbCells + anOutputDataSetSize;
return aResult;
}
size_t
VISU_StreamLinesPL
::FindPossibleParams(vtkDataSet* theDataSet,
- vtkFloatingPointType& theStepLength,
- vtkFloatingPointType& thePropogationTime,
- vtkFloatingPointType& thePercents)
+ vtkFloatingPointType& theStepLength,
+ vtkFloatingPointType& thePropogationTime,
+ vtkFloatingPointType& thePercents)
{
static vtkFloatingPointType aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0;
vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
- size_t aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
+ vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
size_t anIsPossible = CheckAvailableMemory(aSize);
if(!anIsPossible){
vtkFloatingPointType aMaxStepLength = std::max(GetMaxStepLength(theDataSet),thePropogationTime);
- vtkFloatingPointType aMinStepLength = GetMinStepLength(theDataSet);
+ vtkFloatingPointType aMinStepLength = GetMinStepLength(theDataSet,thePercents);
vtkFloatingPointType aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease;
for(int i = 2, aStepChanged = 1, aPerecentsChanged = 1; aStepChanged || aPerecentsChanged; i++){
vtkFloatingPointType aStepLength = theStepLength + aDeltaStepLength;
if(aStepLength < aMaxStepLength) theStepLength = aStepLength;
else if(aStepChanged){
- aStepLength = aMaxStepLength;
- aStepChanged = 0;
+ aStepLength = aMaxStepLength;
+ aStepChanged = 0;
}
vtkFloatingPointType aPercents = thePercents /= aPercentsDecrease;
if(aPercents*aNbOfPoints > 1) thePercents = aPercents;
else if(aPerecentsChanged) {
- thePercents = 1.1 / aNbOfPoints;
- aPerecentsChanged = 0;
+ thePercents = 1.1 / aNbOfPoints;
+ aPerecentsChanged = 0;
}
aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
if(CheckAvailableMemory(aSize)){
- anIsPossible = i;
- break;
+ anIsPossible = i;
+ break;
}
}
}
size_t
VISU_StreamLinesPL
::SetParams(vtkFloatingPointType theIntStep,
- vtkFloatingPointType thePropogationTime,
- vtkFloatingPointType theStepLength,
- vtkPointSet* theSource,
- vtkFloatingPointType thePercents,
- int theDirection)
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType theStepLength,
+ vtkPointSet* theSource,
+ vtkFloatingPointType thePercents,
+ int theDirection)
{
vtkPointSet* aDataSet = theSource? theSource: GetMergedInput();
aDataSet->Update();
thePercents = 2.0 / aNbOfPoints;
theIntStep = CorrectIntegrationStep(theIntStep,
- aPointSet,
- thePercents);
+ aPointSet,
+ thePercents);
thePropogationTime = CorrectPropagationTime(thePropogationTime,
- aPointSet);
+ aPointSet,
+ thePercents);
theStepLength = CorrectStepLength(theStepLength,
- aPointSet);
+ aPointSet,
+ thePercents);
size_t anIsAccepted = FindPossibleParams(aPointSet,
- theStepLength,
- thePropogationTime,
- thePercents);
+ theStepLength,
+ thePropogationTime,
+ thePercents);
if (anIsAccepted) {
mySource = theSource;
//----------------------------------------------------------------------------
size_t
VISU_StreamLinesPL
-::IsPossible(vtkPointSet* theDataSet,
- vtkFloatingPointType thePercents)
+::IsPossible(vtkPointSet* theDataSet)
{
- vtkFloatingPointType aStepLength = GetBaseStepLength(theDataSet);
+ vtkFloatingPointType aPercents = GetUsedPointsDefault();
+ vtkFloatingPointType aStepLength = GetBaseStepLength(theDataSet,
+ aPercents);
vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet);
VISU_MaskPointsFilter *aPointsFilter = VISU_MaskPointsFilter::New();
aPointsFilter->SetInput(theDataSet);
vtkDataSet* aDataSet = aPointsFilter->GetOutput();
aDataSet->Update();
size_t aRes = FindPossibleParams(aDataSet,
- aStepLength,
- aBasePropTime,
- thePercents);
+ aStepLength,
+ aBasePropTime,
+ aPercents);
aPointsFilter->Delete();
return aRes;
}
vtkFloatingPointType
VISU_StreamLinesPL
::GetMinIntegrationStep(vtkDataSet* theDataSet,
- vtkFloatingPointType thePercents)
+ vtkFloatingPointType thePercents)
{
if(!theDataSet)
return -1.0;
return 0.0; // absolutely empty object
vtkFloatingPointType anStepLength = GetMaxIntegrationStep(theDataSet)/aCoeffOfIntStep;
- vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet)/GetVelocityCoeff(theDataSet);
+ // 0020724: last division has been commented, seems to be a logical mistake (to discuss with APO)
+ vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet); // /GetVelocityCoeff(theDataSet)
thePercents = 1.0;
vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
- size_t aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents);
+ vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents);
size_t aRealSize = GetAvailableMemory(aSize);
vtkFloatingPointType anAverageVolume = aVolume / aRealSize;
vtkFloatingPointType aStep = pow(double(anAverageVolume), double(1.0/double(degree)));
vtkFloatingPointType
VISU_StreamLinesPL
::GetBaseIntegrationStep(vtkDataSet* theDataSet,
- vtkFloatingPointType thePercents)
+ vtkFloatingPointType thePercents)
{
theDataSet->Update();
vtkFloatingPointType
VISU_StreamLinesPL
::CorrectIntegrationStep(vtkFloatingPointType theStep,
- vtkDataSet* theDataSet,
- vtkFloatingPointType thePercents)
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents)
{
theDataSet->Update();
//----------------------------------------------------------------------------
vtkFloatingPointType
VISU_StreamLinesPL
-::GetMinPropagationTime(vtkDataSet* theDataSet)
+::GetMinPropagationTime(vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents)
{
if(!theDataSet)
return -1.0;
- return GetMinStepLength(theDataSet);
+ return GetMinStepLength(theDataSet, thePercents);
}
VISU_StreamLinesPL
::GetMinPropagationTime()
{
- return GetMinPropagationTime(GetExtractorFilter()->GetOutput());
+ return GetMinPropagationTime(GetExtractorFilter()->GetOutput(), GetUsedPoints());
}
vtkFloatingPointType
VISU_StreamLinesPL
::CorrectPropagationTime(vtkFloatingPointType thePropagationTime,
- vtkDataSet* theDataSet)
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents)
{
- vtkFloatingPointType aMinPropagationTime = GetMinPropagationTime(theDataSet);
+ vtkFloatingPointType aMinPropagationTime = GetMinPropagationTime(theDataSet, thePercents);
if(aMinPropagationTime > thePropagationTime)
thePropagationTime = aMinPropagationTime;
//----------------------------------------------------------------------------
vtkFloatingPointType
VISU_StreamLinesPL
-::GetMinStepLength(vtkDataSet* theDataSet)
+::GetMinStepLength(vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents)
{
static vtkFloatingPointType aNbOfStepsOfIntStep = 1.0E+1;
- vtkFloatingPointType anIntStep = GetMinIntegrationStep(theDataSet);
+ vtkFloatingPointType anIntStep = GetMinIntegrationStep(theDataSet, thePercents);
vtkFloatingPointType aStepLength = anIntStep * aNbOfStepsOfIntStep / GetVelocityCoeff(theDataSet);
return aStepLength;
}
VISU_StreamLinesPL
::GetMinStepLength()
{
- return GetMinStepLength(GetExtractorFilter()->GetOutput());
+ return GetMinStepLength(GetExtractorFilter()->GetOutput(), GetUsedPoints());
}
vtkFloatingPointType
VISU_StreamLinesPL
::CorrectStepLength(vtkFloatingPointType theStep,
- vtkDataSet* theDataSet)
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents)
{
- vtkFloatingPointType aMinStep = GetMinStepLength(theDataSet);
+ vtkFloatingPointType aMinStep = GetMinStepLength(theDataSet, thePercents);
if(theStep < aMinStep)
theStep = aMinStep;
//----------------------------------------------------------------------------
vtkFloatingPointType
VISU_StreamLinesPL
-::GetBaseStepLength(vtkDataSet* theDataSet)
+::GetBaseStepLength(vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents)
{
static vtkFloatingPointType anAvgNbOfSteps = 1.0E+2;
vtkFloatingPointType aPropagationTime = GetBasePropagationTime(theDataSet);
vtkFloatingPointType aStepLength = aPropagationTime/anAvgNbOfSteps;
- aStepLength = CorrectStepLength(aStepLength,theDataSet);
+ aStepLength = CorrectStepLength(aStepLength,theDataSet,thePercents);
return aStepLength;
}
+//----------------------------------------------------------------------------
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetUsedPointsDefault()
+{
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+ return aResourceMgr->doubleValue("VISU", "stream_lines_used_points", 0.01);
+}
+
+
//----------------------------------------------------------------------------
void
VISU_StreamLinesPL
Superclass::Init();
vtkDataSet* aDataSet = GetExtractorFilter()->GetOutput();
- vtkFloatingPointType anIntStep = GetBaseIntegrationStep(aDataSet);
+ vtkFloatingPointType anIntStep = GetBaseIntegrationStep(aDataSet, GetUsedPoints());
vtkFloatingPointType aPropagationTime = GetBasePropagationTime(aDataSet);
- vtkFloatingPointType aStepLength = GetBaseStepLength(aDataSet);
+ vtkFloatingPointType aStepLength = GetBaseStepLength(aDataSet, GetUsedPoints());
SetParams(anIntStep,
- aPropagationTime,
- aStepLength);
+ aPropagationTime,
+ aStepLength,
+ NULL,
+ GetUsedPoints());
}
Superclass::Build();
VISU::CellDataToPoint(myStream,
- myCellDataToPointData,
- GetMergedInput());
+ myCellDataToPointData,
+ GetMergedInput());
myGeomFilter->SetInput(myStream->GetOutput());
myGeomFilter->ExtentClippingOn();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_StreamLinesPL.hxx
// Author: Alexey PETROV
#include "VISUPipeline.hxx"
#include "VISU_DeformedShapePL.hxx"
-#include <vtkStreamLine.h>
+
+#include <vtkStreamer.h>
class vtkDataSet;
class vtkPointSet;
-class vtkCellCenters;
+class VTKViewer_CellCenters;
class VTKViewer_GeometryFilter;
class VISU_MaskPointsFilter;
+class vtkStreamLine;
//----------------------------------------------------------------------------
virtual
size_t
SetParams(vtkFloatingPointType theIntStep,
- vtkFloatingPointType thePropogationTime,
- vtkFloatingPointType theStepLength,
- vtkPointSet* theSource = NULL,
- vtkFloatingPointType thePercents = 0.3,
- int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS);
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType theStepLength,
+ vtkPointSet* theSource,
+ vtkFloatingPointType thePercents,
+ int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS);
virtual
vtkPointSet*
static
vtkFloatingPointType
GetMinIntegrationStep(vtkDataSet* theDataSet,
- vtkFloatingPointType thePercents = 0.3);
+ vtkFloatingPointType thePercents);
static
vtkFloatingPointType
GetBaseIntegrationStep(vtkDataSet* theDataSet,
- vtkFloatingPointType thePercents = 0.3);
+ vtkFloatingPointType thePercents);
static
vtkFloatingPointType
- GetMinPropagationTime(vtkDataSet* theDataSet);
+ GetMinPropagationTime(vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents);
static
vtkFloatingPointType
static
vtkFloatingPointType
- GetMinStepLength(vtkDataSet* theDataSet);
+ GetMinStepLength(vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents);
static
vtkFloatingPointType
static
vtkFloatingPointType
- GetBaseStepLength(vtkDataSet* theDataSet);
+ GetBaseStepLength(vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents);
static
vtkFloatingPointType
static
size_t
- IsPossible(vtkPointSet* theDataSet,
- vtkFloatingPointType thePercents = 0.3);
+ IsPossible(vtkPointSet* theDataSet);
protected:
VISU_StreamLinesPL();
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
static
- size_t
+ vtkFloatingPointType
GetNecasseryMemorySize(vtkIdType theNbOfPoints,
- vtkFloatingPointType theStepLength,
- vtkFloatingPointType thePropogationTime,
- vtkFloatingPointType thePercents = 0.3);
+ vtkFloatingPointType theStepLength,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType thePercents);
static
size_t
FindPossibleParams(vtkDataSet* theDataSet,
- vtkFloatingPointType& theStepLength,
- vtkFloatingPointType& thePropogationTime,
- vtkFloatingPointType& thePercents);
+ vtkFloatingPointType& theStepLength,
+ vtkFloatingPointType& thePropogationTime,
+ vtkFloatingPointType& thePercents);
static
vtkFloatingPointType
CorrectIntegrationStep(vtkFloatingPointType theStep,
- vtkDataSet* theDataSet,
- vtkFloatingPointType thePercents = 0.3);
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents);
static
vtkFloatingPointType
CorrectPropagationTime(vtkFloatingPointType thePropagationTime,
- vtkDataSet* theDataSet);
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents);
static
vtkFloatingPointType
CorrectStepLength(vtkFloatingPointType theStep,
- vtkDataSet* theDataSet);
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents);
+
+ static
+ vtkFloatingPointType
+ GetUsedPointsDefault();
vtkStreamLine* myStream;
vtkPointSet* mySource;
- vtkCellCenters* myCenters;
+ VTKViewer_CellCenters* myCenters;
VTKViewer_GeometryFilter *myGeomFilter;
VISU_MaskPointsFilter *myPointsFilter;
vtkFloatingPointType myPercents;
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "VISU_Streamer.hxx"
+
+#include "vtkCell.h"
+#include "vtkDataSet.h"
+#include "vtkDoubleArray.h"
+#include "vtkExecutive.h"
+#include "vtkGenericCell.h"
+#include "vtkInformation.h"
+#include "vtkInterpolatedVelocityField.h"
+#include "vtkMath.h"
+#include "vtkMultiThreader.h"
+#include "vtkObjectFactory.h"
+#include "vtkPointData.h"
+#include "vtkRungeKutta2.h"
+
+vtkCxxRevisionMacro(VISU_Streamer, "$Revision$");
+
+#define VTK_START_FROM_POSITION 0
+#define VTK_START_FROM_LOCATION 1
+
+struct VISU_StreamerThreadStruct
+{
+ VISU_Streamer *Filter;
+ vtkDataSet *Input;
+ vtkDataSet *Source;
+};
+
+vtkStreamer::StreamArray::StreamArray()
+{
+ this->MaxId = -1;
+ this->Array = new vtkStreamer::StreamPoint[1000];
+ this->Size = 1000;
+ this->Extend = 5000;
+ this->Direction = VTK_INTEGRATE_FORWARD;
+}
+
+vtkStreamer::StreamPoint *vtkStreamer::StreamArray::Resize(vtkIdType sz)
+{
+ vtkStreamer::StreamPoint *newArray;
+ vtkIdType newSize;
+
+ if (sz >= this->Size)
+ {
+ newSize = this->Size +
+ this->Extend*(((sz-this->Size)/this->Extend)+1);
+ }
+ else
+ {
+ newSize = sz;
+ }
+
+ newArray = new vtkStreamer::StreamPoint[newSize];
+
+ memcpy(newArray, this->Array,
+ (sz < this->Size ? sz : this->Size) * sizeof(vtkStreamer::StreamPoint));
+
+ this->Size = newSize;
+ delete [] this->Array;
+ this->Array = newArray;
+
+ return this->Array;
+}
+
+// Construct object to start from position (0,0,0); integrate forward; terminal
+// speed 0.0; vorticity computation off; integrations step length 0.2; and
+// maximum propagation time 100.0.
+VISU_Streamer::VISU_Streamer()
+{
+}
+
+VISU_Streamer::~VISU_Streamer()
+{
+}
+
+static const double VTK_EPSILON=1E-12;
+
+VTK_THREAD_RETURN_TYPE VISU_Streamer::ThreadedIntegrate( void *arg )
+{
+ VISU_Streamer *self;
+ VISU_StreamerThreadStruct *str;
+ int thread_count;
+ int thread_id;
+ vtkStreamer::StreamArray *streamer;
+ vtkStreamer::StreamPoint *sNext = 0, *sPtr;
+ vtkStreamer::StreamPoint pt1, pt2;
+ int i;
+ vtkIdType idxNext, ptId;
+ double d, step, dir;
+ double xNext[3], vel[3];
+ double *cellVel;
+ double derivs[9];
+ double *w, pcoords[3];
+ double coords[4];
+ vtkDataSet *input;
+ vtkGenericCell *cell;
+ vtkPointData *pd;
+ vtkDataArray *inScalars;
+ vtkDataArray *inVectors;
+ vtkDoubleArray *cellVectors;
+ vtkDataArray *cellScalars=0;
+ double tOffset, vort[3];
+ double err;
+ int counter=0;
+
+ thread_id = ((vtkMultiThreader::ThreadInfo *)(arg))->ThreadID;
+ thread_count = ((vtkMultiThreader::ThreadInfo *)(arg))->NumberOfThreads;
+ str = (VISU_StreamerThreadStruct*)(((vtkMultiThreader::ThreadInfo *)(arg))->UserData);
+ self = str->Filter;
+
+ input = str->Input;
+ pd = input->GetPointData();
+ inScalars = pd->GetScalars();
+ inVectors = pd->GetVectors();
+
+ cell = vtkGenericCell::New();
+ cellVectors = vtkDoubleArray::New();
+ cellVectors->SetNumberOfComponents(3);
+ cellVectors->Allocate(3*VTK_CELL_SIZE);
+ if (inScalars)
+ {
+ cellScalars = inScalars->NewInstance();
+ cellScalars->SetNumberOfComponents(inScalars->GetNumberOfComponents());
+ cellScalars->Allocate(inScalars->GetNumberOfComponents()*VTK_CELL_SIZE);
+ }
+
+ w = new double[input->GetMaxCellSize()];
+
+ // Set the function set to be integrated
+ vtkInterpolatedVelocityField* func = vtkInterpolatedVelocityField::New();
+ func->AddDataSet(input);
+
+ if (self->GetIntegrator() == 0)
+ {
+ vtkGenericWarningMacro("No integrator is specified.");
+ return VTK_THREAD_RETURN_VALUE;
+ }
+
+ // Create a new integrator, the type is the same as Integrator
+ vtkInitialValueProblemSolver* integrator =
+ self->GetIntegrator()->NewInstance();
+ integrator->SetFunctionSet(func);
+
+ // Used to avoid calling these function many times during
+ // the integration
+ double termspeed = self->GetTerminalSpeed();
+ double maxtime = self->GetMaximumPropagationTime();
+ double savePointInterval = self->GetSavePointInterval();
+
+ // For each streamer, integrate in appropriate direction
+ // Do only the streamers that this thread should handle.
+ for (ptId=0; ptId < self->GetNumberOfStreamers(); ptId++)
+ {
+ if ( ptId % thread_count == thread_id )
+ {
+ // Get starting step
+ streamer = self->GetStreamers() + ptId;
+ sPtr = streamer->GetStreamPoint(0);
+ if ( sPtr->cellId < 0 )
+ {
+ continue;
+ }
+ // Set the last cell id in the vtkInterpolatedVelocityField
+ // object to speed up FindCell calls
+ func->SetLastCellId(sPtr->cellId);
+
+ dir = streamer->Direction;
+
+ // Copy the first point
+ pt1 = *sPtr;
+ pt2 = *sPtr;
+ tOffset = pt1.t;
+
+ //integrate until time has been exceeded
+ while ( pt1.cellId >= 0 && pt1.speed > termspeed && pt1.t < maxtime )
+ {
+
+ if ( counter++ % 1000 == 0 )
+ {
+ if (!thread_id)
+ {
+ self->UpdateProgress((double)ptId/self->GetNumberOfStreamers()
+ +pt1.t/maxtime/self->GetNumberOfStreamers());
+ }
+ if (self->GetAbortExecute())
+ {
+ break;
+ }
+ }
+
+ // Set the integration step to be characteristic cell length
+ // time IntegrationStepLength
+ input->GetCell(pt1.cellId, cell);
+ step = dir*self->GetIntegrationStepLength()
+ * sqrt((double)cell->GetLength2())/pt1.speed;
+
+ // Calculate the next step using the integrator provided
+ if (integrator->ComputeNextStep(pt1.x, pt1.v, xNext, 0, step, 0, err)
+ != 0)
+ {
+ break;
+ }
+
+ for(i=0; i<3; i++)
+ {
+ coords[i] = xNext[i];
+ }
+
+ // Interpolate the velocity field at coords
+ if ( !func->FunctionValues(coords, vel) )
+ {
+ break;
+ }
+
+ for(i=0; i<3; i++)
+ {
+ pt2.v[i] = vel[i];
+ }
+
+ for (i=0; i<3; i++)
+ {
+ pt2.x[i] = xNext[i];
+ }
+
+ pt2.cellId = func->GetLastCellId();
+ func->GetLastWeights(w);
+ func->GetLastLocalCoordinates(pcoords);
+ input->GetCell(pt2.cellId, cell);
+
+ if ( inScalars )
+ {
+ // Interpolate scalars
+ inScalars->GetTuples(cell->PointIds, cellScalars);
+ for (pt2.s=0.0, i=0; i < cell->GetNumberOfPoints(); i++)
+ {
+ pt2.s += cellScalars->GetComponent(i,0) * w[i];
+ }
+ }
+
+ pt2.speed = vtkMath::Norm(pt2.v);
+
+ d = sqrt((double)vtkMath::Distance2BetweenPoints(pt1.x,pt2.x));
+ pt2.d = pt1.d + d;
+ // If at stagnation region, stop the integration
+ if ( d < VTK_EPSILON || (pt1.speed + pt2.speed) < VTK_EPSILON )
+ {
+ pt2.t = pt1.t;
+ break;
+ }
+ pt2.t = pt1.t + (2.0 * d / (pt1.speed + pt2.speed));
+
+ if (self->GetVorticity() && inVectors)
+ {
+ // compute vorticity
+ inVectors->GetTuples(cell->PointIds, cellVectors);
+ cellVel = cellVectors->GetPointer(0);
+ cell->Derivatives(0, pcoords, cellVel, 3, derivs);
+ vort[0] = derivs[7] - derivs[5];
+ vort[1] = derivs[2] - derivs[6];
+ vort[2] = derivs[3] - derivs[1];
+ // rotation
+ pt2.omega = vtkMath::Dot(vort, pt2.v);
+ pt2.omega /= pt2.speed;
+ pt2.theta += (pt1.omega+pt2.omega)/2 * (pt2.t - pt1.t);
+ }
+
+
+ // Store only points which have a point to be displayed
+ // between them
+ if (tOffset >= pt1.t && tOffset <= pt2.t)
+ {
+ // Do not store if same as the last point.
+ // To avoid storing some points twice.
+ if ( !sNext || sNext->x[0] != pt1.x[0] || sNext->x[1] != pt1.x[1]
+ || sNext->x[2] != pt1.x[2] )
+ {
+ idxNext = streamer->InsertNextStreamPoint();
+ sNext = streamer->GetStreamPoint(idxNext);
+ *sNext = pt1;
+ }
+ idxNext = streamer->InsertNextStreamPoint();
+ sNext = streamer->GetStreamPoint(idxNext);
+ *sNext = pt2;
+ }
+ if (tOffset < pt2.t)
+ {
+ tOffset += ((int)(( pt2.t - tOffset) / savePointInterval) + 1)
+ * savePointInterval;
+ }
+ pt1 = pt2;
+
+ }
+ // Store the last point anyway.
+ if ( !sNext || sNext->x[0] != pt2.x[0] || sNext->x[1] != pt2.x[1]
+ || sNext->x[2] != pt2.x[2] )
+ {
+ idxNext = streamer->InsertNextStreamPoint();
+ sNext = streamer->GetStreamPoint(idxNext);
+ *sNext = pt2;
+ }
+ // Clear the last cell to avoid starting a search from
+ // the last point in the streamline
+ func->ClearLastCellId();
+ }
+ }
+
+ integrator->Delete();
+ func->Delete();
+
+ cell->Delete();
+ cellVectors->Delete();
+ if (cellScalars)
+ {
+ cellScalars->Delete();
+ }
+ delete[] w;
+
+ return VTK_THREAD_RETURN_VALUE;
+}
+
+void VISU_Streamer::Integrate(vtkDataSet *input, vtkDataSet *source)
+{
+ vtkPointData *pd = input->GetPointData();
+ vtkDataArray *inScalars;
+ vtkDataArray *inVectors;
+ vtkIdType numSourcePts, idx, idxNext;
+ vtkStreamer::StreamPoint *sNext, *sPtr;
+ vtkIdType ptId, i;
+ int j, offset;
+ vtkCell *cell;
+ double v[3], *cellVel, derivs[9], xNext[3], vort[3];
+ double tol2;
+ double *w = new double[input->GetMaxCellSize()];
+ vtkDoubleArray *cellVectors;
+ vtkDataArray *cellScalars=0;
+
+ vtkDebugMacro(<<"Generating streamers");
+ this->NumberOfStreamers = 0;
+
+ // reexecuting - delete old stuff
+ if( this->Streamers )
+ {
+ delete [] this->Streamers;
+ }
+ this->Streamers = NULL;
+
+ if ( ! (inVectors=pd->GetVectors()) )
+ {
+ delete [] w;
+ vtkErrorMacro(<<"No vector data defined!");
+ return;
+ }
+
+ cellVectors = vtkDoubleArray::New();
+ cellVectors->SetNumberOfComponents(3);
+ cellVectors->Allocate(3*VTK_CELL_SIZE);
+
+ inScalars = pd->GetScalars();
+
+ if (inScalars)
+ {
+ cellScalars = inScalars->NewInstance();
+ cellScalars->SetNumberOfComponents(inScalars->GetNumberOfComponents());
+ cellScalars->Allocate(cellScalars->GetNumberOfComponents()*VTK_CELL_SIZE);
+ }
+
+ tol2 = input->GetLength()/1000;
+ tol2 = tol2*tol2;
+
+ //
+ // Create starting points
+ //
+ this->NumberOfStreamers = numSourcePts = offset = 1;
+ if ( source )
+ {
+ this->NumberOfStreamers = numSourcePts = source->GetNumberOfPoints();
+ }
+
+ if ( this->IntegrationDirection == VTK_INTEGRATE_BOTH_DIRECTIONS )
+ {
+ offset = 2;
+ this->NumberOfStreamers *= 2;
+ }
+
+ this->Streamers = new vtkStreamer::StreamArray[this->NumberOfStreamers];
+
+ if ( this->StartFrom == VTK_START_FROM_POSITION && !source )
+ {
+ idx = this->Streamers[0].InsertNextStreamPoint();
+ sPtr = this->Streamers[0].GetStreamPoint(idx);
+ sPtr->subId = 0;
+ for (i=0; i<3; i++)
+ {
+ sPtr->x[i] = this->StartPosition[i];
+ }
+ sPtr->cellId = input->FindCell(this->StartPosition, NULL, -1, 0.0,
+ sPtr->subId, sPtr->p, w);
+ }
+
+ else if ( this->StartFrom == VTK_START_FROM_LOCATION && !source )
+ {
+ idx = this->Streamers[0].InsertNextStreamPoint();
+ sPtr = this->Streamers[0].GetStreamPoint(idx);
+ sPtr->subId = 0;
+ cell = input->GetCell(sPtr->cellId);
+ cell->EvaluateLocation(sPtr->subId, sPtr->p, sPtr->x, w);
+ }
+
+ else //VTK_START_FROM_SOURCE
+ {
+ for (ptId=0; ptId < numSourcePts; ptId++)
+ {
+ idx = this->Streamers[offset*ptId].InsertNextStreamPoint();
+ sPtr = this->Streamers[offset*ptId].GetStreamPoint(idx);
+ sPtr->subId = 0;
+ source->GetPoint(ptId,sPtr->x);
+ sPtr->cellId = input->FindCell(sPtr->x, NULL, -1, tol2,
+ sPtr->subId, sPtr->p, w);
+ }
+ }
+
+ // Finish initializing each streamer
+ //
+ for (idx=0, ptId=0; ptId < numSourcePts; ptId++)
+ {
+ this->Streamers[offset*ptId].Direction = 1.0;
+ sPtr = this->Streamers[offset*ptId].GetStreamPoint(idx);
+ sPtr->d = 0.0;
+ sPtr->t = 0.0;
+ sPtr->s = 0.0;
+ sPtr->theta = 0.0;
+ sPtr->omega = 0.0;
+
+ if ( sPtr->cellId >= 0 ) //starting point in dataset
+ {
+ cell = input->GetCell(sPtr->cellId);
+ cell->EvaluateLocation(sPtr->subId, sPtr->p, xNext, w);
+
+ inVectors->GetTuples(cell->PointIds, cellVectors);
+ sPtr->v[0] = sPtr->v[1] = sPtr->v[2] = 0.0;
+ for (i=0; i < cell->GetNumberOfPoints(); i++)
+ {
+ cellVectors->GetTuple(i, v);
+ for (j=0; j<3; j++)
+ {
+ sPtr->v[j] += v[j] * w[i];
+ }
+ }
+
+ sPtr->speed = vtkMath::Norm(sPtr->v);
+
+ if (this->GetVorticity() && inVectors)
+ {
+ // compute vorticity
+ inVectors->GetTuples(cell->PointIds, cellVectors);
+ cellVel = cellVectors->GetPointer(0);
+ cell->Derivatives(0, sPtr->p, cellVel, 3, derivs);
+ vort[0] = derivs[7] - derivs[5];
+ vort[1] = derivs[2] - derivs[6];
+ vort[2] = derivs[3] - derivs[1];
+ // rotation
+ sPtr->omega = vtkMath::Dot(vort, sPtr->v);
+ sPtr->omega /= sPtr->speed;
+ sPtr->theta = 0;
+ }
+
+ if ( inScalars )
+ {
+ inScalars->GetTuples(cell->PointIds, cellScalars);
+ for (sPtr->s=0, i=0; i < cell->GetNumberOfPoints(); i++)
+ {
+ sPtr->s += cellScalars->GetComponent(i,0) * w[i];
+ }
+ }
+ }
+ else
+ {
+ for (j=0; j<3; j++)
+ {
+ sPtr->p[j] = 0.0;
+ sPtr->v[j] = 0.0;
+ }
+ sPtr->speed = 0;
+ }
+
+ if ( this->IntegrationDirection == VTK_INTEGRATE_BOTH_DIRECTIONS )
+ {
+ this->Streamers[offset*ptId+1].Direction = -1.0;
+ idxNext = this->Streamers[offset*ptId+1].InsertNextStreamPoint();
+ sNext = this->Streamers[offset*ptId+1].GetStreamPoint(idxNext);
+ sPtr = this->Streamers[offset*ptId].GetStreamPoint(idx);
+ *sNext = *sPtr;
+ }
+ else if ( this->IntegrationDirection == VTK_INTEGRATE_BACKWARD )
+ {
+ this->Streamers[offset*ptId].Direction = -1.0;
+ }
+
+
+ } //for each streamer
+
+ // Some data access methods must be called once from a single thread before they
+ // can safely be used. Call those now
+ vtkGenericCell *gcell = vtkGenericCell::New();
+ input->GetCell(0,gcell);
+ gcell->Delete();
+
+ // Set up and execute the thread
+ this->Threader->SetNumberOfThreads( this->NumberOfThreads );
+ VISU_StreamerThreadStruct str;
+ str.Filter = this;
+ str.Input = input;
+ str.Source = source;
+ this->Threader->SetSingleMethod( VISU_Streamer::ThreadedIntegrate, &str );
+ this->Threader->SingleMethodExecute();
+
+ //
+ // Now create appropriate representation
+ //
+ if ( this->OrientationScalars && !this->SpeedScalars)
+ {
+ for (ptId=0; ptId < this->NumberOfStreamers; ptId++)
+ {
+ for ( sPtr=this->Streamers[ptId].GetStreamPoint(0), i=0;
+ i < this->Streamers[ptId].GetNumberOfPoints() && sPtr->cellId >= 0;
+ i++, sPtr=this->Streamers[ptId].GetStreamPoint(i) )
+ {
+ sPtr->s = sPtr->theta;
+ }
+ }
+ }
+
+ if ( this->SpeedScalars )
+ {
+ for (ptId=0; ptId < this->NumberOfStreamers; ptId++)
+ {
+ for ( sPtr=this->Streamers[ptId].GetStreamPoint(0), i=0;
+ i < this->Streamers[ptId].GetNumberOfPoints() && sPtr->cellId >= 0;
+ i++, sPtr=this->Streamers[ptId].GetStreamPoint(i) )
+ {
+ sPtr->s = sPtr->speed;
+ }
+ }
+ }
+ delete [] w;
+ cellVectors->Delete();
+ if (cellScalars)
+ {
+ cellScalars->Delete();
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef VISU_Streamer_HeaderFile
+#define VISU_Streamer_HeaderFile
+
+#include "VISUPipeline.hxx"
+
+#include <vtkStreamer.h>
+
+class VISU_PIPELINE_EXPORT VISU_Streamer : public vtkStreamer
+{
+public:
+ vtkTypeRevisionMacro(VISU_Streamer,vtkStreamer);
+
+protected:
+ // Description:
+ // Construct object to start from position (0,0,0); integrate forward;
+ // terminal speed 0.0; vorticity computation off; integrations step length
+ // 0.2; and maximum propagation time 100.0.
+ VISU_Streamer();
+ ~VISU_Streamer();
+
+ // Integrate data
+ void Integrate(vtkDataSet *input, vtkDataSet *source);
+
+ static VTK_THREAD_RETURN_TYPE ThreadedIntegrate( void *arg );
+
+private:
+ VISU_Streamer(const VISU_Streamer&); // Not implemented.
+ void operator=(const VISU_Streamer&); // Not implemented.
+};
+
+#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_UnstructuredGridPL.cxx
// Author: Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_UnstructuredGripPL.hxx
// Author: Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.cxx
// Author: Alexey PETROV
#include "VISU_UsedPointsFilter.hxx"
#include "VTKViewer_TransformFilter.h"
#include "VTKViewer_Transform.h"
+#include "VTKViewer_CellCenters.h"
#include <vtkGlyph3D.h>
#include <vtkConeSource.h>
//----------------------------------------------------------------------------
template<class TOutputFilter>
void ToCellCenters( TOutputFilter *theOutputFilter,
- vtkCellCenters *theCellCenters,
- vtkDataSet* theDataSet,
- VISU_UsedPointsFilter* theUsedPointsFilter )
+ VTKViewer_CellCenters *theCellCenters,
+ vtkDataSet* theDataSet,
+ VISU_UsedPointsFilter* theUsedPointsFilter )
{
if ( VISU::IsDataOnCells( theDataSet ) ) {
theCellCenters->SetInput( theDataSet );
myConeSource = vtkConeSource::New();
myLineSource = vtkLineSource::New();
- myCenters = vtkCellCenters::New();
+ myCenters = VTKViewer_CellCenters::New();
myTransformFilter = VTKViewer_TransformFilter::New();
myUsedPointsFilter = VISU_UsedPointsFilter::New();
void
VISU_VectorsPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
Superclass::Build();
ToCellCenters( myTransformFilter,
- myCenters,
- GetMergedInput(),
- myUsedPointsFilter );
+ myCenters,
+ GetMergedInput(),
+ myUsedPointsFilter );
myGlyph->SetInput( myTransformFilter->GetOutput() );
myGlyph->SetVectorModeToUseVector();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.hxx
// Author: Alexey PETROV
class VTKViewer_TransformFilter;
class VTKViewer_Transform;
-class vtkCellCenters;
+class VTKViewer_CellCenters;
class vtkGlyphSource2D;
class vtkConeSource;
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
GlyphType myTypeGlyph;
GlyphPos myPosGlyph;
vtkLineSource *myLineSource;
vtkConeSource *myConeSource;
- vtkCellCenters* myCenters;
+ VTKViewer_CellCenters* myCenters;
VTKViewer_TransformFilter *myTransformFilter;
VISU_UsedPointsFilter* myUsedPointsFilter;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : VVTK_WidgetCtrl.cxx
// Author : Peter KURNEV
int i;
for (i=0; i<myNbWidgets; ++i){
myWidgets[i]->AddObserver(vtkCommand::EnableEvent,
- myEventCallbackCommand,
- myPriority);
+ myEventCallbackCommand,
+ myPriority);
myWidgets[i]->AddObserver(vtkCommand::DisableEvent,
- myEventCallbackCommand,
- myPriority);
+ myEventCallbackCommand,
+ myPriority);
myWidgets[i]->AddObserver(vtkCommand::EndInteractionEvent,
- myEventCallbackCommand,
- myPriority);
+ myEventCallbackCommand,
+ myPriority);
myWidgets[i]->AddObserver(vtkCommand::StartInteractionEvent,
- myEventCallbackCommand,
- myPriority);
+ myEventCallbackCommand,
+ myPriority);
myWidgets[i]->AddObserver(vtkCommand::InteractionEvent,
- myEventCallbackCommand,
- myPriority);
+ myEventCallbackCommand,
+ myPriority);
}
}
//==================================================================
if (theFlag) {//enabling
if (HasActiveIndex()) {
for (i=0; i<myNbWidgets; ++i) {
- iFlag=(i==myActiveIndex) ? 1 : 0;
- myWidgets[i]->SetEnabled(iFlag);
+ iFlag=(i==myActiveIndex) ? 1 : 0;
+ myWidgets[i]->SetEnabled(iFlag);
}
}
}
// purpose :
//==================================================================
void VISU_WidgetCtrl::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
VISU_WidgetCtrl *aSelf = reinterpret_cast<VISU_WidgetCtrl*>(theClientData);
switch(theEvent){
}
//==================================================================
-vtkFloatingPointType
+vtkFloatingPointType
VISU_WidgetCtrl
::EvaluateFunction(vtkFloatingPointType theX[3])
{
}
//==================================================================
-void
+void
VISU_WidgetCtrl
::EvaluateGradient(vtkFloatingPointType theX[3],
- vtkFloatingPointType theG[3])
+ vtkFloatingPointType theG[3])
{
theG[0] = theG[1] = theG[2] = 0.0;
if(VISU_ImplicitFunctionWidget* aWidget = GetActiveWidget()){
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : VISU_WidgetCtrl.hxx
// Author : Peter KURNEV
vtkImplicitFunction* ImplicitFunction();
virtual
- vtkFloatingPointType
+ vtkFloatingPointType
EvaluateFunction(vtkFloatingPointType theX[3]);
virtual
- void
+ void
EvaluateGradient(vtkFloatingPointType theX[3],
- vtkFloatingPointType theG[3]);
+ vtkFloatingPointType theG[3]);
virtual
unsigned long
VISU_SphereWidget * GetSphereWidget();
//
static void ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCalldata);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCalldata);
//
protected:
VISU_WidgetCtrl();
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
+ *** Modified by OPEN CASCADE
+
=========================================================================*/
#include "VISU_XYPlotActor.hxx"
#define VTK_MAX_PLOTS 50
+#if !defined(VTK_XVERSION)
+#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION)
+#endif
+
using namespace std;
vtkCxxRevisionMacro(VISU_XYPlotActor, "$Revision$");
if (this->AxisLabelTextProperty &&
this->AxisLabelTextProperty->GetMTime() > this->BuildTime)
{
- if (this->XAxis->GetTitleTextProperty())
+ if (this->XAxis->GetLabelTextProperty())
{
this->XAxis->GetLabelTextProperty()->ShallowCopy(
this->AxisLabelTextProperty);
}
- if (this->YAxis->GetTitleTextProperty())
+ if (this->YAxis->GetLabelTextProperty())
{
this->YAxis->GetLabelTextProperty()->ShallowCopy(
this->AxisLabelTextProperty);
this->TitleTextProperty);
}
+
+#if (VTK_XVERSION < 0x050100)
+ //VSV: Function is not supported in VTK 5.2 and high
vtkAxisActor2D::SetFontSize(viewport,
this->TitleMapper,
size,
1.0,
stringSize);
-
+#endif
+
this->TitleActor->GetPositionCoordinate()->SetValue(
pos[0] + 0.5 * (pos2[0] - pos[0]) - stringSize[0] / 2.0,
pos2[1] - stringSize[1] / 2.0);
(ds = this->InputList->GetNextDataSet(dsit)); dsNum++)
{
numPts = ds->GetNumberOfPoints();
+ if (numPts == 0)
+ {
+ vtkErrorMacro(<<"No scalar data to plot!");
+ continue;
+ }
if ( this->XValues != VTK_XYPLOT_INDEX )
{
}//over all datasets
}
+//----------------------------------------------------------------------------
+static inline int VISU_XYPlotActorGetComponent(vtkFieldData* field,
+ vtkIdType tuple, int component, double* val)
+{
+ int array_comp;
+ int array_index = field->GetArrayContainingComponent(component, array_comp);
+ if (array_index < 0)
+ {
+ return 0;
+ }
+ vtkDataArray* da = field->GetArray(array_index);
+ if (!da)
+ {
+ // non-numeric array.
+ return 0;
+ }
+ *val = da->GetComponent(tuple, array_comp);
+ return 1;
+}
+
//----------------------------------------------------------------------------
void VISU_XYPlotActor::ComputeDORange(double xrange[2], double yrange[2],
double *lengths)
vtkFieldData *field;
int doNum, numColumns;
vtkIdType numTuples, numRows, num, ptId, maxNum;
- double maxLength=0.0, x, y, xPrev = 0.0;
+ double maxLength=0.0;
+ double x = 0.0;
+ double y = 0.0;
+ double xPrev = 0.0;
vtkDataArray *array;
-
+
+ // NOTE: FieldData can have non-numeric arrays. However, XY plot can only
+ // work on numeric arrays (or vtkDataArray subclasses).
+
xrange[0] = yrange[0] = VTK_DOUBLE_MAX;
xrange[1] = yrange[1] = -VTK_DOUBLE_MAX;
vtkCollectionSimpleIterator doit;
for ( doNum=0, maxNum=0, this->DataObjectInputList->InitTraversal(doit);
(dobj = this->DataObjectInputList->GetNextDataObject(doit)); doNum++)
{
+
lengths[doNum] = 0.0;
field = dobj->GetFieldData();
- numColumns = field->GetNumberOfComponents(); //number of "columns"
+ numColumns = field->GetNumberOfComponents(); //number of "columns"
+ // numColumns includes the components for non-numeric arrays as well.
for (numRows = VTK_LARGE_ID, i=0; i<field->GetNumberOfArrays(); i++)
{
array = field->GetArray(i);
+ if (!array)
+ {
+ // non-numeric array, skip.
+ continue;
+ }
numTuples = array->GetNumberOfTuples();
if ( numTuples < numRows )
{
// gather the information to form a plot
for ( ptId=0; ptId < num; ptId++ )
{
+ int status = 0;
+
if ( this->DataObjectPlotMode == VTK_XYPLOT_ROW )
{
- x = field->GetComponent(this->XComponent->GetValue(doNum), ptId);
+ // x = field->GetComponent(this->XComponent->GetValue(doNum), ptId);
+ status = ::VISU_XYPlotActorGetComponent(field,
+ this->XComponent->GetValue(doNum), ptId, &x);
}
else //if ( this->DataObjectPlotMode == VTK_XYPLOT_COLUMN )
{
- x = field->GetComponent(ptId, this->XComponent->GetValue(doNum));
+ // x = field->GetComponent(ptId, this->XComponent->GetValue(doNum));
+ status = ::VISU_XYPlotActorGetComponent(field,
+ ptId, this->XComponent->GetValue(doNum), &x);
+ }
+ if (!status)
+ {
+ // requested component falls in a non-numeric array, skip it.
+ continue;
}
if ( ptId == 0 )
{
// Get the y-values
for ( ptId=0; ptId < num; ptId++ )
{
+ int status = 0;
if ( this->DataObjectPlotMode == VTK_XYPLOT_ROW )
{
- y = field->GetComponent(this->YComponent->GetValue(doNum), ptId);
+ //y = field->GetComponent(this->YComponent->GetValue(doNum), ptId);
+ status = ::VISU_XYPlotActorGetComponent(field,
+ this->YComponent->GetValue(doNum), ptId, &y);
}
else //if ( this->DataObjectPlotMode == VTK_XYPLOT_COLUMN )
{
- y = field->GetComponent(ptId, this->YComponent->GetValue(doNum));
+ //y = field->GetComponent(ptId, this->YComponent->GetValue(doNum));
+ status = ::VISU_XYPlotActorGetComponent(field,
+ ptId, this->YComponent->GetValue(doNum), &y);
+ }
+ if (!status)
+ {
+ // requested component falls in non-numeric array.
+ // skip.
+ continue;
}
if ( y < yrange[0] )
{
// determine the shape of the field
field = dobj->GetFieldData();
numColumns = field->GetNumberOfComponents(); //number of "columns"
+ // numColumns also includes non-numeric array components.
for (numRows = VTK_LARGE_ID, i=0; i<field->GetNumberOfArrays(); i++)
{
array = field->GetArray(i);
+ if (!array)
+ {
+ // skip non-numeric arrays.
+ continue;
+ }
numTuples = array->GetNumberOfTuples();
if ( numTuples < numRows )
{
// gather the information to form a plot
for ( numLinePts=0, length=0.0, ptId=0; ptId < numPts; ptId++ )
{
+ int status1, status2;
if ( this->DataObjectPlotMode == VTK_XYPLOT_ROW )
{
- x[0] = field->GetComponent(this->XComponent->GetValue(doNum),ptId);
- xyz[1] = field->GetComponent(this->YComponent->GetValue(doNum),ptId);
+ //x[0] = field->GetComponent(this->XComponent->GetValue(doNum),ptId);
+ //xyz[1] = field->GetComponent(this->YComponent->GetValue(doNum),ptId);
+ status1 = ::VISU_XYPlotActorGetComponent(field,
+ this->XComponent->GetValue(doNum), ptId, &x[0]);
+ status2 = ::VISU_XYPlotActorGetComponent(field,
+ this->YComponent->GetValue(doNum), ptId, &xyz[1]);
}
else //if ( this->DataObjectPlotMode == VTK_XYPLOT_COLUMN )
{
- x[0] = field->GetComponent(ptId, this->XComponent->GetValue(doNum));
- xyz[1] = field->GetComponent(ptId, this->YComponent->GetValue(doNum));
+ //x[0] = field->GetComponent(ptId, this->XComponent->GetValue(doNum));
+ //xyz[1] = field->GetComponent(ptId, this->YComponent->GetValue(doNum));
+
+ status1 = ::VISU_XYPlotActorGetComponent(field,
+ ptId, this->XComponent->GetValue(doNum), &x[0]);
+
+ if (!status1)
+ {
+ vtkWarningMacro(<< this->XComponent->GetValue(doNum) << " is a non-numeric component.");
+ }
+
+ status2 = ::VISU_XYPlotActorGetComponent(field,
+ ptId, this->YComponent->GetValue(doNum), &xyz[1]);
+
+ if (!status2)
+ {
+ vtkWarningMacro(<< this->YComponent->GetValue(doNum) << " is a non-numeric component.");
+ }
+ }
+ if (!status1 || !status2)
+ {
+ // component is non-numeric.
+ // Skip it.
+ continue;
}
switch (this->XValues)
// Estimate the padding around the X and Y axes
tprop->ShallowCopy(axisX->GetTitleTextProperty());
textMapper->SetInput(axisX->GetTitle());
+
+#if (VTK_XVERSION < 0x050100)
+ //VSV: Function is not supported in VTK 5.2 and high
vtkAxisActor2D::SetFontSize(
viewport, textMapper, size, fontFactorX, titleSizeX);
-
+#endif
+
tprop->ShallowCopy(axisY->GetTitleTextProperty());
textMapper->SetInput(axisY->GetTitle());
+
+#if (VTK_XVERSION < 0x050100)
+ //VSV: Function is not supported in VTK 5.2 and high
vtkAxisActor2D::SetFontSize(
viewport, textMapper, size, fontFactorY, titleSizeY);
-
+#endif
+
// At this point the thing to do would be to actually ask the Y axis
// actor to return the largest label.
// In the meantime, let's try with the min and max
sprintf(str2, axisY->GetLabelFormat(), axisY->GetAdjustedRange()[1]);
tprop->ShallowCopy(axisY->GetLabelTextProperty());
textMapper->SetInput(strlen(str1) > strlen(str2) ? str1 : str2);
+
+#if (VTK_XVERSION < 0x050100)
+ //VSV: Function is not supported in VTK 5.2 and high
vtkAxisActor2D::SetFontSize(
viewport, textMapper, size, labelFactorY * fontFactorY, labelSizeY);
-
+#endif
+
// We do only care of the height of the label in the X axis, so let's
// use the min for example
sprintf(str1, axisX->GetLabelFormat(), axisX->GetAdjustedRange()[0]);
tprop->ShallowCopy(axisX->GetLabelTextProperty());
textMapper->SetInput(str1);
+
+#if (VTK_XVERSION < 0x050100)
+ //VSV: Function is not supported in VTK 5.2 and high
vtkAxisActor2D::SetFontSize(
viewport, textMapper, size, labelFactorX * fontFactorX, labelSizeX);
-
+#endif
+
tickOffsetX = axisX->GetTickOffset();
tickOffsetY = axisY->GetTickOffset();
tickLengthX = axisX->GetTickLength();
}
else
{
+ newPts[0] = -1;
if (x1[0] >= p1[0] && x1[0] <= p2[0] && x1[1] >= p1[1] && x1[1] <= p2[1] )
{//first point in
newPts[0] = pointMap[pts[i]];
}
- else
+ else if (x2[0] >= p1[0] && x2[0] <= p2[0] && x2[1] >= p1[1] && x2[1] <= p2[1] )
{//second point in
newPts[0] = pointMap[pts[i+1]];
}
- for (j=0; j<4; j++)
+
+ //only create cell if either x1 or x2 is inside the range
+ if (newPts[0] >= 0)
{
- this->ClipPlanes->GetPoints()->GetPoint(j, px);
- this->ClipPlanes->GetNormals()->GetTuple(j, n);
- if ( vtkPlane::IntersectWithLine(x1,x2,n,px,t,xint) && t >= 0 && t <= 1.0 )
+ for (j=0; j<4; j++)
{
- newPts[1] = newPoints->InsertNextPoint(xint);
- break;
+ this->ClipPlanes->GetPoints()->GetPoint(j, px);
+ this->ClipPlanes->GetNormals()->GetTuple(j, n);
+ if ( vtkPlane::IntersectWithLine(x1,x2,n,px,t,xint) && t >= 0 && t <= 1.0 )
+ {
+ newPts[1] = newPoints->InsertNextPoint(xint);
+ break;
+ }
}
+ newLines->InsertNextCell(2,newPts);
}
- newLines->InsertNextCell(2,newPts);
}
}
}
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
+
+ *** Modified by OPEN CASCADE
=========================================================================*/
// .NAME vtkXYPlotActor - generate an x-y plot from input dataset(s) or field data
* VISU_XYPLOT_RIGHT - the right bottom corner (X axis is directed to the top, Y - to the left)
*/
enum VISU_XYPlotLocation { VISU_XYPLOT_BOTTOM = 0,
- VISU_XYPLOT_TOP, VISU_XYPLOT_LEFT, VISU_XYPLOT_RIGHT };
+ VISU_XYPLOT_TOP, VISU_XYPLOT_LEFT, VISU_XYPLOT_RIGHT };
// RKV : End
class VISU_PIPELINE_EXPORT VISU_XYPlotActor : public vtkActor2D
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_img2vti.cxx
// Author: Oleg UVAROV
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISUGUI : GUI of VISU component
# File : Makefile.am
# Author : Marc Tajchman (CEA)
# Module : VISU
-
+#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
lib_LTLIBRARIES= libVISU.la
# .po files to transform in .qm
nodist_salomeres_DATA= \
- VISU_msg_en.qm VISU_images.qm
+ VISU_msg_en.qm VISU_msg_fr.qm VISU_images.qm
salomeinclude_HEADERS= \
VisuGUI_Tools.h \
VisuGUI.h \
VisuGUI_Module.h \
VisuGUI_Selection.h \
- VisuGUI_Tools.h \
VisuGUI_ViewTools.h \
VisuGUI_NameDlg.h \
VisuGUI_FileDlg.h \
VisuGUI_CursorDlg.h \
VisuGUI_TimeAnimation.h \
+ VisuGUI_EvolutionDlg.h \
VisuGUI_EditContainerDlg.h \
VisuGUI_ClippingDlg.h \
VisuGUI_DialogRunner.h \
VisuGUI_DeformedShapeDlg.h \
VisuGUI_IsoSurfacesDlg.h \
VisuGUI_CutLinesDlg.h \
+ VisuGUI_CutSegmentDlg.h \
VisuGUI_CutPlanesDlg.h \
VisuGUI_StreamLinesDlg.h \
VisuGUI_VectorsDlg.h \
VisuGUI_SetupPlot2dDlg.h \
VisuGUI_BuildProgressDlg.h \
VisuGUI_TransparencyDlg.h \
+ VisuGUI_ShrinkFactorDlg.h \
VisuGUI_Timer.h \
VisuGUI_Slider.h \
VisuGUI_InputPane.h \
- VisuGUI_CacheDlg.h \
VisuGUI_FieldFilter.h \
- VisuGUI_ValuesLabelingDlg.h
+ VisuGUI_ValuesLabelingDlg.h \
+ VisuGUI_PrimitiveBox.h \
+ VisuGUI_SizeBox.h
dist_libVISU_la_SOURCES= \
VisuGUI.cxx \
VisuGUI_FileDlg.cxx \
VisuGUI_CursorDlg.cxx \
VisuGUI_TimeAnimation.cxx \
+ VisuGUI_EvolutionDlg.cxx \
VisuGUI_EditContainerDlg.cxx \
VisuGUI_ClippingDlg.cxx \
VisuGUI_DialogRunner.cxx \
VisuGUI_DeformedShapeDlg.cxx \
VisuGUI_IsoSurfacesDlg.cxx \
VisuGUI_CutLinesDlg.cxx \
+ VisuGUI_CutSegmentDlg.cxx \
VisuGUI_CutPlanesDlg.cxx \
VisuGUI_StreamLinesDlg.cxx \
VisuGUI_VectorsDlg.cxx \
VisuGUI_BuildProgressDlg.cxx \
VisuGUI_Table3dDlg.cxx \
VisuGUI_TransparencyDlg.cxx \
+ VisuGUI_ShrinkFactorDlg.cxx \
VisuGUI_Timer.cxx \
VisuGUI_Slider.cxx \
VisuGUI_Sweep.cxx \
VisuGUI_InputPane.cxx \
- VisuGUI_CacheDlg.cxx \
VisuGUI_FileInfoDlg.cxx \
VisuGUI_FieldFilter.cxx \
VisuGUI_ClippingPanel.cxx \
VisuGUI_ClippingPlaneDlg.cxx \
VisuGUI_FilterScalarsDlg.cxx \
- VisuGUI_ValuesLabelingDlg.cxx
+ VisuGUI_ValuesLabelingDlg.cxx \
+ VisuGUI_PrimitiveBox.cxx \
+ VisuGUI_SizeBox.cxx
MOC_FILES= \
VisuGUI_moc.cxx \
VisuGUI_FileDlg_moc.cxx \
VisuGUI_CursorDlg_moc.cxx \
VisuGUI_TimeAnimation_moc.cxx \
+ VisuGUI_EvolutionDlg_moc.cxx \
VisuGUI_EditContainerDlg_moc.cxx \
VisuGUI_ClippingDlg_moc.cxx \
VisuGUI_DialogRunner_moc.cxx \
VisuGUI_DeformedShapeDlg_moc.cxx \
VisuGUI_IsoSurfacesDlg_moc.cxx \
VisuGUI_CutLinesDlg_moc.cxx \
+ VisuGUI_CutSegmentDlg_moc.cxx \
VisuGUI_CutPlanesDlg_moc.cxx \
VisuGUI_StreamLinesDlg_moc.cxx \
VisuGUI_VectorsDlg_moc.cxx \
VisuGUI_BuildProgressDlg_moc.cxx \
VisuGUI_Table3dDlg_moc.cxx \
VisuGUI_TransparencyDlg_moc.cxx \
+ VisuGUI_ShrinkFactorDlg_moc.cxx \
VisuGUI_Slider_moc.cxx \
VisuGUI_Sweep_moc.cxx \
VisuGUI_InputPane_moc.cxx \
- VisuGUI_CacheDlg_moc.cxx \
VisuGUI_FileInfoDlg_moc.cxx \
VisuGUI_ClippingPanel_moc.cxx \
VisuGUI_ClippingPlaneDlg_moc.cxx \
VisuGUI_FilterScalarsDlg_moc.cxx \
- VisuGUI_ValuesLabelingDlg_moc.cxx
-
+ VisuGUI_ValuesLabelingDlg_moc.cxx \
+ VisuGUI_PrimitiveBox_moc.cxx \
+ VisuGUI_SizeBox_moc.cxx
nodist_libVISU_la_SOURCES=$(MOC_FILES)
$(BOOST_CPPFLAGS) \
$(GUI_CXXFLAGS) \
$(CORBA_CXXFLAGS) $(CORBA_INCLUDES) \
- -I$(srcdir)/../VVTK -I$(srcdir)/../OBJECT -I$(srcdir)/../VISU_I -I$(srcdir)/../GUITOOLS \
- -I$(top_builddir)/idl -I$(srcdir)/../CONVERTOR -I$(srcdir)/../PIPELINE \
- -I$(top_builddir)/salome_adm/unix
+ -I$(srcdir)/../OBJECT -I$(srcdir)/../VISU_I \
+ -I$(top_builddir) -I$(top_builddir)/idl -I$(srcdir)/../CONVERTOR -I$(srcdir)/../PIPELINE
-libVISU_la_LDFLAGS= $(QWT_LIBS) -lSalomeNS $(KERNEL_LDFLAGS) $(GUI_LDFLAGS) -lSVTK -lSPlot2d \
- ../VVTK/libVVTK.la ../OBJECT/libVisuObject.la ../VISU_I/libVISUEngineImpl.la \
- ../GUITOOLS/libVISUGUITOOLS.la \
+libVISU_la_LDFLAGS= \
+ $(QWT_LIBS) \
+ $(CAS_LDFLAGS) -lTKV3d \
+ $(KERNEL_LDFLAGS) -lSalomeNS -lSalomeDSClient \
+ $(GUI_LDFLAGS) -lSVTK -lSPlot2d -lSalomePrs -lOCCViewer -lViewerTools -lvtkTools \
+ ../OBJECT/libVisuObject.la ../VISU_I/libVISUEngineImpl.la \
../../idl/libSalomeIDLVISU.la
if MED_ENABLE_MULTIPR
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
-<TS version="1.1" >
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
<source>ICON_CUT_LINES</source>
<translation>Visu_cutlines.png</translation>
</message>
+ <message>
+ <source>ICON_CUT_SEGMENT</source>
+ <translation>Visu_cutsegment.png</translation>
+ </message>
<message>
<source>ICON_CUT_PLANES</source>
<translation>Visu_cutplanes.png</translation>
<source>ICON_POINT_SELECTION</source>
<translation>Visu_point_selection.png</translation>
</message>
+ <message>
+ <source>ICON_POINT_SPRITE</source>
+ <translation>Visu_point_sprite.png</translation>
+ </message>
<message>
<source>ICON_POINTS</source>
<translation>Visu_points.png</translation>
<source>ICON_TREE_CUT_LINES_GROUPS</source>
<translation>Visu_tree_cutlines_gr.png</translation>
</message>
+ <message>
+ <source>ICON_TREE_CUT_SEGMENT</source>
+ <translation>Visu_tree_cutsegment.png</translation>
+ </message>
+ <message>
+ <source>ICON_TREE_CUT_SEGMENT_GROUPS</source>
+ <translation>Visu_tree_cutsegment_gr.png</translation>
+ </message>
<message>
<source>ICON_TREE_CUT_PLANES</source>
<translation>Visu_tree_cutplanes.png</translation>
<source>ICON_VECTORS</source>
<translation>Visu_vectors.png</translation>
</message>
- <message>
- <source>ICON_VVTK_INTERACTOR_STYLE_SWITCH</source>
- <translation>Visu_vvtk_switch.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_PLANE_SEGMENTATION_SWITCH</source>
- <translation>Visu_PlaneSegmentation.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_RECORDING_PAUSE</source>
- <translation>Visu_recording_pause.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_RECORDING_PLAY</source>
- <translation>Visu_recording_play.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_RECORDING_START</source>
- <translation>Visu_recording_start.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_RECORDING_STOP</source>
- <translation>Visu_recording_stop.png</translation>
- </message>
<message>
<source>ICON_SWEEP_STOP</source>
<translation>Visu_recording_stop.png</translation>
</message>
- <message>
- <source>ICON_VVTK_SELECTION_MODE_SWITCH</source>
- <translation>Visu_points.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_SPHERE_SEGMENTATION_SWITCH</source>
- <translation>Visu_SphereSegmentation.png</translation>
- </message>
<message>
<source>ICON_WIREFRAME</source>
<translation>Visu_wireframe.png</translation>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
-<TS version="1.1" >
- <context>
- <name>@default</name>
- <message>
- <source>ASSIGNED</source>
- <translation>Assigned</translation>
- </message>
- <message>
- <source>ATTRIBUTES_LBL</source>
- <translation>Attributes</translation>
- </message>
- <message>
- <source>AXIS_LBL</source>
- <translation>Axis</translation>
- </message>
- <message>
- <source>BTN_RESET</source>
- <translation>Reset</translation>
- </message>
- <message>
- <source>DATA_LBL</source>
- <translation>Data</translation>
- </message>
- <message>
- <source>ERR_CANT_BUILD_PRESENTATION</source>
- <translation>The object can't be built</translation>
- </message>
- <message>
- <source>ERR_CANT_CREATE_ACTOR</source>
- <translation>Can't create actor for this presentation</translation>
- </message>
- <message>
- <source>ERR_CANT_CREATE_ANIMATION</source>
- <translation>Can't create animation for these fields:
+<TS version="2.0" language="en_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>ASSIGNED</source>
+ <translation>Assigned</translation>
+ </message>
+ <message>
+ <source>ATTRIBUTES_LBL</source>
+ <translation>Attributes</translation>
+ </message>
+ <message>
+ <source>AXIS_LBL</source>
+ <translation>Axis</translation>
+ </message>
+ <message>
+ <source>BTN_RESET</source>
+ <translation>Reset</translation>
+ </message>
+ <message>
+ <source>DATA_LBL</source>
+ <translation>Data</translation>
+ </message>
+ <message>
+ <source>ERR_CANT_BUILD_PRESENTATION</source>
+ <translation>The object can't be built</translation>
+ </message>
+ <message>
+ <source>ERR_CANT_CREATE_ACTOR</source>
+ <translation>Can't create actor for this presentation</translation>
+ </message>
+ <message>
+ <source>ERR_CANT_CREATE_ANIMATION</source>
+ <translation>Can't create animation for these fields:
number of time stamps or number of components is not the same!</translation>
- </message>
- <message>
- <source>ERR_CANT_FIND_MED_COMPONENT</source>
- <translation>Failed to activate MED engine!</translation>
- </message>
- <message>
- <source>ERR_CANT_FIND_VISU_COMPONENT</source>
- <translation>Failed to activate VISU engine!</translation>
- </message>
- <message>
- <source>ERR_NO_MEMORY_TO_BUILD</source>
- <translation>Please, free %1 Mb to make the cache enlarging possible
+ </message>
+ <message>
+ <source>ERR_CANT_CREATE_EVOLUTION</source>
+ <translation>Can't create evolution for this field!</translation>
+ </message>
+ <message>
+ <source>ERR_CANT_FIND_MED_COMPONENT</source>
+ <translation>Failed to activate MED engine!</translation>
+ </message>
+ <message>
+ <source>ERR_CANT_FIND_VISU_COMPONENT</source>
+ <translation>Failed to activate VISU engine!</translation>
+ </message>
+ <message>
+ <source>ERR_NO_MEMORY_TO_BUILD</source>
+ <translation>Please, free %1 Mb to make the cache enlarging possible
(for example, try to delete some holders)</translation>
- </message>
- <message>
- <source>IMPORT_DONE</source>
- <translation>Importing is done</translation>
- </message>
- <message>
- <source>INF_DONE</source>
- <translation> done</translation>
- </message>
- <message>
- <source>INF_VISU</source>
- <translation>Post-Pro Info</translation>
- </message>
- <message>
- <source>NO_GROUPS</source>
- <translation>No groups in the mesh</translation>
- </message>
- <message>
- <source>PARALLEL_ANIMATION</source>
- <translation>Parallel Animation</translation>
- </message>
- <message>
- <source>PERIOD_2PI</source>
- <translation>From -PI to PI</translation>
- </message>
- <message>
- <source>PERIOD_PI</source>
- <translation>From 0 to PI</translation>
- </message>
- <message>
- <source>PRS_ON_GROUPS</source>
- <translation>Use Only Groups</translation>
- </message>
- <message>
- <source>SUCCESSIVE_ANIMATION</source>
- <translation>Successive Animation</translation>
- </message>
- <message>
- <source>TIT_OFFSETDLG</source>
- <translation>Translate Presentation</translation>
- </message>
- <message>
- <source>TLT_SETUP_PLOT2D</source>
- <translation>Setup Plot 2d</translation>
- </message>
- <message>
- <source>UNITS_LBL</source>
- <translation>Units</translation>
- </message>
- <message><source>VISU_3DCACHE_PREFERENCES</source><translation>3D Cache</translation></message>
- <message><source>VISU_ANIMATION_PREFERENCES</source><translation>Animation</translation></message>
- <message>
- <source>VISU_COLORS_AND_LABELS</source>
- <translation>Colors && Labels</translation>
- </message>
- <message>
- <source>VISU_COMPONENT</source>
- <translation>Component</translation>
- </message>
- <message>
- <source>VISU_COS_SWEEP</source>
- <translation>Cosinusoidal ( (1 - cos(t))/2 )</translation>
- </message>
- <message>
- <source>VISU_CUTLINE_PREF</source>
- <translation>CutLine preferences</translation>
- </message>
- <message>
- <source>VISU_CUT_LINES</source>
- <translation>Cut Lines</translation>
- </message>
- <message>
- <source>VISU_CUT_PLANES</source>
- <translation>Cut Planes</translation>
- </message>
- <message>
- <source>VISU_DEFORMED_SHAPE</source>
- <translation>Deformed Shape</translation>
- </message>
- <message>
- <source>VISU_DISP_ONLY</source>
- <translation>Display only on creation</translation>
- </message>
- <message>
- <source>VISU_FEATURE_EDGES</source>
- <translation>Feature edges</translation>
- </message>
- <message>
- <source>VISU_FEATURE_EDGES_ANGLE</source>
- <translation>Feature edges angle</translation>
- </message>
- <message>
- <source>VISU_FEATURE_EDGES_COLORING</source>
- <translation>Coloring</translation>
- </message>
- <message>
- <source>VISU_FEATURE_EDGES_PROPS</source>
- <translation>Feature edges properties</translation>
- </message>
- <message>
- <source>VISU_FIELD_RANGE</source>
- <translation>Field range</translation>
- </message>
- <message>
- <source>VISU_FONT</source>
- <translation>Font</translation>
- </message>
- <message>
- <source>VISU_FONT_ARIAL</source>
- <translation>Arial</translation>
- </message>
- <message>
- <source>VISU_FONT_COURIER</source>
- <translation>Courier</translation>
- </message>
- <message>
- <source>VISU_FONT_TIMES</source>
- <translation>Times</translation>
- </message>
- <message>
- <source>VISU_HEIGHT</source>
- <translation>Height:</translation>
- </message>
- <message>
- <source>VISU_HORIZONTAL</source>
- <translation>Horizontal</translation>
- </message>
- <message>
- <source>VISU_IMPOSED_RANGE</source>
- <translation>Imposed range</translation>
- </message>
- <message>
- <source>VISU_IS2PI</source>
- <translation>Parameter varies:</translation>
- </message>
- <message>
- <source>VISU_ISO_SURFACES</source>
- <translation>Iso Surfaces</translation>
- </message>
- <message>
- <source>VISU_LABELS</source>
- <translation>Labels</translation>
- </message>
- <message>
- <source>VISU_LIMITED</source>
- <translation>Limited</translation>
- </message>
- <message>
- <source>VISU_LINEAR_SWEEP</source>
- <translation>Linear</translation>
- </message>
- <message>
- <source>VISU_LOGARITHMIC_SCALING</source>
- <translation>Logarithmic</translation>
- </message>
- <message>
- <source>VISU_MAX</source>
- <translation>Max:</translation>
- </message>
- <message>
- <source>VISU_MEMORY_LIMIT</source>
- <translation>Memory limit (Mb)</translation>
- </message>
- <message>
- <source>VISU_MEMORY_MODE</source>
- <translation>Memory mode</translation>
- </message>
- <message>
- <source>VISU_MESH</source>
- <translation>Mesh</translation>
- </message>
- <message>
- <source>VISU_MIN</source>
- <translation>Min:</translation>
- </message>
- <message>
- <source>VISU_MINIMAL</source>
- <translation>Minimal</translation>
- </message>
- <message>
- <source>VISU_MINMAX_IMPOSED_RANGE</source>
- <translation>Min and max for imposed range</translation>
- </message>
- <message>
- <source>VISU_MODULUS</source>
- <translation>Modulus</translation>
- </message>
- <message>
- <source>VISU_NB_COLORS</source>
- <translation>Nb. of colors</translation>
- </message>
- <message>
- <source>VISU_NB_CYCLES</source>
- <translation>Number of cycles</translation>
- </message>
- <message>
- <source>VISU_NB_LABELS</source>
- <translation>Nb. of labels</translation>
- </message>
- <message>
- <source>VISU_NB_STEPS</source>
- <translation>Number of steps</translation>
- </message>
- <message>
- <source>VISU_ORIENTATION</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>VISU_ORIGIN_AND_SIZE</source>
- <translation>Origin && Size</translation>
- </message>
- <message>
- <source>VISU_PLOT3D</source>
- <translation>Plot3D</translation>
- </message>
- <message>
- <source>VISU_PREF_MED_FULL_LOAD</source>
- <translation>Full MED loading</translation>
- </message>
- <message>
- <source>VISU_PREF_MED_IMPORT</source>
- <translation>MED files import</translation>
- </message>
- <message>
- <source>VISU_PREF_SECOND_TAB</source>
- <translation>Scalar range, Sweep, MED import, Shading</translation>
- </message>
- <message>
- <source>VISU_RANGE_TO_USE</source>
- <translation>Range to use</translation>
- </message>
- <message>
- <source>VISU_REPRESENT_PROPS</source>
- <translation>Representation properties</translation>
- </message>
- <message>
- <source>VISU_SCALAR_BAR</source>
- <translation>Scalar Bar</translation>
- </message>
- <message>
- <source>VISU_SCALAR_MAP</source>
- <translation>Scalar Map</translation>
- </message>
- <message>
- <source>VISU_SCALAR_MAP_ON_DEFORMED_SHAPE</source>
- <translation>Scalar Map on Def. Shape</translation>
- </message>
- <message>
- <source>VISU_SCALAR_MODE</source>
- <translation>Scalar mode</translation>
- </message>
- <message>
- <source>VISU_SCALAR_RANGE</source>
- <translation>Scalar range:</translation>
- </message>
- <message>
- <source>VISU_SHOW_BOUNDARY_EDGES</source>
- <translation>Show boundary edges</translation>
- </message>
- <message>
- <source>VISU_SHOW_FEATURE_EDGES</source>
- <translation>Show feature edges</translation>
- </message>
- <message>
- <source>VISU_SHOW_MANIFOLD_EDGES</source>
- <translation>Show manifold edges</translation>
- </message>
- <message>
- <source>VISU_SHOW_NON_MANIFOLD_EDGES</source>
- <translation>Show non-manifold edges</translation>
- </message>
- <message>
- <source>VISU_SHRINK</source>
- <translation>Shrink</translation>
- </message>
- <message>
- <source>VISU_SIN_SWEEP</source>
- <translation>Sinusoidal ( sin( t - PI/2 ) )</translation>
- </message>
- <message>
- <source>VISU_STREAM_LINES</source>
- <translation>Stream Lines</translation>
- </message>
- <message>
- <source>VISU_SWEEPING_MODES</source>
- <translation>Mode of the sweeping </translation>
- </message>
- <message>
- <source>VISU_SWEEPING_PREF</source>
- <translation>Sweeping preferences</translation>
- </message>
- <message>
- <source>VISU_TIME_STEP</source>
- <translation>Time step(second)</translation>
- </message>
- <message>
- <source>VISU_TITLE</source>
- <translation>Title</translation>
- </message>
- <message>
- <source>VISU_USE_SHADING</source>
- <translation>Use Shading</translation>
- </message>
- <message>
- <source>VISU_VECTORS</source>
- <translation>Vectors</translation>
- </message>
- <message>
- <source>VISU_VERTICAL</source>
- <translation>Vertical</translation>
- </message>
- <message>
- <source>VISU_WIDTH</source>
- <translation>Width:</translation>
- </message>
- <message>
- <source>VISU_X</source>
- <translation>X:</translation>
- </message>
- <message>
- <source>VISU_Y</source>
- <translation>Y:</translation>
- </message>
- <message>
- <source>WRN_EXTRA_MEMORY_REQUIRED</source>
- <translation>Cache need more memory to build the presentation (%1 Mb).
+ </message>
+ <message>
+ <source>IMPORT_DONE</source>
+ <translation>Importing is done</translation>
+ </message>
+ <message>
+ <source>INF_DONE</source>
+ <translation> done</translation>
+ </message>
+ <message>
+ <source>INF_VISU</source>
+ <translation>Post-Pro Info</translation>
+ </message>
+ <message>
+ <source>NO_GROUPS</source>
+ <translation>No groups in the mesh</translation>
+ </message>
+ <message>
+ <source>PARALLEL_ANIMATION</source>
+ <translation>Parallel Animation</translation>
+ </message>
+ <message>
+ <source>PERIOD_2PI</source>
+ <translation>From -PI to PI</translation>
+ </message>
+ <message>
+ <source>PERIOD_PI</source>
+ <translation>From 0 to PI</translation>
+ </message>
+ <message>
+ <source>PRS_ON_GROUPS</source>
+ <translation>Use Only Groups</translation>
+ </message>
+ <message>
+ <source>SUCCESSIVE_ANIMATION</source>
+ <translation>Successive Animation</translation>
+ </message>
+ <message>
+ <source>TIT_OFFSETDLG</source>
+ <translation>Translate Presentation</translation>
+ </message>
+ <message>
+ <source>TLT_SETUP_PLOT2D</source>
+ <translation>Setup Plot 2d</translation>
+ </message>
+ <message>
+ <source>UNITS_LBL</source>
+ <translation>Units</translation>
+ </message>
+ <message>
+ <source>DVTN_LBL</source>
+ <translation>Deviation</translation>
+ </message>
+ <message>
+ <source>VISU_3DCACHE_PREFERENCES</source>
+ <translation>3D Cache</translation>
+ </message>
+ <message>
+ <source>VISU_ANIMATION_PREFERENCES</source>
+ <translation>Animation</translation>
+ </message>
+ <message>
+ <source>VISU_COLORS_AND_LABELS</source>
+ <translation>Colors && Labels</translation>
+ </message>
+ <message>
+ <source>VISU_COMPONENT</source>
+ <translation>Component</translation>
+ </message>
+ <message>
+ <source>VISU_COS_SWEEP</source>
+ <translation>Cosinusoidal ( (1 - cos(t))/2 )</translation>
+ </message>
+ <message>
+ <source>VISU_CUT_LINES</source>
+ <translation>Cut Lines</translation>
+ </message>
+ <message>
+ <source>VISU_CUT_LINES_SEGMENT</source>
+ <translation>Cut Lines/Segment</translation>
+ </message>
+ <message>
+ <source>VISU_CUT_LINES_SEGMENT_PREF</source>
+ <translation>Cut Lines/Segment preferences</translation>
+ </message>
+ <message>
+ <source>VISU_CUT_SEGMENT</source>
+ <translation>Cut Segment</translation>
+ </message>
+ <message>
+ <source>VISU_CUT_PLANES</source>
+ <translation>Cut Planes</translation>
+ </message>
+ <message>
+ <source>VISU_DEFORMED_SHAPE</source>
+ <translation>Deformed Shape</translation>
+ </message>
+ <message>
+ <source>VISU_DEFORMED_SHAPE_AND_SCALAR_MAP</source>
+ <translation>Deformed Shape and Scalar map</translation>
+ </message>
+ <message>
+ <source>VISU_DISP_ONLY</source>
+ <translation>Display only on creation</translation>
+ </message>
+ <message>
+ <source>VISU_DUMP_MODE</source>
+ <translation>Dump mode</translation>
+ </message>
+ <message>
+ <source>VISU_DUMP_PICTURES</source>
+ <translation>Save pictures to directory</translation>
+ </message>
+ <message>
+ <source>VISU_DUMP_VIDEO</source>
+ <translation>Save animation to AVI file</translation>
+ </message>
+ <message>
+ <source>VISU_EDGE_COLOR</source>
+ <translation>Edge Color</translation>
+ </message>
+ <message>
+ <source>VISU_ELEM0D_SIZE</source>
+ <translation>Size of 0D elements</translation>
+ </message>
+ <message>
+ <source>VISU_FEATURE_EDGES</source>
+ <translation>Feature edges</translation>
+ </message>
+ <message>
+ <source>VISU_FEATURE_EDGES_ANGLE</source>
+ <translation>Feature edges angle</translation>
+ </message>
+ <message>
+ <source>VISU_FEATURE_EDGES_COLORING</source>
+ <translation>Coloring</translation>
+ </message>
+ <message>
+ <source>VISU_FEATURE_EDGES_PROPS</source>
+ <translation>Feature edges properties</translation>
+ </message>
+ <message>
+ <source>VISU_FIELD_RANGE</source>
+ <translation>Field range</translation>
+ </message>
+ <message>
+ <source>VISU_FONT</source>
+ <translation>Font</translation>
+ </message>
+ <message>
+ <source>VISU_FONT_ARIAL</source>
+ <translation>Arial</translation>
+ </message>
+ <message>
+ <source>VISU_FONT_COURIER</source>
+ <translation>Courier</translation>
+ </message>
+ <message>
+ <source>VISU_FONT_TIMES</source>
+ <translation>Times</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_METRIC</source>
+ <translation>Gauss Metric</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_METRIC_AVERAGE</source>
+ <translation>Average</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_METRIC_MAXIMUM</source>
+ <translation>Maximum</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_METRIC_MINIMUM</source>
+ <translation>Minimum</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_METRIC_TOOLTIP</source>
+ <translation>Select the data to display on the cell</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_POINT</source>
+ <translation>Gauss Point</translation>
+ </message>
+ <message>
+ <source>VISU_HEIGHT</source>
+ <translation>Height:</translation>
+ </message>
+ <message>
+ <source>VISU_HORIZONTAL</source>
+ <translation>Horizontal</translation>
+ </message>
+ <message>
+ <source>VISU_IMPOSED_RANGE</source>
+ <translation>Imposed range</translation>
+ </message>
+ <message>
+ <source>VISU_IS2PI</source>
+ <translation>Parameter varies:</translation>
+ </message>
+ <message>
+ <source>VISU_ISO_SURFACES</source>
+ <translation>Iso Surfaces</translation>
+ </message>
+ <message>
+ <source>VISU_LABELS</source>
+ <translation>Labels</translation>
+ </message>
+ <message>
+ <source>VISU_LIMITED</source>
+ <translation>Limited</translation>
+ </message>
+ <message>
+ <source>VISU_LINEAR_SWEEP</source>
+ <translation>Linear</translation>
+ </message>
+ <message>
+ <source>VISU_LOGARITHMIC_SCALING</source>
+ <translation>Logarithmic</translation>
+ </message>
+ <message>
+ <source>VISU_MARKER_SCALE</source>
+ <translation>Scale of marker</translation>
+ </message>
+ <message>
+ <source>VISU_MAX</source>
+ <translation>Max:</translation>
+ </message>
+ <message>
+ <source>VISU_MEMORY_LIMIT</source>
+ <translation>Memory limit (Mb)</translation>
+ </message>
+ <message>
+ <source>VISU_MEMORY_MODE</source>
+ <translation>Memory mode</translation>
+ </message>
+ <message>
+ <source>VISU_MESH</source>
+ <translation>Mesh</translation>
+ </message>
+ <message>
+ <source>VISU_MIN</source>
+ <translation>Min:</translation>
+ </message>
+ <message>
+ <source>VISU_MINIMAL</source>
+ <translation>Minimal</translation>
+ </message>
+ <message>
+ <source>VISU_MINMAX_IMPOSED_RANGE</source>
+ <translation>Min and max for imposed range</translation>
+ </message>
+ <message>
+ <source>VISU_MODULUS</source>
+ <translation>Modulus</translation>
+ </message>
+ <message>
+ <source>VISU_NB_COLORS</source>
+ <translation>Nb. of colors</translation>
+ </message>
+ <message>
+ <source>VISU_NB_CYCLES</source>
+ <translation>Number of cycles</translation>
+ </message>
+ <message>
+ <source>VISU_NB_LABELS</source>
+ <translation>Nb. of labels</translation>
+ </message>
+ <message>
+ <source>VISU_NB_STEPS</source>
+ <translation>Number of steps</translation>
+ </message>
+ <message>
+ <source>VISU_NO_DUMP</source>
+ <translation>No dump</translation>
+ </message>
+ <message>
+ <source>VISU_ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>VISU_ORIGIN_AND_SIZE</source>
+ <translation>Origin && Size</translation>
+ </message>
+ <message>
+ <source>VISU_PLOT3D</source>
+ <translation>Plot3D</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_MED_FULL_LOAD</source>
+ <translation>Full MED loading</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_MED_IMPORT</source>
+ <translation>MED files import</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_SECOND_TAB</source>
+ <translation>Scalar range, Sweep, MED import, Shading</translation>
+ </message>
+ <message>
+ <source>VISU_RANGE_TO_USE</source>
+ <translation>Range to use</translation>
+ </message>
+ <message>
+ <source>VISU_REPRESENT_PROPS</source>
+ <translation>Representation properties</translation>
+ </message>
+ <message>
+ <source>VISU_SCALAR_BAR</source>
+ <translation>Scalar Bar</translation>
+ </message>
+ <message>
+ <source>VISU_SCALAR_MAP</source>
+ <translation>Scalar Map</translation>
+ </message>
+ <message>
+ <source>VISU_SCALAR_MAP_ON_DEFORMED_SHAPE</source>
+ <translation>Scalar Map on Def. Shape</translation>
+ </message>
+ <message>
+ <source>VISU_SCALAR_MODE</source>
+ <translation>Scalar mode</translation>
+ </message>
+ <message>
+ <source>VISU_SCALAR_RANGE</source>
+ <translation>Scalar range:</translation>
+ </message>
+ <message>
+ <source>VISU_SHOW_BOUNDARY_EDGES</source>
+ <translation>Show boundary edges</translation>
+ </message>
+ <message>
+ <source>VISU_SHOW_FEATURE_EDGES</source>
+ <translation>Show feature edges</translation>
+ </message>
+ <message>
+ <source>VISU_SHOW_MANIFOLD_EDGES</source>
+ <translation>Show manifold edges</translation>
+ </message>
+ <message>
+ <source>VISU_SHOW_NON_MANIFOLD_EDGES</source>
+ <translation>Show non-manifold edges</translation>
+ </message>
+ <message>
+ <source>VISU_SHRINK</source>
+ <translation>Shrink</translation>
+ </message>
+ <message>
+ <source>VISU_SIN_SWEEP</source>
+ <translation>Sinusoidal ( sin( t - PI/2 ) )</translation>
+ </message>
+ <message>
+ <source>VISU_STREAM_LINES</source>
+ <translation>Stream Lines</translation>
+ </message>
+ <message>
+ <source>VISU_STREAM_LINES_PREF</source>
+ <translation>Stream Lines Preferences</translation>
+ </message>
+ <message>
+ <source>VISU_STREAM_LINES_USED_POINTS</source>
+ <translation>Used points</translation>
+ </message>
+ <message>
+ <source>VISU_SWEEPING_MODES</source>
+ <translation>Mode of the sweeping </translation>
+ </message>
+ <message>
+ <source>VISU_SWEEPING_PREF</source>
+ <translation>Sweeping preferences</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES</source>
+ <translation>Tables</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_EDITING_PROPS</source>
+ <translation>Tables editing properties</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_ENABLE_EDITING</source>
+ <translation>Enable editing</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_SORT_POLICY</source>
+ <translation>Sort policy</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_EMPTY_LOWEST</source>
+ <translation>Empty cells are considered as lowest values</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_EMPTY_HIGHEST</source>
+ <translation>Empty cells are considered as highest values</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_EMPTY_FIRST</source>
+ <translation>Empty cells are always first</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_EMPTY_LAST</source>
+ <translation>Empty cells are always last</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_EMPTY_IGNORE</source>
+ <translation>Empty cells are ignored</translation>
+ </message>
+ <message>
+ <source>VISU_TIME_STAMP_FREQUENCY</source>
+ <translation>Time stamp frequency (for AVI generation)</translation>
+ </message>
+ <message>
+ <source>VISU_TIME_STEP</source>
+ <translation>Time step(second)</translation>
+ </message>
+ <message>
+ <source>VISU_TITLE</source>
+ <translation>Title</translation>
+ </message>
+ <message>
+ <source>VISU_TYPE_OF_MARKER</source>
+ <translation>Type of marker</translation>
+ </message>
+ <message>
+ <source>QUADRATIC_REPRESENT_MODE</source>
+ <translation>Representation of the 2D quadratic elements</translation>
+ </message>
+ <message>
+ <source>MAX_ARC_ANGLE</source>
+ <translation>Maximum angle</translation>
+ </message>
+ <message>
+ <source>VISU_SHRINK_FACTOR</source>
+ <translation>Shrink Factor</translation>
+ </message>
+ <message>
+ <source>VISU_USE_SHADING</source>
+ <translation>Use Shading</translation>
+ </message>
+ <message>
+ <source>VISU_VECTORS</source>
+ <translation>Vectors</translation>
+ </message>
+ <message>
+ <source>VISU_VERTICAL</source>
+ <translation>Vertical</translation>
+ </message>
+ <message>
+ <source>VISU_WIDTH</source>
+ <translation>Width:</translation>
+ </message>
+ <message>
+ <source>VISU_X</source>
+ <translation>X:</translation>
+ </message>
+ <message>
+ <source>VISU_Y</source>
+ <translation>Y:</translation>
+ </message>
+ <message>
+ <source>WRN_EXTRA_MEMORY_REQUIRED</source>
+ <translation>Cache need more memory to build the presentation (%1 Mb).
Do you want to enlarge the cache?</translation>
- </message>
- <message>
- <source>WRN_NO_AVAILABLE_DATA</source>
- <translation>No Available data in selection</translation>
- </message>
- <message>
- <source>WRN_STUDY_LOCKED</source>
- <translation>Current Study is locked</translation>
- </message>
- <message>
- <source>WRN_VISU</source>
- <translation>Post-Pro Warning</translation>
- </message>
- <message>
- <source>WRN_VISU_WARNING</source>
- <translation>Warning</translation>
- </message>
- <message>
- <source>INF_FAILED</source>
- <translation> failed!</translation>
- </message>
- <message>
- <source>VISU_IS_UNITS</source>
- <translation>Display units in title</translation>
- </message>
- <message>
- <source>VISU_LABELS_FORMAT</source>
- <translation>Labels format</translation>
- </message>
- <message>
- <source>VISU_TITLE_SIZE</source>
- <translation>Title size (%):</translation>
- </message>
- <message>
- <source>VISU_TITLE_HEIGHT</source>
- <translation>Title height (%):</translation>
- </message>
- <message>
- <source>VISU_LABEL_SIZE</source>
- <translation>Label size (%):</translation>
- </message>
- <message>
- <source>VISU_LABEL_HEIGHT</source>
- <translation>Label height (%):</translation>
- </message>
- <message>
- <source>VISU_BAR_WIDTH</source>
- <translation>Bar width (%):</translation>
- </message>
- <message>
- <source>VISU_BAR_HEIGHT</source>
- <translation>Bar height (%):</translation>
- </message>
- <message>
- <source>VISU_AUTOMATIC_FIT_ALL</source>
- <translation>Automatic Fit All</translation>
- </message>
- <message>
- <source>VISU_DEFORMED_SHAPE_AND_SCALAR_MAP</source>
- <translation>Def. Shape and Scalar Map</translation>
- </message>
- <message>
- <source>VISU_FLOATING_POINT_PRECISION</source>
- <translation>Floating Point Precision</translation>
- </message>
- <message>
- <source>VISU_REALLY_DELETE</source>
- <translation>Do you really want to delete this %1 object(s): %2</translation>
- </message>
- <message>
- <source>WRN_NO_APPROPRIATE_SELECTION</source>
- <translation>No appropriate objects selected</translation>
- </message>
- </context>
- <context>
- <name>VVTK_MainWindow</name>
- <message>
- <source>DSC_VVTK_RECORDING_PAUSE</source>
- <translation>Pause recording</translation>
- </message>
- <message>
- <source>DSC_VVTK_RECORDING_PLAY</source>
- <translation>Play recording</translation>
- </message>
- <message>
- <source>DSC_VVTK_RECORDING_START</source>
- <translation>Start recording</translation>
- </message>
- <message>
- <source>DSC_VVTK_RECORDING_STOP</source>
- <translation>Stop recording</translation>
- </message>
- <message>
- <source>LBL_TOOLBAR_RECORD_LABEL</source>
- <translation>Recording Operations</translation>
- </message>
- <message>
- <source>MNU_VVTK_RECORDING_PAUSE</source>
- <translation>Pause recording</translation>
- </message>
- <message>
- <source>MNU_VVTK_RECORDING_PLAY</source>
- <translation>Play recording</translation>
- </message>
- <message>
- <source>MNU_VVTK_RECORDING_START</source>
- <translation>Start recording</translation>
- </message>
- <message>
- <source>MNU_VVTK_RECORDING_STOP</source>
- <translation>Stop recording</translation>
- </message>
- <message>
- <source>MSG_NO_AVI_MAKER</source>
- <translation>Tool jpeg2yuv, necessary for AVI recording, is not available.
-Please, refer to the documentation.</translation>
- </message>
- </context>
- <context>
- <name>VVTK_MainWindow1</name>
- <message>
- <source>DSC_VVTK_INTERACTOR_STYLE_SWITCH</source>
- <translation>Interaction Style Switch</translation>
- </message>
- <message>
- <source>DSC_VVTK_PLANE_SEGMENTATION_SWITCH</source>
- <translation>Plane Segmentation</translation>
- </message>
- <message>
- <source>DSC_VVTK_SELECTION_MODE_SWITCH</source>
- <translation>Selection Mode Switch</translation>
- </message>
- <message>
- <source>DSC_VVTK_SPHERE_SEGMENTATION_SWITCH</source>
- <translation>Sphere Segmentation</translation>
- </message>
- <message>
- <source>LBL_TOOLBAR_GAUSS_LABEL</source>
- <translation>Gauss Viewer Tools</translation>
- </message>
- <message>
- <source>MNU_VVTK_INTERACTOR_STYLE_SWITCH</source>
- <translation>Interaction Style Switch</translation>
- </message>
- <message>
- <source>MNU_VVTK_PLANE_SEGMENTATION_SWITCH</source>
- <translation>Plane Segmentation</translation>
- </message>
- <message>
- <source>MNU_VVTK_SELECTION_MODE_SWITCH</source>
- <translation>Selection Mode Switch</translation>
- </message>
- <message>
- <source>MNU_VVTK_SPHERE_SEGMENTATION_SWITCH</source>
- <translation>Sphere Segmentation</translation>
- </message>
- </context>
- <context>
- <name>VVTK_PickingDlg</name>
- <message>
- <source>BELOW_POINT</source>
- <translation>Centered below the point</translation>
- </message>
- <message>
- <source>CAMERA_TITLE</source>
- <translation>Movement of the camera</translation>
- </message>
- <message>
- <source>CURSOR_SIZE</source>
- <translation>Size of the cursor :</translation>
- </message>
- <message>
- <source>CURSOR_TITLE</source>
- <translation>Cursor</translation>
- </message>
- <message>
- <source>DISPLAY_PARENT_MESH</source>
- <translation>Display parent mesh element</translation>
- </message>
- <message>
- <source>INFO_WINDOW_TITLE</source>
- <translation>Information window</translation>
- </message>
- <message>
- <source>PARENT_MESH_TITLE</source>
- <translation>Parent mesh element</translation>
- </message>
- <message>
- <source>PICKING_DLG_TITLE</source>
- <translation>Picking</translation>
- </message>
- <message>
- <source>POINT_TOLERANCE</source>
- <translation>Point tolerance :</translation>
- </message>
- <message>
- <source>POSITION</source>
- <translation>Position :</translation>
- </message>
- <message>
- <source>PYRAMID_HEIGHT</source>
- <translation>Height of the pyramids :</translation>
- </message>
- <message>
- <source>SELECTION_COLOR</source>
- <translation>Selection cursor color :</translation>
- </message>
- <message>
- <source>STEP_NUMBER</source>
- <translation>Number of steps between two positions :</translation>
- </message>
- <message>
- <source>TOLERANCE_TITLE</source>
- <translation>Tolerance</translation>
- </message>
- <message>
- <source>TOP_LEFT_CORNER</source>
- <translation>Top-left corner of the 3D view</translation>
- </message>
- <message>
- <source>TRANSPARENCY</source>
- <translation>Transparency :</translation>
- </message>
- <message>
- <source>ZOOM_FACTOR</source>
- <translation>Zoom at first selected point (ratio) :</translation>
- </message>
- <message>
- <source>DATA_POSITION</source>
- <translation>Position</translation>
- </message>
- <message>
- <source>PARENT_ELEMENT</source>
- <translation>Parent mesh element ID:</translation>
- </message>
- <message>
- <source>LOCAL_POINT</source>
- <translation>Local Gauss Point ID:</translation>
- </message>
- </context>
- <context>
- <name>VVTK_PrimitiveBox</name>
- <message>
- <source>ALPHA_TEXTURE</source>
- <translation>Alpha Channel Texture (16x16) : </translation>
- </message>
- <message>
- <source>ALPHA_THRESHOLD</source>
- <translation>Alpha Channel Threshold : </translation>
- </message>
- <message>
- <source>CLAMP</source>
- <translation>Maximum Size (Clamp) : </translation>
- </message>
- <message>
- <source>FACE_LIMIT</source>
- <translation>Notify when number of faces exceeds : </translation>
- </message>
- <message>
- <source>FACE_NUMBER</source>
- <translation>Number of faces : </translation>
- </message>
- <message>
- <source>GEOMETRICAL_SPHERE</source>
- <translation>Geometrical Sphere</translation>
- </message>
- <message>
- <source>MAIN_TEXTURE</source>
- <translation>Main Texture (16x16) : </translation>
- </message>
- <message>
- <source>OPENGL_POINT</source>
- <translation>OpenGL Point</translation>
- </message>
- <message>
- <source>POINT_SPRITE</source>
- <translation>Point Sprite</translation>
- </message>
- <message>
- <source>PRIMITIVE_TITLE</source>
- <translation>Primitive</translation>
- </message>
- <message>
- <source>RESOLUTION</source>
- <translation>Resolution : </translation>
- </message>
- </context>
- <context>
- <name>VVTK_RecorderDlg</name>
- <message>
- <source>ALL_DISLPAYED_FRAMES</source>
- <translation>Recording all displayed frames</translation>
- </message>
- <message>
- <source>CLOSE</source>
- <translation>Close</translation>
- </message>
- <message>
- <source>DLG_RECORDER_TITLE</source>
- <translation>Recorder</translation>
- </message>
- <message>
- <source>FILE_NAME</source>
- <translation>Save to file : </translation>
- </message>
- <message>
- <source>FLT_ALL_FILES</source>
- <translation>All Files (*.*)</translation>
- </message>
- <message>
- <source>FLT_AVI_FILES</source>
- <translation>AVI Files (*.avi)</translation>
- </message>
- <message>
- <source>FPS</source>
- <translation>FPS : </translation>
- </message>
- <message>
- <source>PROGRESSIVE</source>
- <translation>Progressive</translation>
- </message>
- <message>
- <source>QUALITY</source>
- <translation>Quality : </translation>
- </message>
- <message>
- <source>RECORDING_MODE</source>
- <translation>Mode : </translation>
- </message>
- <message>
- <source>SETTINGS</source>
- <translation>Settings</translation>
- </message>
- <message>
- <source>SKIPPED_FRAMES</source>
- <translation>Recording at a given FPS</translation>
- </message>
- <message>
- <source>START</source>
- <translation>Start</translation>
- </message>
- </context>
- <context>
- <name>VVTK_SegmentationCursorDlg</name>
- <message>
- <source>DEPTH</source>
- <translation>Depth of the cursor: </translation>
- </message>
- <message>
- <source>DEPTH_TITLE</source>
- <translation>Depth</translation>
- </message>
- <message>
- <source>DIRECTION_DX</source>
- <translation>DX: </translation>
- </message>
- <message>
- <source>DIRECTION_DY</source>
- <translation>DY: </translation>
- </message>
- <message>
- <source>DIRECTION_DZ</source>
- <translation>DZ: </translation>
- </message>
- <message>
- <source>DIRECTION_TITLE</source>
- <translation>Direction</translation>
- </message>
- <message>
- <source>GAUSS_POINTS_TAB</source>
- <translation>Gauss Points</translation>
- </message>
- <message>
- <source>INCREMENT</source>
- <translation>+/- Ratio : </translation>
- </message>
- <message>
- <source>INSIDE_GAUSS_POINTS</source>
- <translation>Inside Cursor Gauss Points Presentation</translation>
- </message>
- <message>
- <source>MAGNIFICATION</source>
- <translation>Magnification (%) : </translation>
- </message>
- <message>
- <source>MAGNIFICATION_TITLE</source>
- <translation>Magnification</translation>
- </message>
- <message>
- <source>ORIGIN_TITLE</source>
- <translation>Origin</translation>
- </message>
- <message>
- <source>ORIGIN_X</source>
- <translation>X: </translation>
- </message>
- <message>
- <source>ORIGIN_Y</source>
- <translation>Y: </translation>
- </message>
- <message>
- <source>ORIGIN_Z</source>
- <translation>Z: </translation>
- </message>
- <message>
- <source>OUTSIDE_GAUSS_POINTS</source>
- <translation>Outside Cursor Gauss Points Presentation</translation>
- </message>
- <message>
- <source>RADIUS</source>
- <translation>Radius of the cursor :</translation>
- </message>
- <message>
- <source>RADIUS_TITLE</source>
- <translation>Radius</translation>
- </message>
- <message>
- <source>RATIO</source>
- <translation>+/- Ratio :</translation>
- </message>
- <message>
- <source>SEGMENTATION_CURSOR_DLG_TITLE</source>
- <translation>Segmentation Cursor</translation>
- </message>
- <message>
- <source>SEGMENTATION_CURSOR_TAB</source>
- <translation>Segmentation Cursor</translation>
- </message>
- </context>
- <context>
- <name>VVTK_SizeBox</name>
- <message>
- <source>COLOR</source>
- <translation>Color : </translation>
- </message>
- <message>
- <source>COLOR_TITLE</source>
- <translation>Color</translation>
- </message>
- <message>
- <source>GEOM_SIZE</source>
- <translation>Size of points (%) : </translation>
- </message>
- <message>
- <source>INCREMENT</source>
- <translation>+/- Ratio : </translation>
- </message>
- <message>
- <source>MAGNIFICATION</source>
- <translation>Magnification (%) : </translation>
- </message>
- <message>
- <source>MAX_SIZE</source>
- <translation>max size (%) : </translation>
- </message>
- <message>
- <source>MIN_SIZE</source>
- <translation>Range values for min size (%) : </translation>
- </message>
- <message>
- <source>OUTSIDE_SIZE</source>
- <translation>Percentage of normal size(%) : </translation>
- </message>
- <message>
- <source>SIZE_TITLE</source>
- <translation>Size</translation>
- </message>
- <message>
- <source>UNIFORM_COLOR</source>
- <translation>Uniform Color</translation>
- </message>
- </context>
- <context>
- <name>VVTK_ViewManager</name>
- <message>
- <source>VTK_VIEW_TITLE</source>
- <translation>Gauss scene:%1 - viewer:%2</translation>
- </message>
- </context>
- <context>
- <name>VVTK_ViewWindow</name>
- <message>
- <source>LBL_TOOLBAR_LABEL</source>
- <translation>GAUSS viewer tools</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI</name>
- <message>
- <source>PRECISION</source>
- <translation>Precision</translation>
- </message>
- <message>
- <source>DLG_LINEWIDTH_CMT1</source>
- <translation>Set value between</translation>
- </message>
- <message>
- <source>DLG_LINEWIDTH_CMT2</source>
- <translation>1 (thin) and 10 (thick)</translation>
- </message>
- <message>
- <source>DLG_LINEWIDTH_TITLE</source>
- <translation>Line Width</translation>
- </message>
- <message>
- <source>DLG_OPACITY_CMT1</source>
- <translation>Set value between</translation>
- </message>
- <message>
- <source>DLG_OPACITY_CMT2</source>
- <translation>0 (transparent) and 100 (opaque)</translation>
- </message>
- <message>
- <source>DLG_OPACITY_TITLE</source>
- <translation>Opacity</translation>
- </message>
- <message>
- <source>ERR_ACTIVATE_VIEW3D</source>
- <translation>Please activate 3D view before</translation>
- </message>
- <message>
- <source>ERR_ERROR_DURING_EXPORT</source>
- <translation>Error has been occured during exporting to file</translation>
- </message>
- <message>
- <source>ERR_SCALARBAR_PARAMS</source>
- <translation>Warning! The parameters is incorrect</translation>
- </message>
- <message>
- <source>FLT_ALL_FILES</source>
- <translation>All Files (*.*)</translation>
- </message>
- <message>
- <source>FLT_MED_FILES</source>
- <translation>MED Files (*.med)</translation>
- </message>
- <message>
- <source>FLT_TABLE_FILES</source>
- <translation>Tables (*.xls *.txt *.tab)</translation>
- </message>
- <message>
- <source>IMPORT_FROM_FILE</source>
- <translation>Import from File</translation>
- </message>
- <message>
- <source>MEN_ACTOR_SELECTION</source>
- <translation>Actor Selection</translation>
- </message>
- <message>
- <source>MEN_ARRANGE_ACTORS</source>
- <translation>Arrange Actors</translation>
- </message>
- <message>
- <source>MEN_MANAGE_CACHE</source>
- <translation>Manage</translation>
- </message>
- <message>
- <source>MEN_CELL_COLOR</source>
- <translation>Cell Color</translation>
- </message>
- <message>
- <source>MEN_CELL_SELECTION</source>
- <translation>Cell Selection</translation>
- </message>
- <message>
- <source>MEN_CLEAR_CONTAINER</source>
- <translation>Clear</translation>
- </message>
- <message>
- <source>MEN_CLIPPING</source>
- <translation>Clipping Planes</translation>
- </message>
- <message>
- <source>MEN_COLOR</source>
- <translation>Color...</translation>
- </message>
- <message>
- <source>MEN_COPY_PRS</source>
- <translation>Copy</translation>
- </message>
- <message>
- <source>MEN_CREATE_CURVES</source>
- <translation>Create Curves</translation>
- </message>
- <message>
- <source>MEN_CREATE_MANY_PRS</source>
- <translation>Create Presentations</translation>
- </message>
- <message>
- <source>MEN_CREATE_PLOT2D</source>
- <translation>Create Plot2d View</translation>
- </message>
- <message>
- <source>MEN_CREATE_PRS</source>
- <translation>Create Presentation</translation>
- </message>
- <message>
- <source>MEN_CREATE_TABLE</source>
- <translation>Create Table</translation>
- </message>
- <message>
- <source>MEN_CUBE_AXES</source>
- <translation>Graduated Axes</translation>
- </message>
- <message>
- <source>MEN_CURVE_PROPS</source>
- <translation>Properties...</translation>
- </message>
- <message>
- <source>MEN_CUT_LINES</source>
- <translation>Cut Lines</translation>
- </message>
- <message>
- <source>MEN_CUT_PLANES</source>
- <translation>Cut Planes</translation>
- </message>
- <message>
- <source>MEN_DEFORMED_SHAPE</source>
- <translation>Deformed Shape</translation>
- </message>
- <message>
- <source>MEN_DELETE_OBJS</source>
- <translation>Delete</translation>
- </message>
- <message>
- <source>MEN_DELETE_VIEWPARAMS</source>
- <translation>Delete View Parameters</translation>
- </message>
- <message>
- <source>MEN_SHOW</source>
- <translation>Show</translation>
- </message>
- <message>
- <source>MEN_SHOW_SCALAR_BAR</source>
- <translation>Show Scalar Bar</translation>
- </message>
- <message>
- <source>MEN_DISPLAY_ONLY</source>
- <translation>Show Only</translation>
- </message>
- <message>
- <source>MEN_DISPLAY_SELECTION</source>
- <translation>Display Selection</translation>
- </message>
- <message>
- <source>MEN_EDGE_COLOR</source>
- <translation>Edge Color</translation>
- </message>
- <message>
- <source>MEN_EDIT_CONTAINER</source>
- <translation>Edit...</translation>
- </message>
- <message>
- <source>MEN_EDIT_PRS</source>
- <translation>Edit...</translation>
- </message>
- <message>
- <source>MEN_HIDE</source>
- <translation>Hide</translation>
- </message>
- <message>
- <source>MEN_HIDE_SCALAR_BAR</source>
- <translation>Hide Scalar Bar</translation>
- </message>
- <message>
- <source>MEN_ERASE_ALL</source>
- <translation>Hide All</translation>
- </message>
- <message>
- <source>MEN_EXPORT_TABLE</source>
- <translation>Export Table</translation>
- </message>
- <message>
- <source>MEN_FEATURE_EDGES</source>
- <translation>Feature Edges</translation>
- </message>
- <message>
- <source>MEN_FEATURE_EDGES_DISABLE</source>
- <translation>Disable Feature Edges</translation>
- </message>
- <message>
- <source>MEN_FREE_SCALAR_BARS</source>
- <translation>Use Field Range</translation>
- </message>
- <message>
- <source>MEN_GAUSS_POINT_SELECTION</source>
- <translation>Gauss Point Selection</translation>
- </message>
- <message>
- <source>MEN_GLOBAL_SELECTION</source>
- <translation>Global Selection</translation>
- </message>
- <message>
- <source>MEN_HOLO_RENDER</source>
- <translation>Holo Render</translation>
- </message>
- <message>
- <source>MEN_IMPORT</source>
- <translation>Import</translation>
- </message>
- <message>
- <source>MEN_IMPORT_FROM_FILE</source>
- <translation>MED File</translation>
- </message>
- <message>
- <source>MEN_IMPORT_MED_FIELD</source>
- <translation>Import Field</translation>
- </message>
- <message>
- <source>MEN_IMPORT_MED_STRUCTURE</source>
- <translation>Import Structure</translation>
- </message>
- <message>
- <source>MEN_IMPORT_MED_TIMESTAMP</source>
- <translation>Import TimeStamp</translation>
- </message>
- <message>
- <source>MEN_IMPORT_TABLE</source>
- <translation>Table From File</translation>
- </message>
- <message>
- <source>MEN_INSIDEFRAME</source>
- <translation>Insideframe</translation>
- </message>
- <message>
- <source>MEN_ISO_SURFACES</source>
- <translation>Iso Surfaces</translation>
- </message>
- <message>
- <source>MEN_LINE_WIDTH</source>
- <translation>Line Width</translation>
- </message>
- <message>
- <source>MEN_MERGE_SCALAR_BARS</source>
- <translation>Merge Scalar Range</translation>
- </message>
- <message>
- <source>MEN_MULTIPR_VIEW_FULL_RES</source>
- <translation>Display at Full Resolution</translation>
- </message>
- <message>
- <source>MEN_MULTIPR_VIEW_HIDE</source>
- <translation>Hide</translation>
- </message>
- <message>
- <source>MEN_MULTIPR_VIEW_LOW_RES</source>
- <translation>Display at Low Resolution</translation>
- </message>
- <message>
- <source>MEN_MULTIPR_VIEW_MEDIUM_RES</source>
- <translation>Display at Medium Resolution</translation>
- </message>
- <message>
- <source>MEN_NOSHADING</source>
- <translation>Shading Off</translation>
- </message>
- <message>
- <source>MEN_OPACITY</source>
- <translation>Opacity</translation>
- </message>
- <message>
- <source>MEN_PARALLEL_ANIMATION</source>
- <translation>Parallel Animation...</translation>
- </message>
- <message>
- <source>MEN_PARTIAL_SELECTION</source>
- <translation>Partial Selection</translation>
- </message>
- <message>
- <source>MEN_PLOT3D_FROM_CUTPLANE</source>
- <translation>Plot3d</translation>
- </message>
- <message>
- <source>MEN_PLOT_3D</source>
- <translation>Plot3D</translation>
- </message>
- <message>
- <source>MEN_POINT_SELECTION</source>
- <translation>Point Selection</translation>
- </message>
- <message>
- <source>MEN_POINTS</source>
- <translation>Points</translation>
- </message>
- <message>
- <source>MEN_PROPERTIES</source>
- <translation>Properties</translation>
- </message>
- <message>
- <source>MEN_RENAME</source>
- <translation>Rename...</translation>
- </message>
- <message>
- <source>MEN_RENAME_CONTAINER</source>
- <translation>Rename...</translation>
- </message>
- <message>
- <source>MEN_RENAME_TABLE</source>
- <translation>Rename...</translation>
- </message>
- <message>
- <source>MEN_REPRESENTATION</source>
- <translation>Representation</translation>
- </message>
- <message>
- <source>MEN_RESTORE_VIEWPARAMS</source>
- <translation>Restore View Parameters</translation>
- </message>
- <message>
- <source>MEN_SAVE_VIEWPARAMS</source>
- <translation>Save View Parameters</translation>
- </message>
- <message>
- <source>MEN_SCALAR_MAP</source>
- <translation>Scalar Map</translation>
- </message>
- <message>
- <source>MEN_DEFORMED_SHAPE_AND_SCALAR_MAP</source>
- <translation>Deformed Shape and Scalar Map</translation>
- </message>
- <message>
- <source>MEN_SCALING</source>
- <translation>Scaling</translation>
- </message>
- <message>
- <source>MEN_SELECTION</source>
- <translation>Selection</translation>
- </message>
- <message>
- <source>MEN_SELECTION_PANEL</source>
- <translation>Selection Panel</translation>
- </message>
- <message>
- <source>MEN_SHADING</source>
- <translation>Shading On</translation>
- </message>
- <message>
- <source>MEN_SHOW_ANIMATION</source>
- <translation>Show...</translation>
- </message>
- <message>
- <source>MEN_SHOW_TABLE</source>
- <translation>Show Table</translation>
- </message>
- <message>
- <source>MEN_SHRINK</source>
- <translation>Shrink</translation>
- </message>
- <message>
- <source>MEN_STREAM_LINES</source>
- <translation>Stream Lines</translation>
- </message>
- <message>
- <source>MEN_SUCCCESSIVE_ANIMATION</source>
- <translation>Successive Animation...</translation>
- </message>
- <message>
- <source>MEN_SURFACE</source>
- <translation>Surface</translation>
- </message>
- <message>
- <source>MEN_SURFACEFRAME</source>
- <translation>Surfaceframe</translation>
- </message>
- <message>
- <source>MEN_SWEEP</source>
- <translation>Sweep</translation>
- </message>
- <message>
- <source>MEN_TRANSLATE_PRS</source>
- <translation>Translate Presentation</translation>
- </message>
- <message>
- <source>MEN_UNSHRINK</source>
- <translation>Unshrink</translation>
- </message>
- <message>
- <source>MEN_VECTORS</source>
- <translation>Vectors</translation>
- </message>
- <message>
- <source>MEN_VISUALIZATION</source>
- <translation>Visualization</translation>
- </message>
- <message>
- <source>MEN_WIREFRAME</source>
- <translation>Wireframe</translation>
- </message>
- <message>
- <source>MEN_FILTER_SCALARS</source>
- <translation>Filter by Scalars...</translation>
- </message>
- <message>
- <source>MEN_VALUES_LABELING</source>
- <translation>Values labeling</translation>
- </message>
- <message>
- <source>VISU_VALUES_LABELING_PARAMS</source>
- <translation>Labeling parameters</translation>
- </message>
- <message><source>TOOL_IMPORT</source><translation>Import</translation></message>
- <message><source>TOOL_REPRESENTATION</source><translation>Representation</translation></message>
- <message><source>TOOL_SELECTION</source><translation>Selection</translation></message>
- <message><source>TOOL_NAVIGATION</source><translation>Navigation</translation></message>
- <message><source>TOOL_VISUALISATION</source><translation>Visualization</translation>
- </message>
- <message>
- <source>USE_BUILD_PROGRESS</source>
- <translation>Use build progress</translation>
- </message>
- <message>
- <source>MEN_LOAD_COMPONENT_DATA</source>
- <translation>Load Component Data</translation>
- </message>
- <message>
- <source>FLT_DISTRIBUTED_MED_FILES</source>
- <translation>Distributed MED Files (*_maitre.med)</translation>
- </message>
- <message>
- <source>SHOW_LEVEL_LABELS</source>
- <translation>Show level labels</translation>
- </message>
- <message>
- <source>MEN_FILE_INFO</source>
- <translation>MED File Information</translation>
- </message>
- <message>
- <source>ERR_ERROR_IN_THE_FILE</source>
- <translation>Error in the file</translation>
- </message>
- <message>
- <source>ERR_FILE_NOT_EXISTS</source>
- <translation>File does not exist</translation>
- </message>
- <message>
- <source>IMPORT_ERRORS</source>
- <translation>Import operation has finished with errors:</translation>
- </message>
- <message>
- <source>TLT_IMPORT_TABLE</source>
- <translation>Import table</translation>
- </message>
- <message>
- <source>UNKNOWN_IMPORT_ERROR</source>
- <translation>Unknown error</translation>
- </message>
- <message>
- <source>VALUES_LABELING</source>
- <translation>Values labeling</translation>
- </message>
- <message>
- <source>LABELS</source>
- <translation>Labels</translation>
- </message>
- <message>
- <source>COLOR</source>
- <translation>Color</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_AxisWg</name>
- <message>
- <source>AXIS_NAME</source>
- <translation>Axis name</translation>
- </message>
- <message>
- <source>FONT</source>
- <translation>Font</translation>
- </message>
- <message>
- <source>IS_VISIBLE</source>
- <translation>Is visible</translation>
- </message>
- <message>
- <source>LABELS</source>
- <translation>Labels</translation>
- </message>
- <message>
- <source>LENGTH</source>
- <translation>Length</translation>
- </message>
- <message>
- <source>NAME</source>
- <translation>Name</translation>
- </message>
- <message>
- <source>NUMBER</source>
- <translation>Number</translation>
- </message>
- <message>
- <source>OFFSET</source>
- <translation>Offset</translation>
- </message>
- <message>
- <source>TICK_MARKS</source>
- <translation>Tick marks</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_BuildProgressDlg</name>
- <message>
- <source>BUILD_ALL</source>
- <translation>Build all</translation>
- </message>
- <message>
- <source>BUILD_AT_ONCE</source>
- <translation>Build at once</translation>
- </message>
- <message>
- <source>BUILD_ENTITIES</source>
- <translation>Build entities</translation>
- </message>
- <message>
- <source>BUILD_FIELDS</source>
- <translation>Build fields</translation>
- </message>
- <message>
- <source>BUILD_GROUPS</source>
- <translation>Build groups</translation>
- </message>
- <message>
- <source>BUILD_MINMAX</source>
- <translation>Build min/max</translation>
- </message>
- <message>
- <source>CLOSE</source>
- <translation>Close</translation>
- </message>
- <message>
- <source>CLOSE_AT_FINISH</source>
- <translation>Close dialog at finish</translation>
- </message>
- <message>
- <source>DLG_BUILD_PROGRESS_TITLE</source>
- <translation>Build progress</translation>
- </message>
- <message>
- <source>ERR_ERROR_IN_THE_FILE</source>
- <translation>Error in the file</translation>
- </message>
- <message>
- <source>FILE_NAME</source>
- <translation>Import file : </translation>
- </message>
- <message>
- <source>FLT_ALL_FILES</source>
- <translation>All Files (*.*)</translation>
- </message>
- <message>
- <source>FLT_MED_FILES</source>
- <translation>MED Files (*.med)</translation>
- </message>
- <message>
- <source>HELP</source>
- <translation>Help</translation>
- </message>
- <message>
- <source>IMPORT_FROM_FILE</source>
- <translation>Import from File</translation>
- </message>
- <message>
- <source>IMPORT_PROGRESS</source>
- <translation>Import progress</translation>
- </message>
- <message>
- <source>IMPORT_SETTINGS</source>
- <translation>Settings</translation>
- </message>
- <message>
- <source>IMPORT_TIME</source>
- <translation>Time</translation>
- </message>
- <message>
- <source>START</source>
- <translation>Start</translation>
- </message>
- <message>
- <source>TIME</source>
- <translation>Elapsed time : </translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_ClippingDlg</name>
- <message>
- <source>AUTO_APPLY_CHK</source>
- <translation>Auto Apply</translation>
- </message>
- <message>
- <source>BUT_DELETE</source>
- <translation>Delete</translation>
- </message>
- <message>
- <source>BUT_NEW</source>
- <translation>New</translation>
- </message>
- <message>
- <source>GRP_IJK_AXIS</source>
- <translation>Axis</translation>
- </message>
- <message>
- <source>GRP_PARAMETERS</source>
- <translation>Parameters</translation>
- </message>
- <message>
- <source>GRP_PLANES</source>
- <translation>Clipping planes</translation>
- </message>
- <message>
- <source>I_RADIO_BTN</source>
- <translation>I</translation>
- </message>
- <message>
- <source>J_RADIO_BTN</source>
- <translation>J</translation>
- </message>
- <message>
- <source>K_RADIO_BTN</source>
- <translation>K</translation>
- </message>
- <message>
- <source>LBL_DISTANCE</source>
- <translation>Distance</translation>
- </message>
- <message>
- <source>LBL_IJK_INDEX</source>
- <translation>Index (from 0 to ...)</translation>
- </message>
- <message>
- <source>LBL_IJK_INDEX_TO_arg</source>
- <translation>Index (from 0 to %1) </translation>
- </message>
- <message>
- <source>LBL_ORIENTATION</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>LBL_ROTATION_XY</source>
- <translation>Rotation around Z (X to Y):</translation>
- </message>
- <message>
- <source>LBL_ROTATION_XZ</source>
- <translation>Rotation around Y (X to Z):</translation>
- </message>
- <message>
- <source>LBL_ROTATION_YX</source>
- <translation>Rotation around Z (Y to X):</translation>
- </message>
- <message>
- <source>LBL_ROTATION_YZ</source>
- <translation>Rotation around X (Y to Z):</translation>
- </message>
- <message>
- <source>LBL_ROTATION_ZX</source>
- <translation>Rotation around Y (Z to X):</translation>
- </message>
- <message>
- <source>LBL_ROTATION_ZY</source>
- <translation>Rotation around X (Z to Y):</translation>
- </message>
- <message>
- <source>PARALLEL_XOY_COMBO_ITEM</source>
- <translation>|| X-Y</translation>
- </message>
- <message>
- <source>PARALLEL_YOZ_COMBO_ITEM</source>
- <translation>|| Y-Z</translation>
- </message>
- <message>
- <source>PARALLEL_ZOX_COMBO_ITEM</source>
- <translation>|| Z-X</translation>
- </message>
- <message>
- <source>PLANES_COMBO_ITEM_i</source>
- <translation>Plane# %1</translation>
- </message>
- <message>
- <source>PLANES_COMBO_ITEM_no</source>
- <translation>No planes</translation>
- </message>
- <message>
- <source>REVERSE_NORMAL_CHK</source>
- <translation>Reverse normal</translation>
- </message>
- <message>
- <source>SHOW_PREVIEW_CHK</source>
- <translation>Show preview</translation>
- </message>
- <message>
- <source>TAB_IJK_STRUCTURED</source>
- <translation>IJK (Structured)</translation>
- </message>
- <message>
- <source>TAB_NON_STRUCTURED</source>
- <translation>Non structured</translation>
- </message>
- <message>
- <source>TITLE</source>
- <translation>Change Clipping</translation>
- </message>
- <message>
- <source>WRN_EMPTY_RESULTING_PRS</source>
- <translation>Impossible to use given clipping planes because of VTK restrictions.
+ </message>
+ <message>
+ <source>WRN_NO_AVAILABLE_DATA</source>
+ <translation>No Available data in selection</translation>
+ </message>
+ <message>
+ <source>WRN_STUDY_LOCKED</source>
+ <translation>Current Study is locked</translation>
+ </message>
+ <message>
+ <source>WRN_VISU</source>
+ <translation>Post-Pro Warning</translation>
+ </message>
+ <message>
+ <source>WRN_VISU_WARNING</source>
+ <translation>Warning</translation>
+ </message>
+ <message>
+ <source>INF_FAILED</source>
+ <translation> failed!</translation>
+ </message>
+ <message>
+ <source>VISU_IS_UNITS</source>
+ <translation>Display units in title</translation>
+ </message>
+ <message>
+ <source>VISU_LABELS_FORMAT</source>
+ <translation>Labels format</translation>
+ </message>
+ <message>
+ <source>VISU_TITLE_SIZE</source>
+ <translation>Title size (%):</translation>
+ </message>
+ <message>
+ <source>VISU_TITLE_HEIGHT</source>
+ <translation>Title height (%):</translation>
+ </message>
+ <message>
+ <source>VISU_LABEL_SIZE</source>
+ <translation>Label size (%):</translation>
+ </message>
+ <message>
+ <source>VISU_LABEL_HEIGHT</source>
+ <translation>Label height (%):</translation>
+ </message>
+ <message>
+ <source>VISU_BAR_WIDTH</source>
+ <translation>Bar width (%):</translation>
+ </message>
+ <message>
+ <source>VISU_BAR_HEIGHT</source>
+ <translation>Bar height (%):</translation>
+ </message>
+ <message>
+ <source>VISU_AUTOMATIC_FIT_ALL</source>
+ <translation>Automatic Fit All</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_GENERAL</source>
+ <translation>General</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_GROUP_PRECISION</source>
+ <translation>Input Fields Precision</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_visual_data_precision</source>
+ <translation>Visual Data Precision</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_length_precision</source>
+ <translation>Length Precision</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_angle_precision</source>
+ <translation>Angular Precision</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_len_tol_precision</source>
+ <translation>Length Tolerance Precision</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_parametric_precision</source>
+ <translation>Parametric Precision</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_memory_precision</source>
+ <translation>Memory Size Precision</translation>
+ </message>
+ <message>
+ <source>VISU_PRECISION_HINT</source>
+ <translation>
+Input value precision can be adjusted using
+'%1' parameter in Post-Pro module preferences.</translation>
+ </message>
+ <message>
+ <source>VISU_REALLY_DELETE</source>
+ <translation>Do you really want to delete this %1 object(s): %2</translation>
+ </message>
+ <message>
+ <source>WRN_NO_APPROPRIATE_SELECTION</source>
+ <translation>No appropriate objects selected</translation>
+ </message>
+ <message>
+ <source>VISU_PLUGINS_OTHER</source>
+ <translation>VISU plugins</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI</name>
+ <message>
+ <source>PRECISION</source>
+ <translation>Precision</translation>
+ </message>
+ <message>
+ <source>DLG_LINEWIDTH_CMT1</source>
+ <translation>Set value between</translation>
+ </message>
+ <message>
+ <source>DLG_LINEWIDTH_CMT2</source>
+ <translation>1 (thin) and 10 (thick)</translation>
+ </message>
+ <message>
+ <source>DLG_LINEWIDTH_TITLE</source>
+ <translation>Line Width</translation>
+ </message>
+ <message>
+ <source>DLG_OPACITY_CMT1</source>
+ <translation>Set value between</translation>
+ </message>
+ <message>
+ <source>DLG_OPACITY_CMT2</source>
+ <translation>0 (transparent) and 100 (opaque)</translation>
+ </message>
+ <message>
+ <source>DLG_OPACITY_TITLE</source>
+ <translation>Opacity</translation>
+ </message>
+ <message>
+ <source>ERR_ACTIVATE_VIEW3D</source>
+ <translation>Please activate 3D view before</translation>
+ </message>
+ <message>
+ <source>ERR_ERROR_DURING_EXPORT</source>
+ <translation>Error has been occured during exporting to file</translation>
+ </message>
+ <message>
+ <source>ERR_SCALARBAR_PARAMS</source>
+ <translation>Warning! The parameters is incorrect</translation>
+ </message>
+ <message>
+ <source>FLT_ALL_FILES</source>
+ <translation>All Files (*.*)</translation>
+ </message>
+ <message>
+ <source>FLT_MED_FILES</source>
+ <translation>MED Files (*.med)</translation>
+ </message>
+ <message>
+ <source>FLT_SAUV_FILES</source>
+ <translation>SAUV files (*.sauv*)</translation>
+ </message>
+ <message>
+ <source>FLT_TABLE_FILES</source>
+ <translation>Tables (*.txt *.tab *.csv)</translation>
+ </message>
+ <message>
+ <source>IMPORT_FROM_FILE</source>
+ <translation>Import from File</translation>
+ </message>
+ <message>
+ <source>MEN_ACTOR_SELECTION</source>
+ <translation>Actor Selection</translation>
+ </message>
+ <message>
+ <source>MEN_ARRANGE_ACTORS</source>
+ <translation>Arrange Actors</translation>
+ </message>
+ <message>
+ <source>MEN_MANAGE_CACHE</source>
+ <translation>Manage</translation>
+ </message>
+ <message>
+ <source>MEN_CELL_COLOR</source>
+ <translation>Cell Color</translation>
+ </message>
+ <message>
+ <source>MEN_CELL_SELECTION</source>
+ <translation>Cell Selection</translation>
+ </message>
+ <message>
+ <source>MEN_CLEAR_CONTAINER</source>
+ <translation>Clear</translation>
+ </message>
+ <message>
+ <source>MEN_CLIPPING</source>
+ <translation>Clipping Planes</translation>
+ </message>
+ <message>
+ <source>MEN_COLOR</source>
+ <translation>Color...</translation>
+ </message>
+ <message>
+ <source>MEN_COPY_PRS</source>
+ <translation>Copy</translation>
+ </message>
+ <message>
+ <source>MEN_CREATE_CURVES</source>
+ <translation>Create Curves</translation>
+ </message>
+ <message>
+ <source>MEN_CREATE_MANY_PRS</source>
+ <translation>Create Presentations</translation>
+ </message>
+ <message>
+ <source>MEN_CREATE_PLOT2D</source>
+ <translation>Create Plot2d View</translation>
+ </message>
+ <message>
+ <source>MEN_CREATE_PRS</source>
+ <translation>Create Presentation</translation>
+ </message>
+ <message>
+ <source>MEN_CREATE_TABLE</source>
+ <translation>Create Table</translation>
+ </message>
+ <message>
+ <source>MEN_CUBE_AXES</source>
+ <translation>Graduated Axes</translation>
+ </message>
+ <message>
+ <source>MEN_CURVE_PROPS</source>
+ <translation>Properties...</translation>
+ </message>
+ <message>
+ <source>MEN_CURVE_SCALE</source>
+ <translation>Scale...</translation>
+ </message>
+ <message>
+ <source>MEN_CUT_LINES</source>
+ <translation>Cut Lines</translation>
+ </message>
+ <message>
+ <source>MEN_CUT_SEGMENT</source>
+ <translation>Cut Segment</translation>
+ </message>
+ <message>
+ <source>MEN_CUT_PLANES</source>
+ <translation>Cut Planes</translation>
+ </message>
+ <message>
+ <source>MEN_DEFORMED_SHAPE</source>
+ <translation>Deformed Shape</translation>
+ </message>
+ <message>
+ <source>MEN_DELETE_OBJS</source>
+ <translation>Delete</translation>
+ </message>
+ <message>
+ <source>MEN_DELETE_VIEWPARAMS</source>
+ <translation>Delete View Parameters</translation>
+ </message>
+ <message>
+ <source>MEN_SHOW</source>
+ <translation>Show</translation>
+ </message>
+ <message>
+ <source>MEN_SHOW_SCALAR_BAR</source>
+ <translation>Show Scalar Bar</translation>
+ </message>
+ <message>
+ <source>MEN_DISPLAY_ONLY</source>
+ <translation>Show Only</translation>
+ </message>
+ <message>
+ <source>MEN_DISPLAY_SELECTION</source>
+ <translation>Display Selection</translation>
+ </message>
+ <message>
+ <source>MEN_EDGE_COLOR</source>
+ <translation>Edge Color</translation>
+ </message>
+ <message>
+ <source>MEN_EDIT_CONTAINER</source>
+ <translation>Edit...</translation>
+ </message>
+ <message>
+ <source>MEN_EDIT_PRS</source>
+ <translation>Edit...</translation>
+ </message>
+ <message>
+ <source>MEN_HIDE</source>
+ <translation>Hide</translation>
+ </message>
+ <message>
+ <source>MEN_HIDE_SCALAR_BAR</source>
+ <translation>Hide Scalar Bar</translation>
+ </message>
+ <message>
+ <source>MEN_ERASE_ALL</source>
+ <translation>Hide All</translation>
+ </message>
+ <message>
+ <source>MEN_EXPORT_TABLE</source>
+ <translation>Export Table</translation>
+ </message>
+ <message>
+ <source>VISU_MEN_EXPORT_MED</source>
+ <translation>Export to MED file</translation>
+ </message>
+ <message>
+ <source>MEN_FEATURE_EDGES</source>
+ <translation>Feature Edges</translation>
+ </message>
+ <message>
+ <source>MEN_FEATURE_EDGES_DISABLE</source>
+ <translation>Disable Feature Edges</translation>
+ </message>
+ <message>
+ <source>MEN_FREE_SCALAR_BARS</source>
+ <translation>Use Field Range</translation>
+ </message>
+ <message>
+ <source>MEN_GAUSS_POINT_SELECTION</source>
+ <translation>Gauss Point Selection</translation>
+ </message>
+ <message>
+ <source>MEN_GLOBAL_SELECTION</source>
+ <translation>Global Selection</translation>
+ </message>
+ <message>
+ <source>MEN_HOLO_RENDER</source>
+ <translation>Holo Render</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT</source>
+ <translation>Import</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT_FROM_FILE</source>
+ <translation>MED File</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT_MED_FIELD</source>
+ <translation>Import Field</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT_MED_STRUCTURE</source>
+ <translation>Import Structure</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT_MED_TIMESTAMP</source>
+ <translation>Import TimeStamp</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT_SAUV</source>
+ <translation>SAUV File</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT_TABLE</source>
+ <translation>Table From File</translation>
+ </message>
+ <message>
+ <source>MEN_INSIDEFRAME</source>
+ <translation>Insideframe</translation>
+ </message>
+ <message>
+ <source>MEN_ISO_SURFACES</source>
+ <translation>Iso Surfaces</translation>
+ </message>
+ <message>
+ <source>MEN_LINE_WIDTH</source>
+ <translation>Line Width</translation>
+ </message>
+ <message>
+ <source>MEN_SHRINK_FACTOR</source>
+ <translation>Shrink Factor</translation>
+ </message>
+ <message>
+ <source>MEN_MERGE_SCALAR_BARS</source>
+ <translation>Merge Scalar Range</translation>
+ </message>
+ <message>
+ <source>MEN_MULTIPR_VIEW_FULL_RES</source>
+ <translation>Display at Full Resolution</translation>
+ </message>
+ <message>
+ <source>MEN_MULTIPR_VIEW_HIDE</source>
+ <translation>Hide</translation>
+ </message>
+ <message>
+ <source>MEN_MULTIPR_VIEW_LOW_RES</source>
+ <translation>Display at Low Resolution</translation>
+ </message>
+ <message>
+ <source>MEN_MULTIPR_VIEW_MEDIUM_RES</source>
+ <translation>Display at Medium Resolution</translation>
+ </message>
+ <message>
+ <source>MEN_NOSHADING</source>
+ <translation>Shading Off</translation>
+ </message>
+ <message>
+ <source>MEN_TRANSPARENCY</source>
+ <translation>Transparency</translation>
+ </message>
+ <message>
+ <source>MEN_PARALLEL_ANIMATION</source>
+ <translation>Parallel Animation...</translation>
+ </message>
+ <message>
+ <source>MEN_PARTIAL_SELECTION</source>
+ <translation>Partial Selection</translation>
+ </message>
+ <message>
+ <source>MEN_PLOT3D_FROM_CUTPLANE</source>
+ <translation>Plot3d</translation>
+ </message>
+ <message>
+ <source>MEN_PLOT_3D</source>
+ <translation>Plot3D</translation>
+ </message>
+ <message>
+ <source>MEN_POINT_EVOLUTION</source>
+ <translation>Evolution on Point</translation>
+ </message>
+ <message>
+ <source>MEN_POINT_SELECTION</source>
+ <translation>Point Selection</translation>
+ </message>
+ <message>
+ <source>MEN_POINT_MARKER</source>
+ <translation>Point Marker</translation>
+ </message>
+ <message>
+ <source>MEN_POINTS</source>
+ <translation>Points</translation>
+ </message>
+ <message>
+ <source>MEN_PROPERTIES</source>
+ <translation>Properties</translation>
+ </message>
+ <message>
+ <source>MEN_RENAME</source>
+ <translation>Rename...</translation>
+ </message>
+ <message>
+ <source>MEN_RENAME_CONTAINER</source>
+ <translation>Rename...</translation>
+ </message>
+ <message>
+ <source>MEN_RENAME_TABLE</source>
+ <translation>Rename...</translation>
+ </message>
+ <message>
+ <source>MEN_REPRESENTATION</source>
+ <translation>Representation</translation>
+ </message>
+ <message>
+ <source>MEN_RESTORE_VIEWPARAMS</source>
+ <translation>Restore View Parameters</translation>
+ </message>
+ <message>
+ <source>MEN_SAVE_VIEWPARAMS</source>
+ <translation>Save View Parameters</translation>
+ </message>
+ <message>
+ <source>MEN_SCALAR_MAP</source>
+ <translation>Scalar Map</translation>
+ </message>
+ <message>
+ <source>MEN_DEFORMED_SHAPE_AND_SCALAR_MAP</source>
+ <translation>Deformed Shape and Scalar Map</translation>
+ </message>
+ <message>
+ <source>MEN_SCALING</source>
+ <translation>Scaling</translation>
+ </message>
+ <message>
+ <source>MEN_SELECTION</source>
+ <translation>Selection</translation>
+ </message>
+ <message>
+ <source>MEN_SELECTION_PANEL</source>
+ <translation>Selection Panel</translation>
+ </message>
+ <message>
+ <source>MEN_SHADING</source>
+ <translation>Shading On</translation>
+ </message>
+ <message>
+ <source>MEN_SHOW_ANIMATION</source>
+ <translation>Show...</translation>
+ </message>
+ <message>
+ <source>MEN_SHOW_EVOLUTION</source>
+ <translation>Show...</translation>
+ </message>
+ <message>
+ <source>MEN_SHOW_TABLE</source>
+ <translation>Show Table</translation>
+ </message>
+ <message>
+ <source>MEN_SHRINK</source>
+ <translation>Shrink</translation>
+ </message>
+ <message>
+ <source>MEN_STREAM_LINES</source>
+ <translation>Stream Lines</translation>
+ </message>
+ <message>
+ <source>MEN_SUCCCESSIVE_ANIMATION</source>
+ <translation>Successive Animation...</translation>
+ </message>
+ <message>
+ <source>MEN_SURFACE</source>
+ <translation>Surface</translation>
+ </message>
+ <message>
+ <source>MEN_SURFACEFRAME</source>
+ <translation>Surfaceframe</translation>
+ </message>
+ <message>
+ <source>MEN_SWEEP</source>
+ <translation>Sweep</translation>
+ </message>
+ <message>
+ <source>MEN_TRANSLATE_PRS</source>
+ <translation>Translate Presentation</translation>
+ </message>
+ <message>
+ <source>MEN_UNSHRINK</source>
+ <translation>Unshrink</translation>
+ </message>
+ <message>
+ <source>MEN_VECTORS</source>
+ <translation>Vectors</translation>
+ </message>
+ <message>
+ <source>MEN_VISUALIZATION</source>
+ <translation>Visualization</translation>
+ </message>
+ <message>
+ <source>MEN_WIREFRAME</source>
+ <translation>Wireframe</translation>
+ </message>
+ <message>
+ <source>MEN_FILTER_SCALARS</source>
+ <translation>Filter by Scalars...</translation>
+ </message>
+ <message>
+ <source>MEN_VALUES_LABELING</source>
+ <translation>Values labeling</translation>
+ </message>
+ <message>
+ <source>VISU_VALUES_LABELING_PARAMS</source>
+ <translation>Labeling parameters</translation>
+ </message>
+ <message>
+ <source>MEN_2D_QUADRATIC_MODE</source>
+ <translation>2D Quadratic</translation>
+ </message>
+ <message>
+ <source>MEN_VISU_ARCQUAD_MODE</source>
+ <translation>Arcs</translation>
+ </message>
+ <message>
+ <source>MEN_VISU_LINEQUAD_MODE</source>
+ <translation>Lines</translation>
+ </message>
+ <message>
+ <source>MEN_VISU_SHOW_DEVIATION</source>
+ <translation>Show errors</translation>
+ </message>
+ <message>
+ <source>TOOL_IMPORT</source>
+ <translation>Import</translation>
+ </message>
+ <message>
+ <source>TOOL_REPRESENTATION</source>
+ <translation>Representation</translation>
+ </message>
+ <message>
+ <source>TOOL_SELECTION</source>
+ <translation>Selection</translation>
+ </message>
+ <message>
+ <source>TOOL_NAVIGATION</source>
+ <translation>Navigation</translation>
+ </message>
+ <message>
+ <source>TOOL_VISUALISATION</source>
+ <translation>Visualization</translation>
+ </message>
+ <message>
+ <source>USE_BUILD_PROGRESS</source>
+ <translation>Use build progress</translation>
+ </message>
+ <message>
+ <source>FIRST_STR_AS_TITLE</source>
+ <translation>Use first string as title</translation>
+ </message>
+ <message>
+ <source>MEN_LOAD_COMPONENT_DATA</source>
+ <translation>Load Component Data</translation>
+ </message>
+ <message>
+ <source>FLT_DISTRIBUTED_MED_FILES</source>
+ <translation>Distributed MED Files (*_maitre.med)</translation>
+ </message>
+ <message>
+ <source>SHOW_LEVEL_LABELS</source>
+ <translation>Show level labels</translation>
+ </message>
+ <message>
+ <source>MEN_FILE_INFO</source>
+ <translation>MED File Information</translation>
+ </message>
+ <message>
+ <source>ERR_ERROR_IN_THE_FILE</source>
+ <translation>Error in the file</translation>
+ </message>
+ <message>
+ <source>ERR_FILE_NOT_EXISTS</source>
+ <translation>File does not exist</translation>
+ </message>
+ <message>
+ <source>IMPORT_ERRORS</source>
+ <translation>Import operation has finished with errors:</translation>
+ </message>
+ <message>
+ <source>TLT_IMPORT_TABLE</source>
+ <translation>Import table</translation>
+ </message>
+ <message>
+ <source>UNKNOWN_IMPORT_ERROR</source>
+ <translation>Unknown error</translation>
+ </message>
+ <message>
+ <source>UNSUPPORTED_FILE_FORMAT</source>
+ <translation>Unsupported file format</translation>
+ </message>
+ <message>
+ <source>VALUES_LABELING</source>
+ <translation>Values labeling</translation>
+ </message>
+ <message>
+ <source>LABELS</source>
+ <translation>Labels</translation>
+ </message>
+ <message>
+ <source>COLOR</source>
+ <translation>Color</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_AxisWg</name>
+ <message>
+ <source>AXIS_NAME</source>
+ <translation>Axis name</translation>
+ </message>
+ <message>
+ <source>FONT</source>
+ <translation>Font</translation>
+ </message>
+ <message>
+ <source>IS_VISIBLE</source>
+ <translation>Is visible</translation>
+ </message>
+ <message>
+ <source>LABELS</source>
+ <translation>Labels</translation>
+ </message>
+ <message>
+ <source>LENGTH</source>
+ <translation>Length</translation>
+ </message>
+ <message>
+ <source>NAME</source>
+ <translation>Name</translation>
+ </message>
+ <message>
+ <source>NUMBER</source>
+ <translation>Number</translation>
+ </message>
+ <message>
+ <source>OFFSET</source>
+ <translation>Offset</translation>
+ </message>
+ <message>
+ <source>TICK_MARKS</source>
+ <translation>Tick marks</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_BuildProgressDlg</name>
+ <message>
+ <source>BUILD_ALL</source>
+ <translation>Build all</translation>
+ </message>
+ <message>
+ <source>BUILD_AT_ONCE</source>
+ <translation>Build at once</translation>
+ </message>
+ <message>
+ <source>BUILD_ENTITIES</source>
+ <translation>Build entities</translation>
+ </message>
+ <message>
+ <source>BUILD_FIELDS</source>
+ <translation>Build fields</translation>
+ </message>
+ <message>
+ <source>BUILD_GROUPS</source>
+ <translation>Build groups</translation>
+ </message>
+ <message>
+ <source>BUILD_MINMAX</source>
+ <translation>Build min/max</translation>
+ </message>
+ <message>
+ <source>CLOSE</source>
+ <translation>Close</translation>
+ </message>
+ <message>
+ <source>CLOSE_AT_FINISH</source>
+ <translation>Close dialog at finish</translation>
+ </message>
+ <message>
+ <source>DLG_BUILD_PROGRESS_TITLE</source>
+ <translation>Build progress</translation>
+ </message>
+ <message>
+ <source>ERR_ERROR_IN_THE_FILE</source>
+ <translation>Error in the file</translation>
+ </message>
+ <message>
+ <source>FILE_NAME</source>
+ <translation>Import file : </translation>
+ </message>
+ <message>
+ <source>FLT_ALL_FILES</source>
+ <translation>All Files (*.*)</translation>
+ </message>
+ <message>
+ <source>FLT_MED_FILES</source>
+ <translation>MED Files (*.med)</translation>
+ </message>
+ <message>
+ <source>FLT_SAUV_FILES</source>
+ <translation>SAUV files (*.sauv*)</translation>
+ </message>
+ <message>
+ <source>HELP</source>
+ <translation>Help</translation>
+ </message>
+ <message>
+ <source>IMPORT_FROM_FILE</source>
+ <translation>Import from File</translation>
+ </message>
+ <message>
+ <source>IMPORT_PROGRESS</source>
+ <translation>Import progress</translation>
+ </message>
+ <message>
+ <source>IMPORT_SETTINGS</source>
+ <translation>Settings</translation>
+ </message>
+ <message>
+ <source>IMPORT_TIME</source>
+ <translation>Time</translation>
+ </message>
+ <message>
+ <source>START</source>
+ <translation>Start</translation>
+ </message>
+ <message>
+ <source>TIME</source>
+ <translation>Elapsed time : </translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ClippingDlg</name>
+ <message>
+ <source>AUTO_APPLY_CHK</source>
+ <translation>Auto Apply</translation>
+ </message>
+ <message>
+ <source>BUT_DELETE</source>
+ <translation>Delete</translation>
+ </message>
+ <message>
+ <source>BUT_NEW</source>
+ <translation>New</translation>
+ </message>
+ <message>
+ <source>GRP_IJK_AXIS</source>
+ <translation>Axis</translation>
+ </message>
+ <message>
+ <source>GRP_PARAMETERS</source>
+ <translation>Parameters</translation>
+ </message>
+ <message>
+ <source>GRP_PLANES</source>
+ <translation>Clipping planes</translation>
+ </message>
+ <message>
+ <source>I_RADIO_BTN</source>
+ <translation>I</translation>
+ </message>
+ <message>
+ <source>J_RADIO_BTN</source>
+ <translation>J</translation>
+ </message>
+ <message>
+ <source>K_RADIO_BTN</source>
+ <translation>K</translation>
+ </message>
+ <message>
+ <source>LBL_DISTANCE</source>
+ <translation>Distance</translation>
+ </message>
+ <message>
+ <source>LBL_IJK_INDEX</source>
+ <translation>Index (from 0 to ...)</translation>
+ </message>
+ <message>
+ <source>LBL_IJK_INDEX_TO_arg</source>
+ <translation>Index (from 0 to %1) </translation>
+ </message>
+ <message>
+ <source>LBL_ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION_XY</source>
+ <translation>Rotation around Z (X to Y):</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION_XZ</source>
+ <translation>Rotation around Y (X to Z):</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION_YX</source>
+ <translation>Rotation around Z (Y to X):</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION_YZ</source>
+ <translation>Rotation around X (Y to Z):</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION_ZX</source>
+ <translation>Rotation around Y (Z to X):</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION_ZY</source>
+ <translation>Rotation around X (Z to Y):</translation>
+ </message>
+ <message>
+ <source>PARALLEL_XOY_COMBO_ITEM</source>
+ <translation>|| X-Y</translation>
+ </message>
+ <message>
+ <source>PARALLEL_YOZ_COMBO_ITEM</source>
+ <translation>|| Y-Z</translation>
+ </message>
+ <message>
+ <source>PARALLEL_ZOX_COMBO_ITEM</source>
+ <translation>|| Z-X</translation>
+ </message>
+ <message>
+ <source>PLANES_COMBO_ITEM_i</source>
+ <translation>Plane# %1</translation>
+ </message>
+ <message>
+ <source>PLANES_COMBO_ITEM_no</source>
+ <translation>No planes</translation>
+ </message>
+ <message>
+ <source>REVERSE_NORMAL_CHK</source>
+ <translation>Reverse normal</translation>
+ </message>
+ <message>
+ <source>SHOW_PREVIEW_CHK</source>
+ <translation>Show preview</translation>
+ </message>
+ <message>
+ <source>TAB_IJK_STRUCTURED</source>
+ <translation>IJK (Structured)</translation>
+ </message>
+ <message>
+ <source>TAB_NON_STRUCTURED</source>
+ <translation>Non structured</translation>
+ </message>
+ <message>
+ <source>TITLE</source>
+ <translation>Change Clipping</translation>
+ </message>
+ <message>
+ <source>WRN_EMPTY_RESULTING_PRS</source>
+ <translation>Impossible to use given clipping planes because of VTK restrictions.
Please, provide non-empty resulting presentation.</translation>
- </message>
- <message>
- <source>GRP_TYPE</source>
- <translation>Type of plane</translation>
- </message>
- <message>
- <source>GLOBAL_BTN</source>
- <translation>Global planes</translation>
- </message>
- <message>
- <source>LOCAL_BTN</source>
- <translation>Local planes</translation>
- </message>
- <message>
- <source>GRP_VIEWER_PLANES</source>
- <translation>Planes defined in viewer</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_CubeAxesDlg</name>
- <message>
- <source>CAPTION</source>
- <translation>Graduated axes</translation>
- </message>
- <message>
- <source>IS_VISIBLE</source>
- <translation>Is visible</translation>
- </message>
- <message>
- <source>X_AXIS</source>
- <translation>X axis</translation>
- </message>
- <message>
- <source>Y_AXIS</source>
- <translation>Y axis</translation>
- </message>
- <message>
- <source>Z_AXIS</source>
- <translation>Z axis</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_CursorDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>TextLabel1</source>
- <translation>Set value between</translation>
- </message>
- <message>
- <source>TextLabel2</source>
- <translation>minimal and maximal</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_CutLinesDlg</name>
- <message>
- <source>BASE_PLANE_POS</source>
- <translation>Base plane position</translation>
- </message>
- <message>
- <source>LBL_ABSOLUTE_LENGTH</source>
- <translation>Use absolute length</translation>
- </message>
- <message>
- <source>LBL_GENERATE_CURVES</source>
- <translation>Generate Curves</translation>
- </message>
- <message>
- <source>LBL_GENERATE_TABLE</source>
- <translation>Generate Data Table</translation>
- </message>
- <message>
- <source>LBL_INVERT_CURVES</source>
- <translation>Invert all curves</translation>
- </message>
- <message>
- <source>LBL_LINES_CUT</source>
- <translation>Cut planes</translation>
- </message>
- <message>
- <source>LBL_LINES_PLANE</source>
- <translation>Plane of lines</translation>
- </message>
- <message>
- <source>LBL_NB_PLANS</source>
- <translation>Number of planes:</translation>
- </message>
- <message>
- <source>LBL_POS</source>
- <translation>Displacement (0...1):</translation>
- </message>
- <message>
- <source>LBL_ROTATION</source>
- <translation>Rotations</translation>
- </message>
- <message>
- <source>LBL_ROT_X</source>
- <translation>Rotation around X (Y to Z):</translation>
- </message>
- <message>
- <source>LBL_ROT_Y</source>
- <translation>Rotation around Y (Z to X):</translation>
- </message>
- <message>
- <source>LBL_ROT_Z</source>
- <translation>Rotation around Z (X to Y):</translation>
- </message>
- <message>
- <source>LBL_SHOW_PREVIEW</source>
- <translation>Show preview</translation>
- </message>
- <message>
- <source>PARALLEL_XOY</source>
- <translation>|| X-Y</translation>
- </message>
- <message>
- <source>PARALLEL_YOZ</source>
- <translation>|| Y-Z</translation>
- </message>
- <message>
- <source>PARALLEL_ZOX</source>
- <translation>|| Z-X</translation>
- </message>
- <message>
- <source>SET_DEFAULT</source>
- <translation>Set default</translation>
- </message>
- <message>
- <source>TXT_ORIENTATION</source>
- <translation>Orientation</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_CutPlanesDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_CutPlanesPane</name>
- <message>
- <source>LBL_NB_PLANS</source>
- <translation>Number of planes:</translation>
- </message>
- <message>
- <source>LBL_POS</source>
- <translation>Displacement (0...1):</translation>
- </message>
- <message>
- <source>LBL_ROTATION</source>
- <translation>Rotations</translation>
- </message>
- <message>
- <source>LBL_ROT_X</source>
- <translation>Rotation around X (Y to Z):</translation>
- </message>
- <message>
- <source>LBL_ROT_Y</source>
- <translation>Rotation around Y (Z to X):</translation>
- </message>
- <message>
- <source>LBL_ROT_Z</source>
- <translation>Rotation around Z (X to Y):</translation>
- </message>
- <message>
- <source>LBL_SHOW_PREVIEW</source>
- <translation>Show preview</translation>
- </message>
- <message>
- <source>PARALLEL_XOY</source>
- <translation>// X-Y</translation>
- </message>
- <message>
- <source>PARALLEL_YOZ</source>
- <translation>// Y-Z</translation>
- </message>
- <message>
- <source>PARALLEL_ZOX</source>
- <translation>// Z-X</translation>
- </message>
- <message>
- <source>TXT_ORIENTATION</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>LBL_DEFORMATION</source>
- <translation>Deformation</translation>
- </message>
- <message>
- <source>LBL_DEFROMATION_SCALE</source>
- <translation>Scale Factor :</translation>
- </message>
- <message>
- <source>LBL_DEFROMATION_VECT</source>
- <translation>Vectors :</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_DeformedShapeDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>DEFORMED_SHAPE_TAB</source>
- <translation>Deformed Shape</translation>
- </message>
- <message>
- <source>DLG_TITLE</source>
- <translation>Deformed Shape</translation>
- </message>
- <message>
- <source>INPUT_TAB</source>
- <translation>Input</translation>
- </message>
- <message>
- <source>MAGNITUDE_COLORING</source>
- <translation>Magnitude coloring</translation>
- </message>
- <message>
- <source>SCALAR_BAR_TAB</source>
- <translation>Scalar Bar</translation>
- </message>
- <message>
- <source>SCALE_FACTOR</source>
- <translation>Scale Factor:</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_EditContainerDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>LBL_CONTAINER</source>
- <translation>Container</translation>
- </message>
- <message>
- <source>LBL_STUDY</source>
- <translation>Study</translation>
- </message>
- <message>
- <source>TXT_CURVE</source>
- <translation>Curve</translation>
- </message>
- <message>
- <source>TXT_TABLE</source>
- <translation>Table</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_FeatureEdgesPanel</name>
- <message>
- <source>WINDOW_TITLE</source>
- <translation>Feature edges</translation>
- </message>
- <message>
- <source>FEATURE_EDGES_ANGLE</source>
- <translation>Feature edges angle</translation>
- </message>
- <message>
- <source>FEATURE_EDGES_COLORING</source>
- <translation>Coloring</translation>
- </message>
- <message>
- <source>FEATURE_EDGES_PROPERTIES</source>
- <translation>Feature edges properties</translation>
- </message>
- <message>
- <source>SHOW_BOUNDARY_EDGES</source>
- <translation>Show boundary edges</translation>
- </message>
- <message>
- <source>SHOW_FEATURE_EDGES</source>
- <translation>Show feature edges</translation>
- </message>
- <message>
- <source>SHOW_MANIFOLD_EDGES</source>
- <translation>Show manifold edges</translation>
- </message>
- <message>
- <source>SHOW_NON_MANIFOLD_EDGES</source>
- <translation>Show non-manifold edges</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_FileDlg</name>
- <message>
- <source>FULL_LOAD</source>
- <translation>Full loading for current file</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_FindPane</name>
- <message>
- <source>BETWEEN</source>
- <translation>Between</translation>
- </message>
- <message>
- <source>CONDITION</source>
- <translation>Where scalar value is:</translation>
- </message>
- <message>
- <source>FIND_TITLE</source>
- <translation>Find</translation>
- </message>
- <message>
- <source>INCORRECT_VALUES</source>
- <translation>Input values are incorrect</translation>
- </message>
- <message>
- <source>MAXIMUM</source>
- <translation>Maximum</translation>
- </message>
- <message>
- <source>MINIMUM</source>
- <translation>Minimum</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_FontWg</name>
- <message>
- <source>ARIAL</source>
- <translation>Arial</translation>
- </message>
- <message>
- <source>BOLD</source>
- <translation>Bold</translation>
- </message>
- <message>
- <source>COURIER</source>
- <translation>Courier</translation>
- </message>
- <message>
- <source>ITALIC</source>
- <translation>Italic</translation>
- </message>
- <message>
- <source>SHADOW</source>
- <translation>Shadow</translation>
- </message>
- <message>
- <source>TIMES</source>
- <translation>Times</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_GaussPointsDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>DEFORMED_SHAPE</source>
- <translation>Deformed Shape</translation>
- </message>
- <message>
- <source>DEFORMED_SHAPE_TITLE</source>
- <translation>Deformed Shape</translation>
- </message>
- <message>
- <source>DLG_PREF_TITLE</source>
- <translation>Gauss Points Preferences</translation>
- </message>
- <message>
- <source>DLG_PROP_TITLE</source>
- <translation>Gauss Points Properties</translation>
- </message>
- <message>
- <source>DLG_TITLE</source>
- <translation>Gauss Points</translation>
- </message>
- <message>
- <source>GAUSS_POINTS_TAB</source>
- <translation>Gauss Points</translation>
- </message>
- <message>
- <source>GEOMETRY</source>
- <translation>Geometry</translation>
- </message>
- <message>
- <source>INPUT_TAB</source>
- <translation>Input</translation>
- </message>
- <message>
- <source>PRS_TITLE</source>
- <translation>Presentation</translation>
- </message>
- <message>
- <source>RESULTS</source>
- <translation>Results</translation>
- </message>
- <message>
- <source>SCALAR_BAR_TAB</source>
- <translation>Scalar Bar</translation>
- </message>
- <message>
- <source>SCALE_FACTOR</source>
- <translation>Scale Factor :</translation>
- </message>
- <message>
- <source>WARNING</source>
- <translation>Warning</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_GaussScalarBarPane</name>
- <message>
- <source>ACTIVE_BAR_GRP</source>
- <translation>Active bar</translation>
- </message>
- <message>
- <source>BICOLOR</source>
- <translation>Bicolor</translation>
- </message>
- <message>
- <source>COLORS_LABELS_GRP</source>
- <translation>Colors and labels</translation>
- </message>
- <message>
- <source>DIMENSIONS_GRP</source>
- <translation>Dimensions</translation>
- </message>
- <message>
- <source>DISPLAYED</source>
- <translation>Displayed</translation>
- </message>
- <message>
- <source>FIELD_RANGE_BTN</source>
- <translation>Use field range</translation>
- </message>
- <message>
- <source>GLOBAL</source>
- <translation>Global</translation>
- </message>
- <message>
- <source>HORIZONTAL_BTN</source>
- <translation>Horizontal</translation>
- </message>
- <message>
- <source>IMPOSED_RANGE_BTN</source>
- <translation>Use imposed range</translation>
- </message>
- <message>
- <source>LBL_HEIGHT</source>
- <translation>Height:</translation>
- </message>
- <message>
- <source>LBL_MAX</source>
- <translation>Max:</translation>
- </message>
- <message>
- <source>LBL_MIN</source>
- <translation>Min:</translation>
- </message>
- <message>
- <source>LBL_NB_COLORS</source>
- <translation>Nb. of colors:</translation>
- </message>
- <message>
- <source>LBL_NB_LABELS</source>
- <translation>Nb. of labels:</translation>
- </message>
- <message>
- <source>LBL_SPACING</source>
- <translation>Spacing:</translation>
- </message>
- <message>
- <source>LBL_WIDTH</source>
- <translation>Width:</translation>
- </message>
- <message>
- <source>LBL_X</source>
- <translation>X:</translation>
- </message>
- <message>
- <source>LBL_Y</source>
- <translation>Y:</translation>
- </message>
- <message>
- <source>LOCAL</source>
- <translation>Local</translation>
- </message>
- <message>
- <source>LOGARITHMIC_SCALING</source>
- <translation>Logarithmic</translation>
- </message>
- <message>
- <source>ORIENTATION_GRP</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>ORIGIN_GRP</source>
- <translation>Origin</translation>
- </message>
- <message>
- <source>RAINBOW</source>
- <translation>Rainbow</translation>
- </message>
- <message>
- <source>SAVE_DEFAULT_CHK</source>
- <translation>Save as default</translation>
- </message>
- <message>
- <source>SCALAR_RANGE_GRP</source>
- <translation>Scalar range:</translation>
- </message>
- <message>
- <source>VERTICAL_BTN</source>
- <translation>Vertical</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_GaussPointsSelectionPane</name>
- <message>
- <source>DISPLAY_PARENT_MESH</source>
- <translation>Display parent mesh element</translation>
- </message>
- <message>
- <source>PICKING_DLG_TITLE</source>
- <translation>Picking</translation>
- </message>
- <message>
- <source>DATA_POSITION</source>
- <translation>Position</translation>
- </message>
- <message>
- <source>PARENT_ELEMENT</source>
- <translation>Parent ID:</translation>
- </message>
- <message>
- <source>PARENT_ELEMENT_TIP</source>
- <translation>Parent mesh element ID</translation>
- </message>
- <message>
- <source>LOCAL_POINT</source>
- <translation>Local ID:</translation>
- </message>
- <message>
- <source>LOCAL_POINT_TIP</source>
- <translation>Local Gauss Point ID</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_InputPanel</name>
- <message>
- <source>WINDOW_TITLE</source>
- <translation>Input Panel</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_InputPane</name>
- <message>
- <source>ENTITY</source>
- <translation>Entity :</translation>
- </message>
- <message>
- <source>FIELD</source>
- <translation>Field :</translation>
- </message>
- <message>
- <source>MED_FILE</source>
- <translation>Source File :</translation>
- </message>
- <message>
- <source>MESH</source>
- <translation>Mesh :</translation>
- </message>
- <message>
- <source>PRS_DATA_SOUIRCE</source>
- <translation>Data Source</translation>
- </message>
- <message>
- <source>REINITIALIZE</source>
- <translation>Auto Update</translation>
- </message>
- <message>
- <source>TIME_STAMP</source>
- <translation>Time Stamp :</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_IsoSurfPane</name>
- <message>
- <source>MAX_VALUE</source>
- <translation>Maximum value:</translation>
- </message>
- <message>
- <source>MIN_VALUE</source>
- <translation>Minimum value:</translation>
- </message>
- <message>
- <source>MSG_MINMAX_VALUES</source>
- <translation>Min value can not be higher or equal to Max value</translation>
- </message>
- <message>
- <source>NB_SURFACES</source>
- <translation>Number of surfaces:</translation>
- </message>
- <message>
- <source>MAGNITUDE_COLORING_CHK</source>
- <translation>Magnitude coloring</translation>
- </message>
- <message>
- <source>SEL_COLOR_BTN</source>
- <translation>Select Color</translation>
- </message>
- <message>
- <source>SHOW_VALUES_CHK</source>
- <translation>Show values (nb per surface)</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_IsoSurfacesDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>DEFINE_ISOSURFACES</source>
- <translation>Iso Surfaces Definition</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_ItemContainer</name>
- <message>
- <source>AUTO_CHECK_LBL</source>
- <translation>Auto assign</translation>
- </message>
- <message>
- <source>CIRCLE_MARKER_LBL</source>
- <translation>Circle</translation>
- </message>
- <message>
- <source>CROSS_MARKER_LBL</source>
- <translation>Cross</translation>
- </message>
- <message>
- <source>DAHSDOTDOT_LINE_LBL</source>
- <translation>DashDotDot</translation>
- </message>
- <message>
- <source>DASHDOT_LINE_LBL</source>
- <translation>DashDot</translation>
- </message>
- <message>
- <source>DASH_LINE_LBL</source>
- <translation>Dash</translation>
- </message>
- <message>
- <source>DIAMOND_MARKER_LBL</source>
- <translation>Diamond</translation>
- </message>
- <message>
- <source>DOT_LINE_LBL</source>
- <translation>Dot</translation>
- </message>
- <message>
- <source>DTRIANGLE_MARKER_LBL</source>
- <translation>Downward triangle</translation>
- </message>
- <message>
- <source>H</source>
- <translation> H </translation>
- </message>
- <message>
- <source>LTRIANGLE_MARKER_LBL</source>
- <translation>Leftward triangle</translation>
- </message>
- <message>
- <source>NONE_LINE_LBL</source>
- <translation>None</translation>
- </message>
- <message>
- <source>NONE_MARKER_LBL</source>
- <translation>None</translation>
- </message>
- <message>
- <source>RECTANGLE_MARKER_LBL</source>
- <translation>Rectangle</translation>
- </message>
- <message>
- <source>RTRIANGLE_MARKER_LBL</source>
- <translation>Rightward triangle</translation>
- </message>
- <message>
- <source>SOLID_LINE_LBL</source>
- <translation>Solid</translation>
- </message>
- <message>
- <source>UTRIANGLE_MARKER_LBL</source>
- <translation>Upward triangle</translation>
- </message>
- <message>
- <source>V</source>
- <translation> V </translation>
- </message>
- <message>
- <source>XCROSS_MARKER_LBL</source>
- <translation>Diagonal cross</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_Module</name>
- <message>
- <source>MEN_DESK_FILE_SAVE_GUI_STATE</source>
- <translation>Save VISU State</translation>
- </message>
- <message>
- <source>MEN_GAUSS</source>
- <translation>Gauss</translation>
- </message>
- <message>
- <source>MEN_GAUSS_CREATE_PRS</source>
- <translation>Gauss Points</translation>
- </message>
- <message>
- <source>MEN_GAUSS_NEW_VIEWER</source>
- <translation>Points View</translation>
- </message>
- <message>
- <source>MEN_OVERWRITE_CONFIGURATION</source>
- <translation>Overwrite Current Configuration</translation>
- </message>
- <message>
- <source>MEN_RESTORE_CONFIGURATION</source>
- <translation>Restore Current Configuration</translation>
- </message>
- <message>
- <source>MEN_SAVE_CONFIGURATION</source>
- <translation>Store Current Configuration</translation>
- </message>
- <message>
- <source>MEN_VISUALISATION</source>
- <translation>Visualization</translation>
- </message>
- <message>
- <source>PRP_DESK_FILE_SAVE_GUI_STATE</source>
- <translation>Saves current state of viewers, displayed objects, etc.</translation>
- </message>
- <message>
- <source>TOOL_IMPORT</source>
- <translation>Import Toolbar</translation>
- </message>
- <message>
- <source>TOOL_VISUALISATION</source>
- <translation>Visualization</translation>
- </message>
- <message>
- <source>TOT_DESK_FILE_SAVE_GUI_STATE</source>
- <translation>Save VISU state</translation>
- </message>
- <message>
- <source>VISU_CAMERA_MOVE_PREF</source>
- <translation>Number of steps between two positions</translation>
- </message>
- <message>
- <source>VISU_CAMERA_PREF_GROUP_TTL</source>
- <translation>Camera movements</translation>
- </message>
- <message>
- <source>VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL</source>
- <translation>Inside Cursor</translation>
- </message>
- <message>
- <source>VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL</source>
- <translation>Outside Cursor</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_ACTIVE_BAR</source>
- <translation>Active bar</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_ALPHA_TEXTURE</source>
- <translation>Alpha Channel Texture (16x16)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_ALPHA_THRESHOLD</source>
- <translation>Alpha Channel Threshold</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_BICOLOR</source>
- <translation>Bicolor</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_CLAMP</source>
- <translation>Maximum Size (Clamp)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_COLOR</source>
- <translation>Color</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_COLOR_GROUP_TTL</source>
- <translation>Color</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_DEFORMED_SHAPE_GROUP_TTL</source>
- <translation>Deformed Shape</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_DISPLAY_GLOBAL</source>
- <translation>Display global bar</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_FACE_LIMIT</source>
- <translation>Notify when number of faces exceeds</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_GEOMSPHERE</source>
- <translation>Geometrical sphere</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_GEOM_GROUP_TTL</source>
- <translation>Geometry</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_GLOBAL</source>
- <translation>Global</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_INCREMENT</source>
- <translation>+/- Ratio</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_LOCAL</source>
- <translation>Local</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_MAGNIFICATION</source>
- <translation>Magnification (%)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_MAGNIFICATION_GROUP_TTL</source>
- <translation>Magnification (Inside and Outside)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_MAIN_TEXTURE</source>
- <translation>Main Texture (16x16)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_MAX_SIZE</source>
- <translation>Range value for max size (%)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_MIN_SIZE</source>
- <translation>Range value for min size (%)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_OPENGLPOINT</source>
- <translation>OpenGL point</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_POINTSPRITE</source>
- <translation>Point sprite</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL</source>
- <translation>Primitive</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_PRIMITIVE_TYPE</source>
- <translation>Primitive Type</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_RAINBOW</source>
- <translation>Rainbow</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_RESOLUTION</source>
- <translation>Geometrical sphere resolution</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_SCALAR_BAR_MODE</source>
- <translation>Scalar bar mode</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_SCALE_FACTOR</source>
- <translation>Scale factor</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_SIZE</source>
- <translation>Size of points (%)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_SIZE_GROUP_TTL</source>
- <translation>Size</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_SPACING</source>
- <translation>Spacing</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_TAB_TTL</source>
- <translation>Gauss Points</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_UNIFORM_COLOR</source>
- <translation>Uniform Color</translation>
- </message>
- <message>
- <source>VISU_GAUSS_SCALAR_BAR_PREF_GROUP_TTL</source>
- <translation>Gauss Points Scalar Bar</translation>
- </message>
- <message>
- <source>VISU_GAUSS_SCALAR_BAR_PREF_TAB_TTL</source>
- <translation>Gauss Points Scalar Bar</translation>
- </message>
- <message>
- <source>VISU_KEYBOARD_PREF</source>
- <translation>[+]/[-] Speed increment</translation>
- </message>
- <message>
- <source>VISU_KEYBOARD_PREF_GROUP_TTL</source>
- <translation>Keyboard</translation>
- </message>
- <message>
- <source>VISU_MOUSE_PREF</source>
- <translation>Mouse behaviour</translation>
- </message>
- <message>
- <source>VISU_MOUSE_PREF_GROUP_TLT</source>
- <translation>Mouse</translation>
- </message>
- <message>
- <source>VISU_MOUSE_PREF_KEYBOARD_FREE</source>
- <translation>Keyboard free</translation>
- </message>
- <message>
- <source>VISU_MOUSE_PREF_STANDARD</source>
- <translation>Salome standard controls</translation>
- </message>
- <message>
- <source>VISU_MOUSE_PREF_TAB_TLT</source>
- <translation>Navigation</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_BELOW_POINT</source>
- <translation>Centered below the point</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_CAMERA_GROUP_TTL</source>
- <translation>Movement of the camera</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_CAMERA_MOVEMENT</source>
- <translation>Enable movement of the camera</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_CURSOR_GROUP_TTL</source>
- <translation>Cursor</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_CURSOR_SIZE</source>
- <translation>Size of the cursor</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_DISPLAY_PARENT_MESH</source>
- <translation>Display parent mesh element</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_INFO_WINDOW</source>
- <translation>Enable information window</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_INFO_WINDOW_GROUP_TTL</source>
- <translation>Information window</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_PARENT_MESH_TTL</source>
- <translation>Parent mesh element</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_POINT_SELECTION_TOLERANCE</source>
- <translation>Point selection tolerance</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_POSITION</source>
- <translation>Position</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_PYRAMID_HEIGHT</source>
- <translation>Height of the pyramids</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_SELECTION_COLOR</source>
- <translation>Selection cursor color</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_STEP_NUMBER</source>
- <translation>Number of steps between two positions</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_TAB_TTL</source>
- <translation>Picking</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_TOLERANCE_GROUP_TTL</source>
- <translation>Tolerance</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_TOP_LEFT_CORNER</source>
- <translation>Top-left corner of the 3D view</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_TRANSPARENCY</source>
- <translation>Transparency</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_ZOOM_FACTOR</source>
- <translation>Zoom factor</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_ALL_DISLPAYED_FRAMES</source>
- <translation>Recording all displayed frames</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_FPS</source>
- <translation>FPS</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_GROUP_TTL</source>
- <translation>Settings</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_PROGRESSIVE</source>
- <translation>Progressive</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_QUALITY</source>
- <translation>Quality</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_RECORDING_MODE</source>
- <translation>Mode</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_SKIPPED_FRAMES</source>
- <translation>Recording at a given FPS</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_TAB_TTL</source>
- <translation>Recorder</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF</source>
- <translation>Spacemouse</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_1</source>
- <translation>Decrease speed increment</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_2</source>
- <translation>Increase speed increment</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_3</source>
- <translation>Decrease Gauss points magnification</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_4</source>
- <translation>Increase Gauss points magnification</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_5</source>
- <translation>Dominant / combined switch</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_*</source>
- <translation>Button *</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_1</source>
- <translation>Button 1</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_10</source>
- <translation>Button 10</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_11</source>
- <translation>Button 11</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_2</source>
- <translation>Button 2</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_3</source>
- <translation>Button 3</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_4</source>
- <translation>Button 4</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_5</source>
- <translation>Button 5</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_6</source>
- <translation>Button 6</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_7</source>
- <translation>Button 7</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_8</source>
- <translation>Button 8</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_NameDlg</name>
- <message>
- <source>NAME_LBL</source>
- <translation>Name: </translation>
- </message>
- <message>
- <source>TLT_RENAME</source>
- <translation>Rename</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_NonIsometricDlg</name>
- <message>
- <source>&Apply</source>
- <translation></translation>
- </message>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&Reset</source>
- <translation></translation>
- </message>
- <message>
- <source>DLG_TITLE</source>
- <translation>Scaling</translation>
- </message>
- <message>
- <source>LBL_X</source>
- <translation>X :</translation>
- </message>
- <message>
- <source>LBL_Y</source>
- <translation>Y :</translation>
- </message>
- <message>
- <source>LBL_Z</source>
- <translation>Z :</translation>
- </message>
- <message>
- <source>O&K</source>
- <translation></translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_Plot3DDlg</name>
- <message>
- <source>INPUT_TAB_TITLE</source>
- <translation>Input</translation>
- </message>
- <message>
- <source>PLOT3D_TAB_TITLE</source>
- <translation>Plot 3D</translation>
- </message>
- <message>
- <source>SCALAR_BAR_TAB_TITLE</source>
- <translation>Scalar Bar</translation>
- </message>
- <message>
- <source>TITLE</source>
- <translation>Plot3D Definition</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_Plot3DPane</name>
- <message>
- <source>CONTOUR</source>
- <translation>Contour</translation>
- </message>
- <message>
- <source>NUMBER_CONTOURS</source>
- <translation>Number of contours:</translation>
- </message>
- <message>
- <source>ORIENTATION</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>POSITION</source>
- <translation>Position</translation>
- </message>
- <message>
- <source>POSITION_VALUE</source>
- <translation>Value: </translation>
- </message>
- <message>
- <source>PRESENTATION_TYPE</source>
- <translation>Presentation type</translation>
- </message>
- <message>
- <source>PREVIEW</source>
- <translation>Preview cutting plane</translation>
- </message>
- <message>
- <source>RELATIVE</source>
- <translation>Relative</translation>
- </message>
- <message>
- <source>ROTATIONS</source>
- <translation>Rotations</translation>
- </message>
- <message>
- <source>ROTATION_X</source>
- <translation>Rotation around X (Y to Z):</translation>
- </message>
- <message>
- <source>ROTATION_Y</source>
- <translation>Rotation around Y (Z to X):</translation>
- </message>
- <message>
- <source>ROTATION_Z</source>
- <translation>Rotation around Z (X to Y):</translation>
- </message>
- <message>
- <source>SCALE</source>
- <translation>Scale Factor:</translation>
- </message>
- <message>
- <source>SURFACE</source>
- <translation>Surface</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_ScalarBarDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>DLG_PREF_TITLE</source>
- <translation>Scalar Bar Preferences</translation>
- </message>
- <message>
- <source>DLG_PROP_TITLE</source>
- <translation>Scalar Bar Properties</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_ScalarBarPane</name>
- <message>
- <source>COLORS_LABELS_GRP</source>
- <translation>Colors and labels</translation>
- </message>
- <message>
- <source>DIMENSIONS_GRP</source>
- <translation>Dimensions (in % of the size of view)</translation>
- </message>
- <message>
- <source>FIELD_RANGE_BTN</source>
- <translation>Use field range</translation>
- </message>
- <message>
- <source>HORIZONTAL_BTN</source>
- <translation>Horizontal</translation>
- </message>
- <message>
- <source>IMPOSED_RANGE_BTN</source>
- <translation>Use imposed range</translation>
- </message>
- <message>
- <source>LBL_HEIGHT</source>
- <translation>Height:</translation>
- </message>
- <message>
- <source>LBL_MAX</source>
- <translation>Max:</translation>
- </message>
- <message>
- <source>LBL_MIN</source>
- <translation>Min:</translation>
- </message>
- <message>
- <source>LBL_NB_COLORS</source>
- <translation>Nb. of colors:</translation>
- </message>
- <message>
- <source>LBL_NB_LABELS</source>
- <translation>Nb. of labels:</translation>
- </message>
- <message>
- <source>LBL_SHOW_PREVIEW</source>
- <translation>Preview</translation>
- </message>
- <message>
- <source>SHOW_DISTRIBUTION</source>
- <translation>Show distribution</translation>
- </message>
- <message>
- <source>FILTER_BY_SCALARS</source>
- <translation>Filter by scalars</translation>
- </message>
- <message>
- <source>VALUES_LABELING</source>
- <translation>Values labeling</translation>
- </message>
- <message>
- <source>LBL_WIDTH</source>
- <translation>Width:</translation>
- </message>
- <message>
- <source>LBL_X</source>
- <translation>X:</translation>
- </message>
- <message>
- <source>LBL_Y</source>
- <translation>Y:</translation>
- </message>
- <message>
- <source>LOGARITHMIC_SCALING</source>
- <translation>Logarithmic</translation>
- </message>
- <message>
- <source>MSG_MINMAX_VALUES</source>
- <translation>Min value can not be higher or equal to Max value</translation>
- </message>
- <message>
- <source>ORIENTATION_GRP</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>ORIGIN_GRP</source>
- <translation>Origin</translation>
- </message>
- <message>
- <source>SAVE_DEFAULT_CHK</source>
- <translation>Save as default</translation>
- </message>
- <message>
- <source>SCALAR_RANGE_GRP</source>
- <translation>Scalar range:</translation>
- </message>
- <message>
- <source>VERTICAL_BTN</source>
- <translation>Vertical</translation>
- </message>
- <message>
- <source>WRN_LOGARITHMIC_FIELD_RANGE</source>
- <translation>Logarithmic scaling: field range contains negative values, use imposed range instead</translation>
- </message>
- <message>
- <source>WRN_LOGARITHMIC_RANGE</source>
- <translation>Logarithmic scaling: use imposed range values > 0</translation>
- </message>
- <message>
- <source>HIDE_SCALAR_BAR</source>
- <translation>Hide scalar bar</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_DeformedShapeAndScalarMapDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>DLG_TITLE</source>
- <translation>Deformed Shape and Scalar Map</translation>
- </message>
- <message>
- <source>FIELD_ITEM</source>
- <translation>Scalar Field:</translation>
- </message>
- <message>
- <source>INPUT_TAB</source>
- <translation>Input</translation>
- </message>
- <message>
- <source>SCALAR_BAR_TAB</source>
- <translation>Scalar Bar</translation>
- </message>
- <message>
- <source>DEFORMED_SHAPE_AND_SCALAR_MAP_TAB</source>
- <translation>Deformed Shape and Scalar Map</translation>
- </message>
- <message>
- <source>SCALE_FACTOR</source>
- <translation>Scale Factor:</translation>
- </message>
- <message>
- <source>TIMESTAMP_ITEM</source>
- <translation>Current Time Stamp:</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_SetupPlot2dDlg</name>
- <message>
- <source>BUT_NO</source>
- <translation>No</translation>
- </message>
- <message>
- <source>BUT_YES</source>
- <translation>Yes</translation>
- </message>
- <message>
- <source>QUE_WANT_SAME_UNITS</source>
- <translation>Do you want to choose all items with the same units for vertical axis?</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_Sweep</name>
-
- <message><source>TITLE</source><translation>Sweep</translation></message>
- <message><source>MEN_SWEEP_PANE</source><translation>Sweep</translation></message>
-
- <message><source>NAVIGATION_TAB</source><translation>Navigation</translation></message>
- <message><source>START_SWEEP_POSITION</source><translation>0 %</translation></message>
- <message><source>END_SWEEP_POSITION</source><translation>100 %</translation></message>
- <message><source>IS_CYCLED</source><translation>Cycled</translation></message>
-
- <message><source>PROPERTIES_TAB</source><translation>Properties</translation></message>
-
- <message><source>MODE</source><translation>Mode:</translation></message>
- <message><source>LINEAR</source><translation>Linear</translation></message>
- <message><source>COSINUSOIDAL</source><translation>1 - cos( t ) / 2</translation></message>
- <message><source>SINUSOIDAL</source><translation>sin( t - Pi / 2 )</translation></message>
-
- <message><source>NUMBER_OF_STEPS</source><translation>Number Steps:</translation></message>
-
- <message><source>INTERVAL</source><translation>Interval</translation></message>
- <message><source>[ 0, +PI ]</source><translation>[ 0, +PI ]</translation></message>
- <message><source>[ -PI, +PI ]</source><translation>[ -PI, +PI ]</translation></message>
-
- <message><source>DELAY_BETWEEN_STEPS</source><translation>Step Delay [ sec ]:</translation></message>
- </context>
- <context>
- <name>VisuGUI_Slider</name>
-
- <message><source>TITLE</source><translation>Slider</translation></message>
- <message><source>MEN_SLIDER_PANE</source><translation>Slider</translation></message>
-
- <message><source>NAVIGATION_TAB</source><translation>Navigation</translation></message>
- <message><source>IS_CYCLED</source><translation>Cycled</translation></message>
-
- <message><source>PROPERTIES_TAB</source><translation>Properties</translation></message>
- <message><source>MINIMAL_MEMORY</source><translation>Minimal</translation></message>
- <message><source>LIMITED_MEMORY</source><translation>Limited</translation></message>
- <message><source>MEMORY_UNITS</source><translation>Mb</translation></message>
-
- <message><source>USED_BY_CACHE</source><translation>Used:</translation></message>
- <message><source>AVAILABLE_MEMORY</source><translation>Free:</translation></message>
-
- <message><source>SPEED</source><translation>Speed</translation></message>
- </context>
- <context>
- <name>VisuGUI_StreamLinesDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>DLG_TITLE</source>
- <translation>Stream lines Preferences</translation>
- </message>
- <message>
- <source>LBL_DIRECTION</source>
- <translation>Direction</translation>
- </message>
- <message>
- <source>LBL_INTEGRATION_STEP</source>
- <translation>Integration Step</translation>
- </message>
- <message>
- <source>LBL_PROPAGATION_TIME</source>
- <translation>Propagation Time</translation>
- </message>
- <message>
- <source>LBL_SOURCE_TYPE</source>
- <translation>Source type</translation>
- </message>
- <message>
- <source>LBL_STEP_LENGTH</source>
- <translation>Step Length</translation>
- </message>
- <message>
- <source>LBL_USED_POINTS</source>
- <translation>Used points (0..1)</translation>
- </message>
- <message>
- <source>MAGNITUDE_COLORING_CHK</source>
- <translation>Magnitude coloring</translation>
- </message>
- <message>
- <source>SOURCE_GRP</source>
- <translation>Source</translation>
- </message>
- <message>
- <source>USE_COLOR_BTN</source>
- <translation>Use Color</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_SweepPrefDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>DLG_TITLE</source>
- <translation>Sweeping Preferences</translation>
- </message>
- <message>
- <source>LBL_NB_CYCLES</source>
- <translation>Number of cycles:</translation>
- </message>
- <message>
- <source>LBL_NB_STEPS</source>
- <translation>Number of steps:</translation>
- </message>
- <message>
- <source>LBL_TIME_STEP</source>
- <translation>Time step (second):</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_TableDlg</name>
- <message>
- <source>EDIT_TABLE_TLT</source>
- <translation>Edit Table</translation>
- </message>
- <message>
- <source>ERR_TABLE_NOT_AVAILABLE</source>
- <translation>Table is not available</translation>
- </message>
- <message>
- <source>TABLE_OF_INTEGER_TLT</source>
- <translation>Table of integer</translation>
- </message>
- <message>
- <source>TABLE_OF_REAL_TLT</source>
- <translation>Table of real</translation>
- </message>
- <message>
- <source>VIEW_TABLE_TLT</source>
- <translation>View Table</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_TableWidget</name>
- <message>
- <source>ADD_COLUMN_BTN</source>
- <translation>Add Column</translation>
- </message>
- <message>
- <source>ADD_ROW_BTN</source>
- <translation>Add Row</translation>
- </message>
- <message>
- <source>ADJUST_CELLS_BTN</source>
- <translation>Adjust Cells</translation>
- </message>
- <message>
- <source>CLEAR_BTN</source>
- <translation>Clear</translation>
- </message>
- <message>
- <source>REMOVE_COLUMN_BTN</source>
- <translation>Remove Column(s)</translation>
- </message>
- <message>
- <source>REMOVE_ROW_BTN</source>
- <translation>Remove Row(s)</translation>
- </message>
- <message>
- <source>SELECT_ALL_BTN</source>
- <translation>Select All</translation>
- </message>
- <message>
- <source>SET_TITLE_TLT</source>
- <translation>Set title</translation>
- </message>
- <message>
- <source>TITLE_LBL</source>
- <translation>Title:</translation>
- </message>
- <message>
- <source>UNITS_TLT</source>
- <translation>Units</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_TextPrefDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>LBL_BOLD</source>
- <translation>Bold</translation>
- </message>
- <message>
- <source>LBL_ITALIC</source>
- <translation>Italic</translation>
- </message>
- <message>
- <source>LBL_LABELS</source>
- <translation>Labels</translation>
- </message>
- <message>
- <source>LBL_SHADOW</source>
- <translation>Shadow</translation>
- </message>
- <message>
- <source>LBL_TITLE</source>
- <translation>Title</translation>
- </message>
- <message>
- <source>TIT_TEXT_PREF</source>
- <translation>Text properties</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_TimeAnimationDlg</name>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>ERROR</source>
- <translation>Error</translation>
- </message>
- <message>
- <source>MSG_NO_ANIMATIONDATA</source>
- <translation>There is no data for animation</translation>
- </message>
- <message>
- <source>MSG_NO_AVI_MAKER</source>
- <translation>Tool jpeg2yuv, necessary for AVI recording, is not available.
+ </message>
+ <message>
+ <source>GRP_TYPE</source>
+ <translation>Type of plane</translation>
+ </message>
+ <message>
+ <source>GLOBAL_BTN</source>
+ <translation>Global planes</translation>
+ </message>
+ <message>
+ <source>LOCAL_BTN</source>
+ <translation>Local planes</translation>
+ </message>
+ <message>
+ <source>GRP_VIEWER_PLANES</source>
+ <translation>Planes defined in viewer</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_CubeAxesDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Graduated axes</translation>
+ </message>
+ <message>
+ <source>IS_VISIBLE</source>
+ <translation>Is visible</translation>
+ </message>
+ <message>
+ <source>X_AXIS</source>
+ <translation>X axis</translation>
+ </message>
+ <message>
+ <source>Y_AXIS</source>
+ <translation>Y axis</translation>
+ </message>
+ <message>
+ <source>Z_AXIS</source>
+ <translation>Z axis</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_CursorDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>TextLabel1</source>
+ <translation>Set value between</translation>
+ </message>
+ <message>
+ <source>TextLabel2</source>
+ <translation>minimal and maximal</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_CutLinesDlg</name>
+ <message>
+ <source>PLANE_NUMBER</source>
+ <translation>Plane #%1</translation>
+ </message>
+ <message>
+ <source>BASE_PLANE_POS</source>
+ <translation>Base plane position</translation>
+ </message>
+ <message>
+ <source>LBL_ABSOLUTE_LENGTH</source>
+ <translation>Use absolute length</translation>
+ </message>
+ <message>
+ <source>LBL_GENERATE_CURVES</source>
+ <translation>Generate Curves</translation>
+ </message>
+ <message>
+ <source>LBL_GENERATE_TABLE</source>
+ <translation>Generate Data Table</translation>
+ </message>
+ <message>
+ <source>LBL_INVERT_CURVES</source>
+ <translation>Invert all curves</translation>
+ </message>
+ <message>
+ <source>LBL_LINES_CUT</source>
+ <translation>Cut planes</translation>
+ </message>
+ <message>
+ <source>LBL_LINES_PLANE</source>
+ <translation>Plane of lines</translation>
+ </message>
+ <message>
+ <source>LBL_NB_PLANS</source>
+ <translation>Number of planes:</translation>
+ </message>
+ <message>
+ <source>LBL_POS</source>
+ <translation>Displacement (0...1):</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION</source>
+ <translation>Rotations</translation>
+ </message>
+ <message>
+ <source>LBL_ROT_X</source>
+ <translation>Rotation around X (Y to Z):</translation>
+ </message>
+ <message>
+ <source>LBL_ROT_Y</source>
+ <translation>Rotation around Y (Z to X):</translation>
+ </message>
+ <message>
+ <source>LBL_ROT_Z</source>
+ <translation>Rotation around Z (X to Y):</translation>
+ </message>
+ <message>
+ <source>LBL_SHOW_PREVIEW</source>
+ <translation>Show preview</translation>
+ </message>
+ <message>
+ <source>PARALLEL_XOY</source>
+ <translation>|| X-Y</translation>
+ </message>
+ <message>
+ <source>PARALLEL_YOZ</source>
+ <translation>|| Y-Z</translation>
+ </message>
+ <message>
+ <source>PARALLEL_ZOX</source>
+ <translation>|| Z-X</translation>
+ </message>
+ <message>
+ <source>SET_DEFAULT</source>
+ <translation>Set default</translation>
+ </message>
+ <message>
+ <source>TXT_ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_CutSegmentDlg</name>
+ <message>
+ <source>LBL_ABSOLUTE_LENGTH</source>
+ <translation>Use absolute length</translation>
+ </message>
+ <message>
+ <source>LBL_CUT_SEGMENT</source>
+ <translation>Cut Segment</translation>
+ </message>
+ <message>
+ <source>LBL_GENERATE_CURVES</source>
+ <translation>Generate Curve</translation>
+ </message>
+ <message>
+ <source>LBL_GENERATE_TABLE</source>
+ <translation>Generate Data Table</translation>
+ </message>
+ <message>
+ <source>LBL_INVERT_CURVES</source>
+ <translation>Invert curve</translation>
+ </message>
+ <message>
+ <source>LBL_POINT_1</source>
+ <translation>Point 1:</translation>
+ </message>
+ <message>
+ <source>LBL_POINT_2</source>
+ <translation>Point 2:</translation>
+ </message>
+ <message>
+ <source>LBL_SEGMENT</source>
+ <translation>Segment</translation>
+ </message>
+ <message>
+ <source>LBL_SHOW_PREVIEW</source>
+ <translation>Show preview</translation>
+ </message>
+ <message>
+ <source>LBL_X</source>
+ <translation>X</translation>
+ </message>
+ <message>
+ <source>LBL_Y</source>
+ <translation>Y</translation>
+ </message>
+ <message>
+ <source>LBL_Z</source>
+ <translation>Z</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_CutPlanesDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_CutPlanesPane</name>
+ <message>
+ <source>LBL_NB_PLANS</source>
+ <translation>Number of planes:</translation>
+ </message>
+ <message>
+ <source>LBL_POS</source>
+ <translation>Displacement (0...1):</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION</source>
+ <translation>Rotations</translation>
+ </message>
+ <message>
+ <source>LBL_ROT_X</source>
+ <translation>Rotation around X (Y to Z):</translation>
+ </message>
+ <message>
+ <source>LBL_ROT_Y</source>
+ <translation>Rotation around Y (Z to X):</translation>
+ </message>
+ <message>
+ <source>LBL_ROT_Z</source>
+ <translation>Rotation around Z (X to Y):</translation>
+ </message>
+ <message>
+ <source>LBL_SHOW_PREVIEW</source>
+ <translation>Show preview</translation>
+ </message>
+ <message>
+ <source>PARALLEL_XOY</source>
+ <translation>// X-Y</translation>
+ </message>
+ <message>
+ <source>PARALLEL_YOZ</source>
+ <translation>// Y-Z</translation>
+ </message>
+ <message>
+ <source>PARALLEL_ZOX</source>
+ <translation>// Z-X</translation>
+ </message>
+ <message>
+ <source>TXT_ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>LBL_DEFORMATION</source>
+ <translation>Deformation</translation>
+ </message>
+ <message>
+ <source>LBL_DEFROMATION_SCALE</source>
+ <translation>Scale Factor :</translation>
+ </message>
+ <message>
+ <source>LBL_DEFROMATION_VECT</source>
+ <translation>Vectors :</translation>
+ </message>
+ <message>
+ <source>PLANE_NUMBER</source>
+ <translation>Plane #%1</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_DeformedShapeDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>DEFORMED_SHAPE_TAB</source>
+ <translation>Deformed Shape</translation>
+ </message>
+ <message>
+ <source>DLG_TITLE</source>
+ <translation>Deformed Shape</translation>
+ </message>
+ <message>
+ <source>INPUT_TAB</source>
+ <translation>Input</translation>
+ </message>
+ <message>
+ <source>MAGNITUDE_COLORING</source>
+ <translation>Magnitude coloring</translation>
+ </message>
+ <message>
+ <source>SCALAR_BAR_TAB</source>
+ <translation>Scalar Bar</translation>
+ </message>
+ <message>
+ <source>SCALE_FACTOR</source>
+ <translation>Scale Factor:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_EditContainerDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>LBL_CONTAINER</source>
+ <translation>Container</translation>
+ </message>
+ <message>
+ <source>LBL_STUDY</source>
+ <translation>Study</translation>
+ </message>
+ <message>
+ <source>TXT_CURVE</source>
+ <translation>Curve</translation>
+ </message>
+ <message>
+ <source>TXT_TABLE</source>
+ <translation>Table</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_EvolutionDlg</name>
+ <message>
+ <source>COMPONENT</source>
+ <translation>Component</translation>
+ </message>
+ <message>
+ <source>ERR_EXTRACTION_OF_DATA_FAILED</source>
+ <translation>Extraction of data failed!</translation>
+ </message>
+ <message>
+ <source>ERR_INVALID_SELECTION</source>
+ <translation>Invalid selection!</translation>
+ </message>
+ <message>
+ <source>FIELD</source>
+ <translation>Field</translation>
+ </message>
+ <message>
+ <source>POINT</source>
+ <translation>Point</translation>
+ </message>
+ <message>
+ <source>PARAMETERS</source>
+ <translation>Parameters</translation>
+ </message>
+ <message>
+ <source>TITLE</source>
+ <translation>Evolution on Point</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_FeatureEdgesPanel</name>
+ <message>
+ <source>WINDOW_TITLE</source>
+ <translation>Feature edges</translation>
+ </message>
+ <message>
+ <source>FEATURE_EDGES_ANGLE</source>
+ <translation>Feature edges angle</translation>
+ </message>
+ <message>
+ <source>FEATURE_EDGES_COLORING</source>
+ <translation>Coloring</translation>
+ </message>
+ <message>
+ <source>FEATURE_EDGES_PROPERTIES</source>
+ <translation>Feature edges properties</translation>
+ </message>
+ <message>
+ <source>SHOW_BOUNDARY_EDGES</source>
+ <translation>Show boundary edges</translation>
+ </message>
+ <message>
+ <source>SHOW_FEATURE_EDGES</source>
+ <translation>Show feature edges</translation>
+ </message>
+ <message>
+ <source>SHOW_MANIFOLD_EDGES</source>
+ <translation>Show manifold edges</translation>
+ </message>
+ <message>
+ <source>SHOW_NON_MANIFOLD_EDGES</source>
+ <translation>Show non-manifold edges</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_FileDlg</name>
+ <message>
+ <source>FULL_LOAD</source>
+ <translation>Full loading for current file</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_FindPane</name>
+ <message>
+ <source>BETWEEN</source>
+ <translation>Between</translation>
+ </message>
+ <message>
+ <source>CONDITION</source>
+ <translation>Where scalar value is:</translation>
+ </message>
+ <message>
+ <source>FIND_TITLE</source>
+ <translation>Find</translation>
+ </message>
+ <message>
+ <source>INCORRECT_VALUES</source>
+ <translation>Input values are incorrect</translation>
+ </message>
+ <message>
+ <source>MAXIMUM</source>
+ <translation>Maximum</translation>
+ </message>
+ <message>
+ <source>MINIMUM</source>
+ <translation>Minimum</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_FontWg</name>
+ <message>
+ <source>ARIAL</source>
+ <translation>Arial</translation>
+ </message>
+ <message>
+ <source>BOLD</source>
+ <translation>Bold</translation>
+ </message>
+ <message>
+ <source>COURIER</source>
+ <translation>Courier</translation>
+ </message>
+ <message>
+ <source>ITALIC</source>
+ <translation>Italic</translation>
+ </message>
+ <message>
+ <source>SHADOW</source>
+ <translation>Shadow</translation>
+ </message>
+ <message>
+ <source>TIMES</source>
+ <translation>Times</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_GaussPointsDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>DEFORMED_SHAPE</source>
+ <translation>Deformed Shape</translation>
+ </message>
+ <message>
+ <source>DEFORMED_SHAPE_TITLE</source>
+ <translation>Deformed Shape</translation>
+ </message>
+ <message>
+ <source>DLG_PREF_TITLE</source>
+ <translation>Gauss Points Preferences</translation>
+ </message>
+ <message>
+ <source>DLG_PROP_TITLE</source>
+ <translation>Gauss Points Properties</translation>
+ </message>
+ <message>
+ <source>DLG_TITLE</source>
+ <translation>Gauss Points</translation>
+ </message>
+ <message>
+ <source>GAUSS_POINTS_TAB</source>
+ <translation>Gauss Points</translation>
+ </message>
+ <message>
+ <source>GEOMETRY</source>
+ <translation>Geometry</translation>
+ </message>
+ <message>
+ <source>INPUT_TAB</source>
+ <translation>Input</translation>
+ </message>
+ <message>
+ <source>PRS_TITLE</source>
+ <translation>Presentation</translation>
+ </message>
+ <message>
+ <source>RESULTS</source>
+ <translation>Results</translation>
+ </message>
+ <message>
+ <source>SCALAR_BAR_TAB</source>
+ <translation>Scalar Bar</translation>
+ </message>
+ <message>
+ <source>SCALE_FACTOR</source>
+ <translation>Scale Factor :</translation>
+ </message>
+ <message>
+ <source>WARNING</source>
+ <translation>Warning</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_GaussScalarBarPane</name>
+ <message>
+ <source>ACTIVE_BAR_GRP</source>
+ <translation>Active bar</translation>
+ </message>
+ <message>
+ <source>BICOLOR</source>
+ <translation>Bicolor</translation>
+ </message>
+ <message>
+ <source>COLORS_LABELS_GRP</source>
+ <translation>Colors and labels</translation>
+ </message>
+ <message>
+ <source>DIMENSIONS_GRP</source>
+ <translation>Dimensions</translation>
+ </message>
+ <message>
+ <source>HIDE_SCALAR_BAR</source>
+ <translation>Hide Scalar Bar</translation>
+ </message>
+ <message>
+ <source>DISPLAYED</source>
+ <translation>Displayed</translation>
+ </message>
+ <message>
+ <source>FIELD_RANGE_BTN</source>
+ <translation>Use field range</translation>
+ </message>
+ <message>
+ <source>GLOBAL</source>
+ <translation>Global</translation>
+ </message>
+ <message>
+ <source>HORIZONTAL_BTN</source>
+ <translation>Horizontal</translation>
+ </message>
+ <message>
+ <source>IMPOSED_RANGE_BTN</source>
+ <translation>Use imposed range</translation>
+ </message>
+ <message>
+ <source>LBL_HEIGHT</source>
+ <translation>Height:</translation>
+ </message>
+ <message>
+ <source>LBL_MAX</source>
+ <translation>Max:</translation>
+ </message>
+ <message>
+ <source>LBL_MIN</source>
+ <translation>Min:</translation>
+ </message>
+ <message>
+ <source>LBL_NB_COLORS</source>
+ <translation>Nb. of colors:</translation>
+ </message>
+ <message>
+ <source>LBL_NB_LABELS</source>
+ <translation>Nb. of labels:</translation>
+ </message>
+ <message>
+ <source>LBL_SPACING</source>
+ <translation>Spacing:</translation>
+ </message>
+ <message>
+ <source>LBL_WIDTH</source>
+ <translation>Width:</translation>
+ </message>
+ <message>
+ <source>LBL_X</source>
+ <translation>X:</translation>
+ </message>
+ <message>
+ <source>LBL_Y</source>
+ <translation>Y:</translation>
+ </message>
+ <message>
+ <source>LOCAL</source>
+ <translation>Local</translation>
+ </message>
+ <message>
+ <source>LOGARITHMIC_SCALING</source>
+ <translation>Logarithmic</translation>
+ </message>
+ <message>
+ <source>ORIENTATION_GRP</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>ORIGIN_GRP</source>
+ <translation>Origin</translation>
+ </message>
+ <message>
+ <source>RAINBOW</source>
+ <translation>Rainbow</translation>
+ </message>
+ <message>
+ <source>SAVE_DEFAULT_CHK</source>
+ <translation>Save as default</translation>
+ </message>
+ <message>
+ <source>SCALAR_MODE</source>
+ <translation>Scalar Mode</translation>
+ </message>
+ <message>
+ <source>SCALAR_RANGE_GRP</source>
+ <translation>Scalar range:</translation>
+ </message>
+ <message>
+ <source>VERTICAL_BTN</source>
+ <translation>Vertical</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_GaussPointsSelectionPane</name>
+ <message>
+ <source>DISPLAY_PARENT_MESH</source>
+ <translation>Display parent mesh element</translation>
+ </message>
+ <message>
+ <source>PICKING_DLG_TITLE</source>
+ <translation>Picking</translation>
+ </message>
+ <message>
+ <source>DATA_POSITION</source>
+ <translation>Position</translation>
+ </message>
+ <message>
+ <source>PARENT_ELEMENT</source>
+ <translation>Parent ID:</translation>
+ </message>
+ <message>
+ <source>PARENT_ELEMENT_TIP</source>
+ <translation>Parent mesh element ID</translation>
+ </message>
+ <message>
+ <source>LOCAL_POINT</source>
+ <translation>Local ID:</translation>
+ </message>
+ <message>
+ <source>LOCAL_POINT_TIP</source>
+ <translation>Local Gauss Point ID</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_InputPanel</name>
+ <message>
+ <source>WINDOW_TITLE</source>
+ <translation>Input Panel</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_InputPane</name>
+ <message>
+ <source>ENTITY</source>
+ <translation>Entity :</translation>
+ </message>
+ <message>
+ <source>FIELD</source>
+ <translation>Field :</translation>
+ </message>
+ <message>
+ <source>MED_FILE</source>
+ <translation>Source File :</translation>
+ </message>
+ <message>
+ <source>MESH</source>
+ <translation>Mesh :</translation>
+ </message>
+ <message>
+ <source>PRS_DATA_SOUIRCE</source>
+ <translation>Data Source</translation>
+ </message>
+ <message>
+ <source>REINITIALIZE</source>
+ <translation>Auto Update</translation>
+ </message>
+ <message>
+ <source>TIME_STAMP</source>
+ <translation>Time Stamp :</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_IsoSurfPane</name>
+ <message>
+ <source>MAX_VALUE</source>
+ <translation>Maximum value:</translation>
+ </message>
+ <message>
+ <source>MIN_VALUE</source>
+ <translation>Minimum value:</translation>
+ </message>
+ <message>
+ <source>MSG_MINMAX_VALUES</source>
+ <translation>Min value can not be higher or equal to Max value</translation>
+ </message>
+ <message>
+ <source>NB_SURFACES</source>
+ <translation>Number of surfaces:</translation>
+ </message>
+ <message>
+ <source>MAGNITUDE_COLORING_CHK</source>
+ <translation>Magnitude coloring</translation>
+ </message>
+ <message>
+ <source>SEL_COLOR_BTN</source>
+ <translation>Select Color</translation>
+ </message>
+ <message>
+ <source>SHOW_VALUES_CHK</source>
+ <translation>Show values (nb per surface)</translation>
+ </message>
+ <message>
+ <source>RANGE</source>
+ <translation>Range</translation>
+ </message>
+ <message>
+ <source>USE_SCALAR_BAR_RANGE</source>
+ <translation>Use scalar bar range</translation>
+ </message>
+ <message>
+ <source>USE_CUSTOM_RANGE</source>
+ <translation>Use custom range</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_IsoSurfacesDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>DEFINE_ISOSURFACES</source>
+ <translation>Iso Surfaces Definition</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ItemContainer</name>
+ <message>
+ <source>AUTO_CHECK_LBL</source>
+ <translation>Auto assign</translation>
+ </message>
+ <message>
+ <source>CIRCLE_MARKER_LBL</source>
+ <translation>Circle</translation>
+ </message>
+ <message>
+ <source>CROSS_MARKER_LBL</source>
+ <translation>Cross</translation>
+ </message>
+ <message>
+ <source>DAHSDOTDOT_LINE_LBL</source>
+ <translation>DashDotDot</translation>
+ </message>
+ <message>
+ <source>DASHDOT_LINE_LBL</source>
+ <translation>DashDot</translation>
+ </message>
+ <message>
+ <source>DASH_LINE_LBL</source>
+ <translation>Dash</translation>
+ </message>
+ <message>
+ <source>DIAMOND_MARKER_LBL</source>
+ <translation>Diamond</translation>
+ </message>
+ <message>
+ <source>DOT_LINE_LBL</source>
+ <translation>Dot</translation>
+ </message>
+ <message>
+ <source>DTRIANGLE_MARKER_LBL</source>
+ <translation>Downward triangle</translation>
+ </message>
+ <message>
+ <source>H</source>
+ <translation> H </translation>
+ </message>
+ <message>
+ <source>LTRIANGLE_MARKER_LBL</source>
+ <translation>Leftward triangle</translation>
+ </message>
+ <message>
+ <source>NONE_LINE_LBL</source>
+ <translation>None</translation>
+ </message>
+ <message>
+ <source>NONE_MARKER_LBL</source>
+ <translation>None</translation>
+ </message>
+ <message>
+ <source>RECTANGLE_MARKER_LBL</source>
+ <translation>Rectangle</translation>
+ </message>
+ <message>
+ <source>RTRIANGLE_MARKER_LBL</source>
+ <translation>Rightward triangle</translation>
+ </message>
+ <message>
+ <source>SOLID_LINE_LBL</source>
+ <translation>Solid</translation>
+ </message>
+ <message>
+ <source>UTRIANGLE_MARKER_LBL</source>
+ <translation>Upward triangle</translation>
+ </message>
+ <message>
+ <source>V</source>
+ <translation> V </translation>
+ </message>
+ <message>
+ <source>XCROSS_MARKER_LBL</source>
+ <translation>Diagonal cross</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_Module</name>
+ <message>
+ <source>MEN_DESK_FILE_SAVE_GUI_STATE</source>
+ <translation>Save VISU State</translation>
+ </message>
+ <message>
+ <source>MEN_GAUSS</source>
+ <translation>Gauss</translation>
+ </message>
+ <message>
+ <source>MEN_GAUSS_CREATE_PRS</source>
+ <translation>Gauss Points</translation>
+ </message>
+ <message>
+ <source>MEN_GAUSS_NEW_VIEWER</source>
+ <translation>Points View</translation>
+ </message>
+ <message>
+ <source>MEN_OVERWRITE_CONFIGURATION</source>
+ <translation>Overwrite Current Configuration</translation>
+ </message>
+ <message>
+ <source>MEN_RESTORE_CONFIGURATION</source>
+ <translation>Restore Current Configuration</translation>
+ </message>
+ <message>
+ <source>MEN_SAVE_CONFIGURATION</source>
+ <translation>Store Current Configuration</translation>
+ </message>
+ <message>
+ <source>MEN_VISUALISATION</source>
+ <translation>Visualization</translation>
+ </message>
+ <message>
+ <source>PRP_DESK_FILE_SAVE_GUI_STATE</source>
+ <translation>Saves current state of viewers, displayed objects, etc.</translation>
+ </message>
+ <message>
+ <source>TOOL_IMPORT</source>
+ <translation>Import Toolbar</translation>
+ </message>
+ <message>
+ <source>TOOL_VISUALISATION</source>
+ <translation>Visualization</translation>
+ </message>
+ <message>
+ <source>TOT_DESK_FILE_SAVE_GUI_STATE</source>
+ <translation>Save VISU state</translation>
+ </message>
+ <message>
+ <source>VISU_CAMERA_MOVE_PREF</source>
+ <translation>Number of steps between two positions</translation>
+ </message>
+ <message>
+ <source>VISU_CAMERA_PREF_GROUP_TTL</source>
+ <translation>Camera movements</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL</source>
+ <translation>Inside Cursor</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL</source>
+ <translation>Outside Cursor</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_ACTIVE_BAR</source>
+ <translation>Active bar</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_ALPHA_TEXTURE</source>
+ <translation>Alpha Channel Texture (16x16)</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_ALPHA_THRESHOLD</source>
+ <translation>Alpha Channel Threshold</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_BICOLOR</source>
+ <translation>Bicolor</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_CLAMP</source>
+ <translation>Maximum Size (Clamp)</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_COLOR</source>
+ <translation>Color</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_COLOR_GROUP_TTL</source>
+ <translation>Color</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_DEFORMED_SHAPE_GROUP_TTL</source>
+ <translation>Deformed Shape</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_DISPLAY_GLOBAL</source>
+ <translation>Display global bar</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_FACE_LIMIT</source>
+ <translation>Notify when number of faces exceeds</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_GEOMSPHERE</source>
+ <translation>Geometrical sphere</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_GEOM_GROUP_TTL</source>
+ <translation>Geometry</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_GLOBAL</source>
+ <translation>Global</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_INCREMENT</source>
+ <translation>+/- Ratio</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_LOCAL</source>
+ <translation>Local</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_MAGNIFICATION</source>
+ <translation>Magnification (%)</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_MAGNIFICATION_GROUP_TTL</source>
+ <translation>Magnification (Inside and Outside)</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_MAIN_TEXTURE</source>
+ <translation>Main Texture (16x16)</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_MAX_SIZE</source>
+ <translation>Range value for max size (%)</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_MIN_SIZE</source>
+ <translation>Range value for min size (%)</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_OPENGLPOINT</source>
+ <translation>OpenGL point</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_POINTSPRITE</source>
+ <translation>Point sprite</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL</source>
+ <translation>Primitive</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_PRIMITIVE_TYPE</source>
+ <translation>Primitive Type</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_RAINBOW</source>
+ <translation>Rainbow</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_RESOLUTION</source>
+ <translation>Geometrical sphere resolution</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_SCALAR_BAR_MODE</source>
+ <translation>Scalar bar mode</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_SCALE_FACTOR</source>
+ <translation>Scale factor</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_SIZE</source>
+ <translation>Size of points (%)</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_SIZE_GROUP_TTL</source>
+ <translation>Size</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_SPACING</source>
+ <translation>Spacing</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_TAB_TTL</source>
+ <translation>Gauss Points</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_UNIFORM_COLOR</source>
+ <translation>Uniform Color</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_SCALAR_BAR_PREF_GROUP_TTL</source>
+ <translation>Gauss Points Scalar Bar</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_SCALAR_BAR_PREF_TAB_TTL</source>
+ <translation>Gauss Points Scalar Bar</translation>
+ </message>
+ <message>
+ <source>VISU_KEYBOARD_PREF</source>
+ <translation>[+]/[-] Speed increment</translation>
+ </message>
+ <message>
+ <source>VISU_KEYBOARD_PREF_GROUP_TTL</source>
+ <translation>Keyboard</translation>
+ </message>
+ <message>
+ <source>VISU_MOUSE_PREF</source>
+ <translation>Mouse behaviour</translation>
+ </message>
+ <message>
+ <source>VISU_MOUSE_PREF_GROUP_TLT</source>
+ <translation>Mouse</translation>
+ </message>
+ <message>
+ <source>VISU_MOUSE_PREF_KEYBOARD_FREE</source>
+ <translation>Keyboard free</translation>
+ </message>
+ <message>
+ <source>VISU_MOUSE_PREF_STANDARD</source>
+ <translation>Salome standard controls</translation>
+ </message>
+ <message>
+ <source>VISU_MOUSE_PREF_TAB_TLT</source>
+ <translation>Navigation</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_BELOW_POINT</source>
+ <translation>Centered below the point</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_CAMERA_GROUP_TTL</source>
+ <translation>Movement of the camera</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_CAMERA_MOVEMENT</source>
+ <translation>Enable movement of the camera</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_CURSOR_GROUP_TTL</source>
+ <translation>Cursor</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_CURSOR_SIZE</source>
+ <translation>Size of the cursor</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_DISPLAY_PARENT_MESH</source>
+ <translation>Display parent mesh element</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_INFO_WINDOW</source>
+ <translation>Enable information window</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_INFO_WINDOW_GROUP_TTL</source>
+ <translation>Information window</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_PARENT_MESH_TTL</source>
+ <translation>Parent mesh element</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_POINT_SELECTION_TOLERANCE</source>
+ <translation>Point selection tolerance</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_POSITION</source>
+ <translation>Position</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_PYRAMID_HEIGHT</source>
+ <translation>Height of the pyramids</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_SELECTION_COLOR</source>
+ <translation>Selection cursor color</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_STEP_NUMBER</source>
+ <translation>Number of steps between two positions</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_TAB_TTL</source>
+ <translation>Picking</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_TOLERANCE_GROUP_TTL</source>
+ <translation>Tolerance</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_TOP_LEFT_CORNER</source>
+ <translation>Top-left corner of the 3D view</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_TRANSPARENCY</source>
+ <translation>Transparency</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_ZOOM_FACTOR</source>
+ <translation>Zoom factor</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_ALL_DISLPAYED_FRAMES</source>
+ <translation>Recording all displayed frames</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_FPS</source>
+ <translation>FPS</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_GROUP_TTL</source>
+ <translation>Settings</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_PROGRESSIVE</source>
+ <translation>Progressive</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_QUALITY</source>
+ <translation>Quality</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_RECORDING_MODE</source>
+ <translation>Mode</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_SKIPPED_FRAMES</source>
+ <translation>Recording at a given FPS</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_TAB_TTL</source>
+ <translation>Recorder</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF</source>
+ <translation>Spacemouse</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_1</source>
+ <translation>Decrease speed increment</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_2</source>
+ <translation>Increase speed increment</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_3</source>
+ <translation>Decrease Gauss points magnification</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_4</source>
+ <translation>Increase Gauss points magnification</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_5</source>
+ <translation>Dominant / combined switch</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_*</source>
+ <translation>Button *</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_1</source>
+ <translation>Button 1</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_10</source>
+ <translation>Button 10</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_11</source>
+ <translation>Button 11</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_2</source>
+ <translation>Button 2</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_3</source>
+ <translation>Button 3</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_4</source>
+ <translation>Button 4</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_5</source>
+ <translation>Button 5</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_6</source>
+ <translation>Button 6</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_7</source>
+ <translation>Button 7</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_8</source>
+ <translation>Button 8</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_NameDlg</name>
+ <message>
+ <source>NAME_LBL</source>
+ <translation>Name: </translation>
+ </message>
+ <message>
+ <source>TLT_RENAME</source>
+ <translation>Rename</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_NonIsometricDlg</name>
+ <message>
+ <source>&Apply</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>&Cancel</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>&Reset</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>DLG_TITLE</source>
+ <translation>Scaling</translation>
+ </message>
+ <message>
+ <source>LBL_X</source>
+ <translation>X :</translation>
+ </message>
+ <message>
+ <source>LBL_Y</source>
+ <translation>Y :</translation>
+ </message>
+ <message>
+ <source>LBL_Z</source>
+ <translation>Z :</translation>
+ </message>
+ <message>
+ <source>O&K</source>
+ <translation></translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_Plot3DDlg</name>
+ <message>
+ <source>INPUT_TAB_TITLE</source>
+ <translation>Input</translation>
+ </message>
+ <message>
+ <source>PLOT3D_TAB_TITLE</source>
+ <translation>Plot 3D</translation>
+ </message>
+ <message>
+ <source>SCALAR_BAR_TAB_TITLE</source>
+ <translation>Scalar Bar</translation>
+ </message>
+ <message>
+ <source>TITLE</source>
+ <translation>Plot3D Definition</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_Plot3DPane</name>
+ <message>
+ <source>CONTOUR</source>
+ <translation>Contour</translation>
+ </message>
+ <message>
+ <source>NUMBER_CONTOURS</source>
+ <translation>Number of contours:</translation>
+ </message>
+ <message>
+ <source>ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>POSITION</source>
+ <translation>Position</translation>
+ </message>
+ <message>
+ <source>POSITION_VALUE</source>
+ <translation>Value: </translation>
+ </message>
+ <message>
+ <source>PRESENTATION_TYPE</source>
+ <translation>Presentation type</translation>
+ </message>
+ <message>
+ <source>PREVIEW</source>
+ <translation>Preview cutting plane</translation>
+ </message>
+ <message>
+ <source>RELATIVE</source>
+ <translation>Relative</translation>
+ </message>
+ <message>
+ <source>ROTATIONS</source>
+ <translation>Rotations</translation>
+ </message>
+ <message>
+ <source>ROTATION_X</source>
+ <translation>Rotation around X (Y to Z):</translation>
+ </message>
+ <message>
+ <source>ROTATION_Y</source>
+ <translation>Rotation around Y (Z to X):</translation>
+ </message>
+ <message>
+ <source>ROTATION_Z</source>
+ <translation>Rotation around Z (X to Y):</translation>
+ </message>
+ <message>
+ <source>SCALE</source>
+ <translation>Scale Factor:</translation>
+ </message>
+ <message>
+ <source>SURFACE</source>
+ <translation>Surface</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ScalarBarDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>DLG_PREF_TITLE</source>
+ <translation>Scalar Bar Preferences</translation>
+ </message>
+ <message>
+ <source>DLG_PROP_TITLE</source>
+ <translation>Scalar Bar Properties</translation>
+ </message>
+ <message>
+ <source>INPUT_TAB</source>
+ <translation>Input</translation>
+ </message>
+ <message>
+ <source>SCALAR_BAR_TAB</source>
+ <translation>Scalar Bar</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ScalarBarPane</name>
+ <message>
+ <source>COLORS_LABELS_GRP</source>
+ <translation>Colors and labels</translation>
+ </message>
+ <message>
+ <source>DIMENSIONS_GRP</source>
+ <translation>Dimensions (in % of the size of view)</translation>
+ </message>
+ <message>
+ <source>FIELD_RANGE_BTN</source>
+ <translation>Use field range</translation>
+ </message>
+ <message>
+ <source>HORIZONTAL_BTN</source>
+ <translation>Horizontal</translation>
+ </message>
+ <message>
+ <source>IMPOSED_RANGE_BTN</source>
+ <translation>Use imposed range</translation>
+ </message>
+ <message>
+ <source>LBL_HEIGHT</source>
+ <translation>Height:</translation>
+ </message>
+ <message>
+ <source>LBL_MAX</source>
+ <translation>Max:</translation>
+ </message>
+ <message>
+ <source>LBL_MIN</source>
+ <translation>Min:</translation>
+ </message>
+ <message>
+ <source>LBL_NB_COLORS</source>
+ <translation>Nb. of colors:</translation>
+ </message>
+ <message>
+ <source>LBL_NB_LABELS</source>
+ <translation>Nb. of labels:</translation>
+ </message>
+ <message>
+ <source>LBL_SHOW_PREVIEW</source>
+ <translation>Preview</translation>
+ </message>
+ <message>
+ <source>SHOW_DISTRIBUTION</source>
+ <translation>Show distribution</translation>
+ </message>
+ <message>
+ <source>FILTER_BY_SCALARS</source>
+ <translation>Filter by scalars</translation>
+ </message>
+ <message>
+ <source>VALUES_LABELING</source>
+ <translation>Values labeling</translation>
+ </message>
+ <message>
+ <source>LBL_WIDTH</source>
+ <translation>Width:</translation>
+ </message>
+ <message>
+ <source>LBL_X</source>
+ <translation>X:</translation>
+ </message>
+ <message>
+ <source>LBL_Y</source>
+ <translation>Y:</translation>
+ </message>
+ <message>
+ <source>LOGARITHMIC_SCALING</source>
+ <translation>Logarithmic</translation>
+ </message>
+ <message>
+ <source>MSG_MINMAX_VALUES</source>
+ <translation>Min value can not be higher or equal to Max value</translation>
+ </message>
+ <message>
+ <source>ORIENTATION_GRP</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>ORIGIN_GRP</source>
+ <translation>Origin</translation>
+ </message>
+ <message>
+ <source>SAVE_DEFAULT_CHK</source>
+ <translation>Save as default</translation>
+ </message>
+ <message>
+ <source>SCALAR_MODE</source>
+ <translation>Scalar Mode</translation>
+ </message>
+ <message>
+ <source>SCALAR_RANGE_GRP</source>
+ <translation>Scalar range:</translation>
+ </message>
+ <message>
+ <source>VERTICAL_BTN</source>
+ <translation>Vertical</translation>
+ </message>
+ <message>
+ <source>WRN_LOGARITHMIC_FIELD_RANGE</source>
+ <translation>Logarithmic scaling: field range contains negative values, use imposed range instead</translation>
+ </message>
+ <message>
+ <source>WRN_LOGARITHMIC_RANGE</source>
+ <translation>Logarithmic scaling: use imposed range values > 0</translation>
+ </message>
+ <message>
+ <source>HIDE_SCALAR_BAR</source>
+ <translation>Hide scalar bar</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_DeformedShapeAndScalarMapDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>DLG_TITLE</source>
+ <translation>Deformed Shape and Scalar Map</translation>
+ </message>
+ <message>
+ <source>ERR_SCALAR_DATA_INCONSISTENT</source>
+ <translation>Scalar data on the selected field is inconsistent.
+Please select another field.</translation>
+ </message>
+ <message>
+ <source>FIELD_ITEM</source>
+ <translation>Scalar Field:</translation>
+ </message>
+ <message>
+ <source>INPUT_TAB</source>
+ <translation>Input</translation>
+ </message>
+ <message>
+ <source>SCALAR_BAR_TAB</source>
+ <translation>Scalar Bar</translation>
+ </message>
+ <message>
+ <source>DEFORMED_SHAPE_AND_SCALAR_MAP_TAB</source>
+ <translation>Deformed Shape and Scalar Map</translation>
+ </message>
+ <message>
+ <source>SCALE_FACTOR</source>
+ <translation>Scale Factor:</translation>
+ </message>
+ <message>
+ <source>TIMESTAMP_ITEM</source>
+ <translation>Current Time Stamp:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_SetupPlot2dDlg</name>
+ <message>
+ <source>BUT_NO</source>
+ <translation>No</translation>
+ </message>
+ <message>
+ <source>BUT_YES</source>
+ <translation>Yes</translation>
+ </message>
+ <message>
+ <source>QUE_WANT_SAME_UNITS</source>
+ <translation>Do you want to choose all items with the same units for vertical axis?</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_Sweep</name>
+ <message>
+ <source>TITLE</source>
+ <translation>Sweep</translation>
+ </message>
+ <message>
+ <source>MEN_SWEEP_PANE</source>
+ <translation>Sweep</translation>
+ </message>
+ <message>
+ <source>NAVIGATION_TAB</source>
+ <translation>Navigation</translation>
+ </message>
+ <message>
+ <source>START_SWEEP_POSITION</source>
+ <translation>0 %</translation>
+ </message>
+ <message>
+ <source>END_SWEEP_POSITION</source>
+ <translation>100 %</translation>
+ </message>
+ <message>
+ <source>IS_CYCLED</source>
+ <translation>Cycled</translation>
+ </message>
+ <message>
+ <source>PROPERTIES_TAB</source>
+ <translation>Properties</translation>
+ </message>
+ <message>
+ <source>MODE</source>
+ <translation>Mode:</translation>
+ </message>
+ <message>
+ <source>LINEAR</source>
+ <translation>Linear</translation>
+ </message>
+ <message>
+ <source>COSINUSOIDAL</source>
+ <translation>( 1 - cos( t ) ) / 2</translation>
+ </message>
+ <message>
+ <source>SINUSOIDAL</source>
+ <translation>sin( t - Pi / 2 )</translation>
+ </message>
+ <message>
+ <source>NUMBER_OF_STEPS</source>
+ <translation>Number Steps:</translation>
+ </message>
+ <message>
+ <source>INTERVAL</source>
+ <translation>Interval</translation>
+ </message>
+ <message>
+ <source>[ 0, +PI ]</source>
+ <translation>[ 0, +PI ]</translation>
+ </message>
+ <message>
+ <source>[ -PI, +PI ]</source>
+ <translation>[ -PI, +PI ]</translation>
+ </message>
+ <message>
+ <source>DELAY_BETWEEN_STEPS</source>
+ <translation>Step Delay [ sec ]:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_Slider</name>
+ <message>
+ <source>TITLE</source>
+ <translation>Slider</translation>
+ </message>
+ <message>
+ <source>MEN_SLIDER_PANE</source>
+ <translation>Slider</translation>
+ </message>
+ <message>
+ <source>NAVIGATION_TAB</source>
+ <translation>Navigation</translation>
+ </message>
+ <message>
+ <source>IS_CYCLED</source>
+ <translation>Cycled</translation>
+ </message>
+ <message>
+ <source>PROPERTIES_TAB</source>
+ <translation>Properties</translation>
+ </message>
+ <message>
+ <source>MINIMAL_MEMORY</source>
+ <translation>Minimal</translation>
+ </message>
+ <message>
+ <source>LIMITED_MEMORY</source>
+ <translation>Limited</translation>
+ </message>
+ <message>
+ <source>MEMORY_UNITS</source>
+ <translation>Mb</translation>
+ </message>
+ <message>
+ <source>USED_BY_CACHE</source>
+ <translation>Used:</translation>
+ </message>
+ <message>
+ <source>AVAILABLE_MEMORY</source>
+ <translation>Free:</translation>
+ </message>
+ <message>
+ <source>SPEED</source>
+ <translation>Speed</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_StreamLinesDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>DLG_TITLE</source>
+ <translation>Stream lines Preferences</translation>
+ </message>
+ <message>
+ <source>LBL_DIRECTION</source>
+ <translation>Direction</translation>
+ </message>
+ <message>
+ <source>LBL_INTEGRATION_STEP</source>
+ <translation>Integration Step</translation>
+ </message>
+ <message>
+ <source>LBL_PROPAGATION_TIME</source>
+ <translation>Propagation Time</translation>
+ </message>
+ <message>
+ <source>LBL_SOURCE_TYPE</source>
+ <translation>Source type</translation>
+ </message>
+ <message>
+ <source>LBL_STEP_LENGTH</source>
+ <translation>Step Length</translation>
+ </message>
+ <message>
+ <source>LBL_USED_POINTS</source>
+ <translation>Used points (0..1)</translation>
+ </message>
+ <message>
+ <source>MAGNITUDE_COLORING_CHK</source>
+ <translation>Magnitude coloring</translation>
+ </message>
+ <message>
+ <source>SOURCE_GRP</source>
+ <translation>Source</translation>
+ </message>
+ <message>
+ <source>USE_COLOR_BTN</source>
+ <translation>Use Color</translation>
+ </message>
+ <message>
+ <source>STREAM_MEMORY_ALERT</source>
+ <translation>Presentation can't be built using the initial parameters because of memory lack.
+Some parameters has been changed. Don you want to continue anyway?</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_SweepPrefDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>DLG_TITLE</source>
+ <translation>Sweeping Preferences</translation>
+ </message>
+ <message>
+ <source>LBL_NB_CYCLES</source>
+ <translation>Number of cycles:</translation>
+ </message>
+ <message>
+ <source>LBL_NB_STEPS</source>
+ <translation>Number of steps:</translation>
+ </message>
+ <message>
+ <source>LBL_TIME_STEP</source>
+ <translation>Time step (second):</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_TextPrefDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>LBL_BOLD</source>
+ <translation>Bold</translation>
+ </message>
+ <message>
+ <source>LBL_ITALIC</source>
+ <translation>Italic</translation>
+ </message>
+ <message>
+ <source>LBL_LABELS</source>
+ <translation>Labels</translation>
+ </message>
+ <message>
+ <source>LBL_SHADOW</source>
+ <translation>Shadow</translation>
+ </message>
+ <message>
+ <source>LBL_TITLE</source>
+ <translation>Title</translation>
+ </message>
+ <message>
+ <source>TIT_TEXT_PREF</source>
+ <translation>Text properties</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_TimeAnimationDlg</name>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>ERROR</source>
+ <translation>Error</translation>
+ </message>
+ <message>
+ <source>MSG_NO_ANIMATIONDATA</source>
+ <translation>There is no data for animation</translation>
+ </message>
+ <message>
+ <source>MSG_NO_AVI_MAKER</source>
+ <translation>Tool jpeg2yuv, necessary for AVI recording, is not available.
Please, refer to the documentation.</translation>
- </message>
- <message>
- <source>MSG_NO_SUPPORTED_IMAGE_FORMATS</source>
- <translation>There are no formats available for images output.
+ </message>
+ <message>
+ <source>MSG_NO_SUPPORTED_IMAGE_FORMATS</source>
+ <translation>There are no formats available for images output.
Please, refer to the QT documentation.</translation>
- </message>
- <message>
- <source>MSG_INVALID_IMAGE_FORMAT_INDEX</source>
- <translation>Selected image format is out of supported scope.</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_TransparencyDlg</name>
- <message>
- <source>BUT_CLOSE</source>
- <translation>Close</translation>
- </message>
- <message>
- <source>TRANSPARENCY_OPAQUE</source>
- <translation>Opaque</translation>
- </message>
- <message>
- <source>TRANSPARENCY_TITLE</source>
- <translation>Change Transparency</translation>
- </message>
- <message>
- <source>TRANSPARENCY_TRANSPARENT</source>
- <translation>Transparent</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_VectorsDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>ARROWS_BTN</source>
- <translation>Arrows</translation>
- </message>
- <message>
- <source>CENTER_BTN</source>
- <translation>Center</translation>
- </message>
- <message>
- <source>CONES2_BTN</source>
- <translation>Cones (2)</translation>
- </message>
- <message>
- <source>CONES6_BTN</source>
- <translation>Cones (6)</translation>
- </message>
- <message>
- <source>DLG_TITLE</source>
- <translation>Vector Field Representation</translation>
- </message>
- <message>
- <source>GLYPH_POSITION_GRP</source>
- <translation>Glyph position</translation>
- </message>
- <message>
- <source>GLYPH_TYPE_GRP</source>
- <translation>Glyph type</translation>
- </message>
- <message>
- <source>HEAD_BTN</source>
- <translation>Head</translation>
- </message>
- <message>
- <source>LBL_LINE_WIDTH</source>
- <translation>Line width:</translation>
- </message>
- <message>
- <source>LBL_SCALE_FACTOR</source>
- <translation>Scale factor:</translation>
- </message>
- <message>
- <source>MAGNITUDE_COLORING_CHK</source>
- <translation>Magnitude coloring</translation>
- </message>
- <message>
- <source>SEL_COLOR_BTN</source>
- <translation>Select Color</translation>
- </message>
- <message>
- <source>TAIL_BTN</source>
- <translation>Tail</translation>
- </message>
- <message>
- <source>USE_GLYPHS_CHK</source>
- <translation>Use glyphs</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_SelectionPanel</name>
- <message>
- <source>WINDOW_TITLE</source>
- <translation>Selection</translation>
- </message>
- <message>
- <source>MODE_TITLE</source>
- <translation>Selection</translation>
- </message>
- <message>
- <source>MODE_GAUSS_POINT</source>
- <translation>Gauss point</translation>
- </message>
- <message>
- <source>MODE_POINT</source>
- <translation>Point</translation>
- </message>
- <message>
- <source>MODE_CELL</source>
- <translation>Cell</translation>
- </message>
- <message>
- <source>MODE_ACTOR</source>
- <translation>Actor</translation>
- </message>
- <message>
- <source>MESH_NAME_LBL</source>
- <translation>Mesh name:</translation>
- </message>
- <message>
- <source>FIELD_NAME_LBL</source>
- <translation>Field name:</translation>
- </message>
- <message>
- <source>POINT_DATA_TITLE</source>
- <translation>Data of Point</translation>
- </message>
- <message>
- <source>DATA_ID_LBL</source>
- <translation>ID:</translation>
- </message>
- <message>
- <source>POINT_ID_HDR</source>
- <translation>PointID</translation>
- </message>
- <message>
- <source>CELL_ID_HDR</source>
- <translation>CellID</translation>
- </message>
- <message>
- <source>DATA_SCALAR_HDR</source>
- <translation>Scalar</translation>
- </message>
- <message>
- <source>DATA_VECTOR_HDR</source>
- <translation>Vector</translation>
- </message>
- <message>
- <source>POINT_INFO</source>
- <translation>Point Info</translation>
- </message>
- <message>
- <source>CELL_INFO</source>
- <translation>Cell Info</translation>
- </message>
- <message>
- <source>POINT_COORD_TITLE</source>
- <translation>Coordinates</translation>
- </message>
- <message>
- <source>CELL_DATA_TITLE</source>
- <translation>Data of Cell</translation>
- </message>
- <message>
- <source>CELL_DATA_ID_LBL</source>
- <translation>ID:</translation>
- </message>
- <message>
- <source>ACTOR_DATA_POSITION_TITLE</source>
- <translation>Position</translation>
- </message>
- <message>
- <source>ACTOR_DATA_SIZE_TITLE</source>
- <translation>Size</translation>
- </message>
- <message>
- <source>SELECTION_PREFERENCES</source>
- <translation>Selection preferences...</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_SelectionPrefDlg</name>
- <message>
- <source>TLT_SELECTION_PREFERENCES</source>
- <translation>Selection preferences</translation>
- </message>
- <message>
- <source>BELOW_POINT</source>
- <translation>Centered</translation>
- </message>
- <message>
- <source>CAMERA_TITLE</source>
- <translation>Movement of the camera</translation>
- </message>
- <message>
- <source>CURSOR_SIZE</source>
- <translation>Size of the cursor:</translation>
- </message>
- <message>
- <source>CURSOR_TITLE</source>
- <translation>Cursor</translation>
- </message>
- <message>
- <source>INFO_WINDOW_TITLE</source>
- <translation>Information window</translation>
- </message>
- <message>
- <source>POINT_TOLERANCE</source>
- <translation>Point tolerance:</translation>
- </message>
- <message>
- <source>POSITION</source>
- <translation>Position:</translation>
- </message>
- <message>
- <source>PYRAMID_HEIGHT</source>
- <translation>Height of the pyramids:</translation>
- </message>
- <message>
- <source>SELECTION_COLOR</source>
- <translation>Selection cursor color:</translation>
- </message>
- <message>
- <source>STEP_NUMBER</source>
- <translation>Number of steps:</translation>
- </message>
- <message>
- <source>STEP_NUMBER_TIP</source>
- <translation>Number of steps between two positions</translation>
- </message>
- <message>
- <source>TOLERANCE_TITLE</source>
- <translation>Tolerance</translation>
- </message>
- <message>
- <source>TOP_LEFT_CORNER</source>
- <translation>Top-left corner</translation>
- </message>
- <message>
- <source>TRANSPARENCY</source>
- <translation>Transparency:</translation>
- </message>
- <message>
- <source>ZOOM_FACTOR</source>
- <translation>Zoom factor:</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_BarPrefDlg</name>
- <message>
- <source>DIMENSIONS</source>
- <translation>Dimensions (in % of the size of widget)</translation>
- </message>
- <message>
- <source>WIDTH</source>
- <translation>Width</translation>
- </message>
- <message>
- <source>PRECISION</source>
- <translation>Precision</translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>TIT_BAR_PREF</source>
- <translation>Bar properties</translation>
- </message>
- <message>
- <source>LBL_TITLE_W</source>
- <translation>Title size (%)</translation>
- </message>
- <message>
- <source>LBL_LABEL_W</source>
- <translation>Label size (%)</translation>
- </message>
- <message>
- <source>LBL_LABEL_H</source>
- <translation>Label height (%)</translation>
- </message>
- <message>
- <source>LBL_BAR_W</source>
- <translation>Bar width (%)</translation>
- </message>
- <message>
- <source>LBL_BAR_H</source>
- <translation>Bar height (%)</translation>
- </message>
- <message>
- <source>LBL_SHOW_UNITS</source>
- <translation>Show units</translation>
- </message>
- <message>
- <source>LBL_UNITS_FORMAT</source>
- <translation>Format:</translation>
- </message>
- <message>
- <source>MSG_LABEL_FORMAT</source>
- <translation>Labels format is invalid.</translation>
- </message>
- <message>
- <source>MSG_BIG_SCALE</source>
- <translation>The common Label size and Bar width or height should not be greater then 100%.</translation>
- </message>
- <message>
- <source>MSG_BIG_SCALE_TLT</source>
- <translation>The Title size should not be greater then 100%.</translation>
- </message>
- <message>
- <source>AUTO</source>
- <translation>auto</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_Table3DDlg</name>
- <message>
- <source>DLG_PREF_TITLE</source>
- <translation>Table 3D Bar Preferences</translation>
- </message>
- <message>
- <source>DLG_PROP_TITLE</source>
- <translation>Scalar Bar Properties</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_TableScalarBarPane</name>
- <message>
- <source>SCALAR_RANGE_GRP</source>
- <translation>Scalar range</translation>
- </message>
- <message>
- <source>LOGARITHMIC_SCALING</source>
- <translation>Logarithmic scaling</translation>
- </message>
- <message>
- <source>FIELD_RANGE_BTN</source>
- <translation>Use field range</translation>
- </message>
- <message>
- <source>IMPOSED_RANGE_BTN</source>
- <translation>Use imposed range</translation>
- </message>
- <message>
- <source>LBL_MIN</source>
- <translation>Min:</translation>
- </message>
- <message>
- <source>LBL_MAX</source>
- <translation>Max:</translation>
- </message>
- <message>
- <source>COLORS_LABELS_GRP</source>
- <translation>Colors and labels</translation>
- </message>
- <message>
- <source>LBL_NB_COLORS</source>
- <translation>Nb. of colors:</translation>
- </message>
- <message>
- <source>LBL_NB_LABELS</source>
- <translation>Nb. of labels:</translation>
- </message>
- <message>
- <source>ORIENTATION_GRP</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>VERTICAL_BTN</source>
- <translation>Vertical</translation>
- </message>
- <message>
- <source>HORIZONTAL_BTN</source>
- <translation>Horizontal</translation>
- </message>
- <message>
- <source>ORIGIN_GRP</source>
- <translation>Origin</translation>
- </message>
- <message>
- <source>LBL_X</source>
- <translation>X:</translation>
- </message>
- <message>
- <source>LBL_Y</source>
- <translation>Y:</translation>
- </message>
- <message>
- <source>LBL_SHOW_PREVIEW</source>
- <translation>Show preview</translation>
- </message>
- <message>
- <source>DIMENSIONS_GRP</source>
- <translation>Dimensions</translation>
- </message>
- <message>
- <source>LBL_WIDTH</source>
- <translation>Width:</translation>
- </message>
- <message>
- <source>LBL_HEIGHT</source>
- <translation>Height:</translation>
- </message>
- <message>
- <source>SAVE_DEFAULT_CHK</source>
- <translation>Save as default values</translation>
- </message>
- <message>
- <source>MSG_MINMAX_VALUES</source>
- <translation>Min value can not be higher or equal to Max value</translation>
- </message>
- <message>
- <source>WRN_LOGARITHMIC_RANGE</source>
- <translation>Logarithmic scaling: use imposed range values > 0</translation>
- </message>
- <message>
- <source>WRN_LOGARITHMIC_FIELD_RANGE</source>
- <translation>Logarithmic scaling: field range contains negative values, use imposed range instead</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_Table3DPane</name>
- <message>
- <source>SCALE</source>
- <translation>Scale Factor:</translation>
- </message>
- <message>
- <source>PRESENTATION_TYPE</source>
- <translation>Presentation type</translation>
- </message>
- <message>
- <source>SURFACE</source>
- <translation>Surface</translation>
- </message>
- <message>
- <source>CONTOUR</source>
- <translation>Contour</translation>
- </message>
- <message>
- <source>NUMBER_CONTOURS</source>
- <translation>Number of contours:</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_FileInfoDlg</name>
- <message>
- <source>CAPTION</source>
- <translation>File information</translation>
- </message>
- <message>
- <source>FILE_NAME</source>
- <translation>File name</translation>
- </message>
- <message>
- <source>FILE_SIZE</source>
- <translation>File size (bytes)</translation>
- </message>
- <message>
- <source>MED_VERSION</source>
- <translation>MED version</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_ClippingPlaneMgr</name>
- <message>
- <source>TITLE</source>
- <translation>Clipping planes configuration</translation>
- </message>
- <message>
- <source>TITLE_PLANES</source>
- <translation>Planes definition</translation>
- </message>
- <message>
- <source>LBL_NAME</source>
- <translation>Name of the plane</translation>
- </message>
- <message>
- <source>BYVECTOR_TITLE</source>
- <translation>Normal vector</translation>
- </message>
- <message>
- <source>BYPLANE_TITLE</source>
- <translation>Main plane</translation>
- </message>
- <message>
- <source>CHK_AUTOAPPLY</source>
- <translation>Auto apply</translation>
- </message>
- <message>
- <source>CHK_SHOW_PREVIEW</source>
- <translation>Show preview</translation>
- </message>
- <message>
- <source>ORIGIN_TITLE</source>
- <translation>Origin</translation>
- </message>
- <message>
- <source>DIRECTION_TITLE</source>
- <translation>Direction</translation>
- </message>
- <message>
- <source>LBL_ORIENTATION</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>LBL_DISTANCE</source>
- <translation>Distance</translation>
- </message>
- <message>
- <source>LBL_ROTATION</source>
- <translation>Rotation around %1</translation>
- </message>
- <message>
- <source>BTN_NEW</source>
- <translation>New</translation>
- </message>
- <message>
- <source>BTN_DELETE</source>
- <translation>Delete</translation>
- </message>
- <message>
- <source>BTN_IMPORT</source>
- <translation>Import...</translation>
- </message>
- <message>
- <source>IMPORT_TITLE</source>
- <translation>Import from...</translation>
- </message>
- <message>
- <source>SELECT_VIEW</source>
- <translation>Select View window:</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_SegmentationMgr</name>
- <message>
- <source>MNU_CLIPPING_PLANE_MGR</source>
- <translation>Clipping planes</translation>
- </message>
- <message>
- <source>DSK_CLIPPING_PLANE_MGR</source>
- <translation>Manage clipping planes in the viewer</translation>
- </message>
- <message>
- <source>VISU_VIEW_TOOLBAR</source>
- <translation>VISU tools</translation>
- </message>
- <message>
- <source>VISU_SETPLANES_MNU</source>
- <translation>Set clipping plane...</translation>
- </message>
- <message>
- <source>MNU_SHOW_CLIPPINGPLANES</source>
- <translation>Show clipping planes</translation>
- </message>
- <message>
- <source>DSK_SHOW_CLIPPINGPLANES</source>
- <translation>Show/Hide clipping planes</translation>
- </message>
- <message>
- <source>MNU_ACTIVATE_CLIPPINGPLANES</source>
- <translation>Deactivate clipping planes</translation>
- </message>
- <message>
- <source>DSK_ACTIVATE_CLIPPINGPLANES</source>
- <translation>Activate/Deactivate clipping planes</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_ClippingPanel</name>
- <message>
- <source>TITLE</source>
- <translation>Clipping Planes</translation>
- </message>
- <message>
- <source>PRESENTATIONS_LBL</source>
- <translation>Presentations:</translation>
- </message>
- <message>
- <source>PLANES_LBL</source>
- <translation>Associated planes:</translation>
- </message>
- <message>
- <source>NEW_BTN</source>
- <translation>New...</translation>
- </message>
- <message>
- <source>EDIT_BTN</source>
- <translation>Edit...</translation>
- </message>
- <message>
- <source>DELETE_BTN</source>
- <translation>Delete</translation>
- </message>
- <message>
- <source>TIT_DELETE_PLANE</source>
- <translation>Delete clipping plane</translation>
- </message>
- <message>
- <source>MSG_DELETE_PLANE</source>
- <translation>Clipping plane %1 will be deleted. Continue?</translation>
- </message>
- <message>
- <source>CHK_SHOW_PLANES</source>
- <translation>Show planes preview</translation>
- </message>
- <message>
- <source>CHK_ACTIVATE_PLANES</source>
- <translation>Deactivate planes</translation>
- </message>
- <message>
- <source>CHK_AUTO_APPLY</source>
- <translation>Auto apply</translation>
- </message>
- <message>
- <source>PLANES_TABLE_TITLES</source>
- <translation>Plane,Active</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_ClippingPlaneDlg</name>
- <message>
- <source>TITLE</source>
- <translation>Clipping plane edit</translation>
- </message>
- <message>
- <source>LBL_NAME</source>
- <translation>Name of the plane</translation>
- </message>
- <message>
- <source>BYVECTOR_TITLE</source>
- <translation>Normal vector</translation>
- </message>
- <message>
- <source>BYPLANE_TITLE</source>
- <translation>Main plane</translation>
- </message>
- <message>
- <source>CHK_AUTOAPPLY</source>
- <translation>Global</translation>
- </message>
- <message>
- <source>CHK_SHOW_PREVIEW</source>
- <translation>Show preview</translation>
- </message>
- <message>
- <source>ORIGIN_TITLE</source>
- <translation>Origin</translation>
- </message>
- <message>
- <source>DIRECTION_TITLE</source>
- <translation>Direction</translation>
- </message>
- <message>
- <source>LBL_ORIENTATION</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>LBL_DISTANCE</source>
- <translation>Distance</translation>
- </message>
- <message>
- <source>LBL_ROTATION</source>
- <translation>Rotation around %1</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_FilterScalarsDlg</name>
- <message>
- <source>TITLE</source>
- <translation>Filtering by scalars</translation>
- </message>
- <message>
- <source>BOXTITLE</source>
- <translation>Filter by scalar range</translation>
- </message>
- <message>
- <source>MINLBL</source>
- <translation>Min:</translation>
- </message>
- <message>
- <source>MAXLBL</source>
- <translation>Max:</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_ValuesLabelingDlg</name>
- <message>
- <source>PARAMETERS_OF_VALUES_LABELING</source>
- <translation>Parameters of values labeling</translation>
- </message>
- <message>
- <source>LABELS</source>
- <translation>Labels</translation>
- </message>
- <message>
- <source>FONT</source>
- <translation>Font</translation>
- </message>
- <message>
- <source>COLOR</source>
- <translation>Color</translation>
- </message>
- </context>
+ </message>
+ <message>
+ <source>MSG_INVALID_IMAGE_FORMAT_INDEX</source>
+ <translation>Selected image format is out of supported scope.</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_TransparencyDlg</name>
+ <message>
+ <source>BUT_CLOSE</source>
+ <translation>Close</translation>
+ </message>
+ <message>
+ <source>TRANSPARENCY_OPAQUE</source>
+ <translation>Opaque</translation>
+ </message>
+ <message>
+ <source>TRANSPARENCY_TITLE</source>
+ <translation>Transparency</translation>
+ </message>
+ <message>
+ <source>TRANSPARENCY_TRANSPARENT</source>
+ <translation>Transparent</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_VectorsDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>ARROWS_BTN</source>
+ <translation>Arrows</translation>
+ </message>
+ <message>
+ <source>CENTER_BTN</source>
+ <translation>Center</translation>
+ </message>
+ <message>
+ <source>CONES2_BTN</source>
+ <translation>Cones (2)</translation>
+ </message>
+ <message>
+ <source>CONES6_BTN</source>
+ <translation>Cones (6)</translation>
+ </message>
+ <message>
+ <source>DLG_TITLE</source>
+ <translation>Vector Field Representation</translation>
+ </message>
+ <message>
+ <source>GLYPH_POSITION_GRP</source>
+ <translation>Glyph position</translation>
+ </message>
+ <message>
+ <source>GLYPH_TYPE_GRP</source>
+ <translation>Glyph type</translation>
+ </message>
+ <message>
+ <source>HEAD_BTN</source>
+ <translation>Head</translation>
+ </message>
+ <message>
+ <source>INPUT_TAB</source>
+ <translation>Input</translation>
+ </message>
+ <message>
+ <source>LBL_LINE_WIDTH</source>
+ <translation>Line width:</translation>
+ </message>
+ <message>
+ <source>LBL_SCALE_FACTOR</source>
+ <translation>Scale factor:</translation>
+ </message>
+ <message>
+ <source>MAGNITUDE_COLORING_CHK</source>
+ <translation>Magnitude coloring</translation>
+ </message>
+ <message>
+ <source>SCALAR_BAR_TAB</source>
+ <translation>Scalar Bar</translation>
+ </message>
+ <message>
+ <source>SEL_COLOR_BTN</source>
+ <translation>Select Color</translation>
+ </message>
+ <message>
+ <source>TAIL_BTN</source>
+ <translation>Tail</translation>
+ </message>
+ <message>
+ <source>USE_GLYPHS_CHK</source>
+ <translation>Use glyphs</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_SelectionPanel</name>
+ <message>
+ <source>WINDOW_TITLE</source>
+ <translation>Selection</translation>
+ </message>
+ <message>
+ <source>MODE_TITLE</source>
+ <translation>Selection</translation>
+ </message>
+ <message>
+ <source>MODE_GAUSS_POINT</source>
+ <translation>Gauss point</translation>
+ </message>
+ <message>
+ <source>MODE_POINT</source>
+ <translation>Point</translation>
+ </message>
+ <message>
+ <source>MODE_CELL</source>
+ <translation>Cell</translation>
+ </message>
+ <message>
+ <source>MODE_ACTOR</source>
+ <translation>Actor</translation>
+ </message>
+ <message>
+ <source>MESH_NAME_LBL</source>
+ <translation>Mesh name:</translation>
+ </message>
+ <message>
+ <source>FIELD_NAME_LBL</source>
+ <translation>Field name:</translation>
+ </message>
+ <message>
+ <source>POINT_DATA_TITLE</source>
+ <translation>Data of Point</translation>
+ </message>
+ <message>
+ <source>DATA_ID_LBL</source>
+ <translation>ID:</translation>
+ </message>
+ <message>
+ <source>POINT_ID_HDR</source>
+ <translation>PointID</translation>
+ </message>
+ <message>
+ <source>CELL_ID_HDR</source>
+ <translation>CellID</translation>
+ </message>
+ <message>
+ <source>DATA_SCALAR_HDR</source>
+ <translation>Scalar</translation>
+ </message>
+ <message>
+ <source>DATA_VECTOR_HDR</source>
+ <translation>Vector</translation>
+ </message>
+ <message>
+ <source>POINT_INFO</source>
+ <translation>Point Info</translation>
+ </message>
+ <message>
+ <source>CELL_INFO</source>
+ <translation>Cell Info</translation>
+ </message>
+ <message>
+ <source>POINT_COORD_TITLE</source>
+ <translation>Coordinates</translation>
+ </message>
+ <message>
+ <source>CELL_DATA_TITLE</source>
+ <translation>Data of Cell</translation>
+ </message>
+ <message>
+ <source>CELL_DATA_ID_LBL</source>
+ <translation>ID:</translation>
+ </message>
+ <message>
+ <source>ACTOR_DATA_POSITION_TITLE</source>
+ <translation>Position</translation>
+ </message>
+ <message>
+ <source>ACTOR_DATA_SIZE_TITLE</source>
+ <translation>Size</translation>
+ </message>
+ <message>
+ <source>SELECTION_PREFERENCES</source>
+ <translation>Selection preferences...</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_SelectionPrefDlg</name>
+ <message>
+ <source>TLT_SELECTION_PREFERENCES</source>
+ <translation>Selection preferences</translation>
+ </message>
+ <message>
+ <source>BELOW_POINT</source>
+ <translation>Centered</translation>
+ </message>
+ <message>
+ <source>CAMERA_TITLE</source>
+ <translation>Movement of the camera</translation>
+ </message>
+ <message>
+ <source>CURSOR_SIZE</source>
+ <translation>Size of the cursor:</translation>
+ </message>
+ <message>
+ <source>CURSOR_TITLE</source>
+ <translation>Cursor</translation>
+ </message>
+ <message>
+ <source>INFO_WINDOW_TITLE</source>
+ <translation>Information window</translation>
+ </message>
+ <message>
+ <source>POINT_TOLERANCE</source>
+ <translation>Point tolerance:</translation>
+ </message>
+ <message>
+ <source>POSITION</source>
+ <translation>Position:</translation>
+ </message>
+ <message>
+ <source>PYRAMID_HEIGHT</source>
+ <translation>Height of the pyramids:</translation>
+ </message>
+ <message>
+ <source>SELECTION_COLOR</source>
+ <translation>Selection cursor color:</translation>
+ </message>
+ <message>
+ <source>STEP_NUMBER</source>
+ <translation>Number of steps:</translation>
+ </message>
+ <message>
+ <source>STEP_NUMBER_TIP</source>
+ <translation>Number of steps between two positions</translation>
+ </message>
+ <message>
+ <source>TOLERANCE_TITLE</source>
+ <translation>Tolerance</translation>
+ </message>
+ <message>
+ <source>TOP_LEFT_CORNER</source>
+ <translation>Top-left corner</translation>
+ </message>
+ <message>
+ <source>TRANSPARENCY</source>
+ <translation>Transparency:</translation>
+ </message>
+ <message>
+ <source>ZOOM_FACTOR</source>
+ <translation>Zoom factor:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_BarPrefDlg</name>
+ <message>
+ <source>DIMENSIONS</source>
+ <translation>Dimensions (in % of the size of widget)</translation>
+ </message>
+ <message>
+ <source>WIDTH</source>
+ <translation>Width</translation>
+ </message>
+ <message>
+ <source>PRECISION</source>
+ <translation>Precision</translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>&Cancel</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>TIT_BAR_PREF</source>
+ <translation>Bar properties</translation>
+ </message>
+ <message>
+ <source>LBL_TITLE_W</source>
+ <translation>Title size (%)</translation>
+ </message>
+ <message>
+ <source>LBL_LABEL_W</source>
+ <translation>Label size (%)</translation>
+ </message>
+ <message>
+ <source>LBL_LABEL_H</source>
+ <translation>Label height (%)</translation>
+ </message>
+ <message>
+ <source>LBL_BAR_W</source>
+ <translation>Bar width (%)</translation>
+ </message>
+ <message>
+ <source>LBL_BAR_H</source>
+ <translation>Bar height (%)</translation>
+ </message>
+ <message>
+ <source>LBL_SHOW_UNITS</source>
+ <translation>Show units</translation>
+ </message>
+ <message>
+ <source>LBL_UNITS_FORMAT</source>
+ <translation>Format:</translation>
+ </message>
+ <message>
+ <source>MSG_LABEL_FORMAT</source>
+ <translation>Labels format is invalid.</translation>
+ </message>
+ <message>
+ <source>MSG_BIG_SCALE</source>
+ <translation>The common Label size and Bar width or height should not be greater then 100%.</translation>
+ </message>
+ <message>
+ <source>MSG_BIG_SCALE_TLT</source>
+ <translation>The Title size should not be greater then 100%.</translation>
+ </message>
+ <message>
+ <source>AUTO</source>
+ <translation>auto</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_Table3DDlg</name>
+ <message>
+ <source>DLG_PREF_TITLE</source>
+ <translation>Table 3D Bar Preferences</translation>
+ </message>
+ <message>
+ <source>DLG_PROP_TITLE</source>
+ <translation>Scalar Bar Properties</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_TableScalarBarPane</name>
+ <message>
+ <source>SCALAR_RANGE_GRP</source>
+ <translation>Scalar range</translation>
+ </message>
+ <message>
+ <source>LOGARITHMIC_SCALING</source>
+ <translation>Logarithmic scaling</translation>
+ </message>
+ <message>
+ <source>FIELD_RANGE_BTN</source>
+ <translation>Use field range</translation>
+ </message>
+ <message>
+ <source>IMPOSED_RANGE_BTN</source>
+ <translation>Use imposed range</translation>
+ </message>
+ <message>
+ <source>LBL_MIN</source>
+ <translation>Min:</translation>
+ </message>
+ <message>
+ <source>LBL_MAX</source>
+ <translation>Max:</translation>
+ </message>
+ <message>
+ <source>COLORS_LABELS_GRP</source>
+ <translation>Colors and labels</translation>
+ </message>
+ <message>
+ <source>LBL_NB_COLORS</source>
+ <translation>Nb. of colors:</translation>
+ </message>
+ <message>
+ <source>LBL_NB_LABELS</source>
+ <translation>Nb. of labels:</translation>
+ </message>
+ <message>
+ <source>ORIENTATION_GRP</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>VERTICAL_BTN</source>
+ <translation>Vertical</translation>
+ </message>
+ <message>
+ <source>HORIZONTAL_BTN</source>
+ <translation>Horizontal</translation>
+ </message>
+ <message>
+ <source>ORIGIN_GRP</source>
+ <translation>Origin</translation>
+ </message>
+ <message>
+ <source>LBL_X</source>
+ <translation>X:</translation>
+ </message>
+ <message>
+ <source>LBL_Y</source>
+ <translation>Y:</translation>
+ </message>
+ <message>
+ <source>LBL_SHOW_PREVIEW</source>
+ <translation>Show preview</translation>
+ </message>
+ <message>
+ <source>DIMENSIONS_GRP</source>
+ <translation>Dimensions</translation>
+ </message>
+ <message>
+ <source>LBL_WIDTH</source>
+ <translation>Width:</translation>
+ </message>
+ <message>
+ <source>LBL_HEIGHT</source>
+ <translation>Height:</translation>
+ </message>
+ <message>
+ <source>SAVE_DEFAULT_CHK</source>
+ <translation>Save as default values</translation>
+ </message>
+ <message>
+ <source>MSG_MINMAX_VALUES</source>
+ <translation>Min value can not be higher or equal to Max value</translation>
+ </message>
+ <message>
+ <source>WRN_LOGARITHMIC_RANGE</source>
+ <translation>Logarithmic scaling: use imposed range values > 0</translation>
+ </message>
+ <message>
+ <source>WRN_LOGARITHMIC_FIELD_RANGE</source>
+ <translation>Logarithmic scaling: field range contains negative values, use imposed range instead</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_Table3DPane</name>
+ <message>
+ <source>SCALE</source>
+ <translation>Scale Factor:</translation>
+ </message>
+ <message>
+ <source>PRESENTATION_TYPE</source>
+ <translation>Presentation type</translation>
+ </message>
+ <message>
+ <source>SURFACE</source>
+ <translation>Surface</translation>
+ </message>
+ <message>
+ <source>CONTOUR</source>
+ <translation>Contour</translation>
+ </message>
+ <message>
+ <source>NUMBER_CONTOURS</source>
+ <translation>Number of contours:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_FileInfoDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>File information</translation>
+ </message>
+ <message>
+ <source>FILE_NAME</source>
+ <translation>File name</translation>
+ </message>
+ <message>
+ <source>FILE_SIZE</source>
+ <translation>File size (bytes)</translation>
+ </message>
+ <message>
+ <source>MED_VERSION</source>
+ <translation>MED version</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ClippingPlaneMgr</name>
+ <message>
+ <source>TITLE</source>
+ <translation>Clipping planes configuration</translation>
+ </message>
+ <message>
+ <source>TITLE_PLANES</source>
+ <translation>Planes definition</translation>
+ </message>
+ <message>
+ <source>LBL_NAME</source>
+ <translation>Name of the plane</translation>
+ </message>
+ <message>
+ <source>BYVECTOR_TITLE</source>
+ <translation>Normal vector</translation>
+ </message>
+ <message>
+ <source>BYPLANE_TITLE</source>
+ <translation>Main plane</translation>
+ </message>
+ <message>
+ <source>CHK_AUTOAPPLY</source>
+ <translation>Auto apply</translation>
+ </message>
+ <message>
+ <source>CHK_SHOW_PREVIEW</source>
+ <translation>Show preview</translation>
+ </message>
+ <message>
+ <source>ORIGIN_TITLE</source>
+ <translation>Origin</translation>
+ </message>
+ <message>
+ <source>DIRECTION_TITLE</source>
+ <translation>Direction</translation>
+ </message>
+ <message>
+ <source>LBL_ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>LBL_DISTANCE</source>
+ <translation>Distance</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION</source>
+ <translation>Rotation around %1</translation>
+ </message>
+ <message>
+ <source>BTN_NEW</source>
+ <translation>New</translation>
+ </message>
+ <message>
+ <source>BTN_DELETE</source>
+ <translation>Delete</translation>
+ </message>
+ <message>
+ <source>BTN_IMPORT</source>
+ <translation>Import...</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation>Import from...</translation>
+ </message>
+ <message>
+ <source>SELECT_VIEW</source>
+ <translation>Select View window:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_SegmentationMgr</name>
+ <message>
+ <source>MNU_CLIPPING_PLANE_MGR</source>
+ <translation>Clipping planes</translation>
+ </message>
+ <message>
+ <source>DSK_CLIPPING_PLANE_MGR</source>
+ <translation>Manage clipping planes in the viewer</translation>
+ </message>
+ <message>
+ <source>VISU_VIEW_TOOLBAR</source>
+ <translation>VISU tools</translation>
+ </message>
+ <message>
+ <source>VISU_SETPLANES_MNU</source>
+ <translation>Set clipping plane...</translation>
+ </message>
+ <message>
+ <source>MNU_SHOW_CLIPPINGPLANES</source>
+ <translation>Show clipping planes</translation>
+ </message>
+ <message>
+ <source>DSK_SHOW_CLIPPINGPLANES</source>
+ <translation>Show/Hide clipping planes</translation>
+ </message>
+ <message>
+ <source>MNU_ACTIVATE_CLIPPINGPLANES</source>
+ <translation>Deactivate clipping planes</translation>
+ </message>
+ <message>
+ <source>DSK_ACTIVATE_CLIPPINGPLANES</source>
+ <translation>Activate/Deactivate clipping planes</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ClippingPanel</name>
+ <message>
+ <source>TITLE</source>
+ <translation>Clipping Planes</translation>
+ </message>
+ <message>
+ <source>PRESENTATIONS_LBL</source>
+ <translation>Presentations:</translation>
+ </message>
+ <message>
+ <source>PLANES_LBL</source>
+ <translation>Associated planes:</translation>
+ </message>
+ <message>
+ <source>NEW_BTN</source>
+ <translation>New...</translation>
+ </message>
+ <message>
+ <source>EDIT_BTN</source>
+ <translation>Edit...</translation>
+ </message>
+ <message>
+ <source>DELETE_BTN</source>
+ <translation>Delete</translation>
+ </message>
+ <message>
+ <source>TIT_DELETE_PLANE</source>
+ <translation>Delete clipping plane</translation>
+ </message>
+ <message>
+ <source>MSG_DELETE_PLANE</source>
+ <translation>Clipping plane %1 will be deleted. Continue?</translation>
+ </message>
+ <message>
+ <source>CHK_SHOW_PLANES</source>
+ <translation>Show planes preview</translation>
+ </message>
+ <message>
+ <source>CHK_ACTIVATE_PLANES</source>
+ <translation>Deactivate planes</translation>
+ </message>
+ <message>
+ <source>CHK_AUTO_APPLY</source>
+ <translation>Auto apply</translation>
+ </message>
+ <message>
+ <source>PLANES_TABLE_TITLES</source>
+ <translation>Plane,Active</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ClippingPlaneDlg</name>
+ <message>
+ <source>TITLE</source>
+ <translation>Clipping plane edit</translation>
+ </message>
+ <message>
+ <source>LBL_NAME</source>
+ <translation>Name of the plane</translation>
+ </message>
+ <message>
+ <source>BYVECTOR_TITLE</source>
+ <translation>Normal vector</translation>
+ </message>
+ <message>
+ <source>BYPLANE_TITLE</source>
+ <translation>Main plane</translation>
+ </message>
+ <message>
+ <source>CHK_AUTOAPPLY</source>
+ <translation>Global</translation>
+ </message>
+ <message>
+ <source>CHK_SHOW_PREVIEW</source>
+ <translation>Show preview</translation>
+ </message>
+ <message>
+ <source>ORIGIN_TITLE</source>
+ <translation>Origin</translation>
+ </message>
+ <message>
+ <source>DIRECTION_TITLE</source>
+ <translation>Direction</translation>
+ </message>
+ <message>
+ <source>LBL_ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>LBL_DISTANCE</source>
+ <translation>Distance</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION</source>
+ <translation>Rotation around %1</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_FilterScalarsDlg</name>
+ <message>
+ <source>TITLE</source>
+ <translation>Filtering by scalars</translation>
+ </message>
+ <message>
+ <source>BOXTITLE</source>
+ <translation>Filter by scalar range</translation>
+ </message>
+ <message>
+ <source>MINLBL</source>
+ <translation>Min:</translation>
+ </message>
+ <message>
+ <source>MAXLBL</source>
+ <translation>Max:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ValuesLabelingDlg</name>
+ <message>
+ <source>PARAMETERS_OF_VALUES_LABELING</source>
+ <translation>Parameters of values labeling</translation>
+ </message>
+ <message>
+ <source>LABELS</source>
+ <translation>Labels</translation>
+ </message>
+ <message>
+ <source>FONT</source>
+ <translation>Font</translation>
+ </message>
+ <message>
+ <source>COLOR</source>
+ <translation>Color</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ShrinkFactorDlg</name>
+ <message>
+ <source>SHRINKFACTOR_TITLE</source>
+ <translation>Change Shrink Factor</translation>
+ </message>
+ <message>
+ <source>SHRINKFACTOR_VALUE</source>
+ <translation>Shrink Factor:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_PrimitiveBox</name>
+ <message>
+ <source>ALPHA_TEXTURE</source>
+ <translation>Alpha Channel Texture (16x16) : </translation>
+ </message>
+ <message>
+ <source>ALPHA_THRESHOLD</source>
+ <translation>Alpha Channel Threshold : </translation>
+ </message>
+ <message>
+ <source>CLAMP</source>
+ <translation>Maximum Size (Clamp) : </translation>
+ </message>
+ <message>
+ <source>FACE_LIMIT</source>
+ <translation>Notify when number of faces exceeds : </translation>
+ </message>
+ <message>
+ <source>FACE_NUMBER</source>
+ <translation>Number of faces : </translation>
+ </message>
+ <message>
+ <source>GEOMETRICAL_SPHERE</source>
+ <translation>Geometrical Sphere</translation>
+ </message>
+ <message>
+ <source>MAIN_TEXTURE</source>
+ <translation>Main Texture (16x16) : </translation>
+ </message>
+ <message>
+ <source>OPENGL_POINT</source>
+ <translation>OpenGL Point</translation>
+ </message>
+ <message>
+ <source>POINT_SPRITE</source>
+ <translation>Point Sprite</translation>
+ </message>
+ <message>
+ <source>PRIMITIVE_TITLE</source>
+ <translation>Primitive</translation>
+ </message>
+ <message>
+ <source>RESOLUTION</source>
+ <translation>Resolution : </translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_SizeBox</name>
+ <message>
+ <source>COLOR</source>
+ <translation>Color : </translation>
+ </message>
+ <message>
+ <source>COLOR_TITLE</source>
+ <translation>Color</translation>
+ </message>
+ <message>
+ <source>GEOM_SIZE</source>
+ <translation>Size of points (%) : </translation>
+ </message>
+ <message>
+ <source>INCREMENT</source>
+ <translation>+/- Ratio : </translation>
+ </message>
+ <message>
+ <source>MAGNIFICATION</source>
+ <translation>Magnification (%) : </translation>
+ </message>
+ <message>
+ <source>MAX_SIZE</source>
+ <translation>max size (%) : </translation>
+ </message>
+ <message>
+ <source>MIN_SIZE</source>
+ <translation>Range values for min size (%) : </translation>
+ </message>
+ <message>
+ <source>OUTSIDE_SIZE</source>
+ <translation>Percentage of normal size(%) : </translation>
+ </message>
+ <message>
+ <source>SIZE_TITLE</source>
+ <translation>Size</translation>
+ </message>
+ <message>
+ <source>UNIFORM_COLOR</source>
+ <translation>Uniform Color</translation>
+ </message>
+</context>
+<context>
+ <name>VISU_TableDlg</name>
+ <message>
+ <source>ERR_TABLE_NOT_AVAILABLE</source>
+ <translation>Table is not available</translation>
+ </message>
+ <message>
+ <source>TABLE_OF_INTEGER_TLT</source>
+ <translation>Table of integer</translation>
+ </message>
+ <message>
+ <source>TABLE_OF_REAL_TLT</source>
+ <translation>Table of real</translation>
+ </message>
+ <message>
+ <source>TABLE_UNKNOWN_TLT</source>
+ <translation>Table of unknown</translation>
+ </message>
+ <message>
+ <source>VIEW_TABLE_TLT</source>
+ <translation>View Table</translation>
+ </message>
+ <message>
+ <source>ALLOW_EDIT_CHECK</source>
+ <translation>Enable editing</translation>
+ </message>
+ <message>
+ <source>DO_UPDATE_CHECK</source>
+ <translation>Immediate update</translation>
+ </message>
+ <message>
+ <source>ADD_COLUMN_BTN</source>
+ <translation>Add Column</translation>
+ </message>
+ <message>
+ <source>ADD_ROW_BTN</source>
+ <translation>Add Row</translation>
+ </message>
+ <message>
+ <source>ADJUST_CELLS_BTN</source>
+ <translation>Adjust Cells</translation>
+ </message>
+ <message>
+ <source>CLEAR_BTN</source>
+ <translation>Clear</translation>
+ </message>
+ <message>
+ <source>REMOVE_COLUMN_BTN</source>
+ <translation>Remove Column(s)</translation>
+ </message>
+ <message>
+ <source>REMOVE_ROW_BTN</source>
+ <translation>Remove Row(s)</translation>
+ </message>
+ <message>
+ <source>SELECT_ALL_BTN</source>
+ <translation>Select All</translation>
+ </message>
+ <message>
+ <source>SET_TITLE_TLT</source>
+ <translation>Set title</translation>
+ </message>
+ <message>
+ <source>TITLE_LBL</source>
+ <translation>Title:</translation>
+ </message>
+ <message>
+ <source>UNITS_TLT</source>
+ <translation>Units</translation>
+ </message>
+</context>
</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+ <name>@default</name>
+ <message>
+ <source>ASSIGNED</source>
+ <translation>Attribué</translation>
+ </message>
+ <message>
+ <source>ATTRIBUTES_LBL</source>
+ <translation>Attributs</translation>
+ </message>
+ <message>
+ <source>AXIS_LBL</source>
+ <translation>Axe</translation>
+ </message>
+ <message>
+ <source>BTN_RESET</source>
+ <translation>Réinitialiser</translation>
+ </message>
+ <message>
+ <source>DATA_LBL</source>
+ <translation>Données</translation>
+ </message>
+ <message>
+ <source>ERR_CANT_BUILD_PRESENTATION</source>
+ <translation>Impossible de construire l'objet</translation>
+ </message>
+ <message>
+ <source>ERR_CANT_CREATE_ACTOR</source>
+ <translation>Impossible de créer l'acteur pour cette présentation</translation>
+ </message>
+ <message>
+ <source>ERR_CANT_CREATE_ANIMATION</source>
+ <translation>Impossible de créer l'animation pour ces champs:
+Le nombre de pas de temps ou le nombre de composants ne sont pas les mêmes!</translation>
+ </message>
+ <message>
+ <source>ERR_CANT_CREATE_EVOLUTION</source>
+ <translation>Impossible de créer l'évolution pour ce champ!</translation>
+ </message>
+ <message>
+ <source>ERR_CANT_FIND_MED_COMPONENT</source>
+ <translation>Impossible d'activer le composant MED!</translation>
+ </message>
+ <message>
+ <source>ERR_CANT_FIND_VISU_COMPONENT</source>
+ <translation>Impossible d'activer le composant VISU!</translation>
+ </message>
+ <message>
+ <source>ERR_NO_MEMORY_TO_BUILD</source>
+ <translation>Libérez %1 Mb pour élargir le cache
+(par exemple, essayez de supprimer quelques teneurs)</translation>
+ </message>
+ <message>
+ <source>IMPORT_DONE</source>
+ <translation>L'importation est accomplie</translation>
+ </message>
+ <message>
+ <source>INF_DONE</source>
+ <translation> complet</translation>
+ </message>
+ <message>
+ <source>INF_VISU</source>
+ <translation>Post-Pro Info</translation>
+ </message>
+ <message>
+ <source>NO_GROUPS</source>
+ <translation>Pas de groupes dans le maillage</translation>
+ </message>
+ <message>
+ <source>PARALLEL_ANIMATION</source>
+ <translation>Animation parallèle</translation>
+ </message>
+ <message>
+ <source>PERIOD_2PI</source>
+ <translation>De -PI Ã PI</translation>
+ </message>
+ <message>
+ <source>PERIOD_PI</source>
+ <translation>De 0 Ã PI</translation>
+ </message>
+ <message>
+ <source>PRS_ON_GROUPS</source>
+ <translation>Utiliser seulement les groupes</translation>
+ </message>
+ <message>
+ <source>SUCCESSIVE_ANIMATION</source>
+ <translation>Animation successive</translation>
+ </message>
+ <message>
+ <source>TIT_OFFSETDLG</source>
+ <translation>Translater la présentation</translation>
+ </message>
+ <message>
+ <source>TLT_SETUP_PLOT2D</source>
+ <translation>Définir le graphe 2d</translation>
+ </message>
+ <message>
+ <source>UNITS_LBL</source>
+ <translation>Unités</translation>
+ </message>
+ <message>
+ <source>DVTN_LBL</source>
+ <translation>Déviation</translation>
+ </message>
+ <message>
+ <source>VISU_3DCACHE_PREFERENCES</source>
+ <translation>Cache 3D</translation>
+ </message>
+ <message>
+ <source>VISU_ANIMATION_PREFERENCES</source>
+ <translation>Animation</translation>
+ </message>
+ <message>
+ <source>Speed</source>
+ <translation>Vitesse</translation>
+ </message>
+ <message>
+ <source>Cycled animation</source>
+ <translation>Animation en boucle</translation>
+ </message>
+ <message>
+ <source>Use proportional timing</source>
+ <translation>Timing proportionnel</translation>
+ </message>
+ <message>
+ <source>Clean memory at each frame</source>
+ <translation>Effacer la mémoire à chaque image</translation>
+ </message>
+ <message>
+ <source>VISU_COLORS_AND_LABELS</source>
+ <translation>Couleurs && Libellés</translation>
+ </message>
+ <message>
+ <source>VISU_COMPONENT</source>
+ <translation>Composant</translation>
+ </message>
+ <message>
+ <source>VISU_COS_SWEEP</source>
+ <translation>Cosinusoidal ( (1 - cos(t))/2 )</translation>
+ </message>
+ <message>
+ <source>VISU_CUT_LINES</source>
+ <translation>Lignes de coupe</translation>
+ </message>
+ <message>
+ <source>VISU_CUT_LINES_SEGMENT</source>
+ <translation>Lignes/Segments de coupe</translation>
+ </message>
+ <message>
+ <source>VISU_CUT_LINES_SEGMENT_PREF</source>
+ <translation>Préférences de lignes/segments de coupe</translation>
+ </message>
+ <message>
+ <source>Show preview</source>
+ <translation>Prévisualiser</translation>
+ </message>
+ <message>
+ <source>Invert all curves</source>
+ <translation>Inverser toutes les courbes</translation>
+ </message>
+ <message>
+ <source>Use absolute length</source>
+ <translation>Utiliser des longueurs absolues</translation>
+ </message>
+ <message>
+ <source>Generate data table</source>
+ <translation>Générer le tableau de données</translation>
+ </message>
+ <message>
+ <source>Generate curves</source>
+ <translation>Générer les courbes</translation>
+ </message>
+ <message>
+ <source>VISU_CUT_SEGMENT</source>
+ <translation>Segments de coupe</translation>
+ </message>
+ <message>
+ <source>VISU_CUT_PLANES</source>
+ <translation>Plans de coupe</translation>
+ </message>
+ <message>
+ <source>VISU_DEFORMED_SHAPE</source>
+ <translation>Déformation</translation>
+ </message>
+ <message>
+ <source>VISU_DEFORMED_SHAPE_AND_SCALAR_MAP</source>
+ <translation>Déformation et carte scalaire</translation>
+ </message>
+ <message>
+ <source>VISU_DISP_ONLY</source>
+ <translation>A la création, affichage uniquement</translation>
+ </message>
+ <message>
+ <source>VISU_DUMP_MODE</source>
+ <translation>Mode de sauvegarde</translation>
+ </message>
+ <message>
+ <source>VISU_DUMP_PICTURES</source>
+ <translation>Sauvegarder les images dans le répertoire</translation>
+ </message>
+ <message>
+ <source>VISU_DUMP_VIDEO</source>
+ <translation>Sauvegarder l'animation au format AVI</translation>
+ </message>
+ <message>
+ <source>VISU_EDGE_COLOR</source>
+ <translation>Couleur des arêtes</translation>
+ </message>
+ <message>
+ <source>VISU_ELEM0D_SIZE</source>
+ <translation>Taille des éléments 0D</translation>
+ </message>
+ <message>
+ <source>VISU_FEATURE_EDGES</source>
+ <translation>Caractéristiques des arêtes</translation>
+ </message>
+ <message>
+ <source>VISU_FEATURE_EDGES_ANGLE</source>
+ <translation>Angle des arêtes</translation>
+ </message>
+ <message>
+ <source>VISU_FEATURE_EDGES_COLORING</source>
+ <translation>Couleur</translation>
+ </message>
+ <message>
+ <source>VISU_FEATURE_EDGES_PROPS</source>
+ <translation>Propriétés des arêtes </translation>
+ </message>
+ <message>
+ <source>VISU_FIELD_RANGE</source>
+ <translation>Intervalle de valeurs du Champs</translation>
+ </message>
+ <message>
+ <source>VISU_FONT</source>
+ <translation>Police</translation>
+ </message>
+ <message>
+ <source>VISU_FONT_ARIAL</source>
+ <translation>Arial</translation>
+ </message>
+ <message>
+ <source>VISU_FONT_COURIER</source>
+ <translation>Courrier</translation>
+ </message>
+ <message>
+ <source>VISU_FONT_TIMES</source>
+ <translation>Times</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_METRIC</source>
+ <translation>Métrique Gauss</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_METRIC_AVERAGE</source>
+ <translation>Moyenne</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_METRIC_MAXIMUM</source>
+ <translation>Maximum</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_METRIC_MINIMUM</source>
+ <translation>Minimum</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_METRIC_TOOLTIP</source>
+ <translation>Sélectionner les données à visualiser sur la cellule</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_POINT</source>
+ <translation>Point de Gauss</translation>
+ </message>
+ <message>
+ <source>VISU_HEIGHT</source>
+ <translation>Hauteur:</translation>
+ </message>
+ <message>
+ <source>VISU_HORIZONTAL</source>
+ <translation>Horizontale</translation>
+ </message>
+ <message>
+ <source>Scalar bars default position</source>
+ <translation>Propriétés par défaut des barres scalaires</translation>
+ </message>
+ <message>
+ <source>Arrange Scalar Bars</source>
+ <translation>Organiser les barres scalaires</translation>
+ </message>
+ <message>
+ <source>VISU_IMPOSED_RANGE</source>
+ <translation>Intervalle de valeurs Imposé</translation>
+ </message>
+ <message>
+ <source>VISU_IS2PI</source>
+ <translation>Le paramètre varie:</translation>
+ </message>
+ <message>
+ <source>VISU_ISO_SURFACES</source>
+ <translation>Surfaces isométriques</translation>
+ </message>
+ <message>
+ <source>VISU_LABELS</source>
+ <translation>Libellés</translation>
+ </message>
+ <message>
+ <source>VISU_LIMITED</source>
+ <translation>Limité</translation>
+ </message>
+ <message>
+ <source>VISU_LINEAR_SWEEP</source>
+ <translation>Linéaire</translation>
+ </message>
+ <message>
+ <source>VISU_LOGARITHMIC_SCALING</source>
+ <translation>Logarithmique</translation>
+ </message>
+ <message>
+ <source>VISU_MARKER_SCALE</source>
+ <translation>Echelle du repère</translation>
+ </message>
+ <message>
+ <source>VISU_MAX</source>
+ <translation>Max:</translation>
+ </message>
+ <message>
+ <source>VISU_MEMORY_LIMIT</source>
+ <translation>Limite de la mémoire (Mb)</translation>
+ </message>
+ <message>
+ <source>VISU_MEMORY_MODE</source>
+ <translation>Mode de la mémoire</translation>
+ </message>
+ <message>
+ <source>VISU_MESH</source>
+ <translation>Maillage</translation>
+ </message>
+ <message>
+ <source>VISU_MIN</source>
+ <translation>Min:</translation>
+ </message>
+ <message>
+ <source>VISU_MINIMAL</source>
+ <translation>Minimal</translation>
+ </message>
+ <message>
+ <source>VISU_MINMAX_IMPOSED_RANGE</source>
+ <translation>Min et max de l'intervalle de valeurs imposé</translation>
+ </message>
+ <message>
+ <source>VISU_MODULUS</source>
+ <translation>Module</translation>
+ </message>
+ <message>
+ <source>VISU_NB_COLORS</source>
+ <translation>Nb. de couleurs</translation>
+ </message>
+ <message>
+ <source>VISU_NB_CYCLES</source>
+ <translation>Nombre de cycles</translation>
+ </message>
+ <message>
+ <source>VISU_NB_LABELS</source>
+ <translation>Nb. de repères</translation>
+ </message>
+ <message>
+ <source>VISU_NB_STEPS</source>
+ <translation>Nombre de pas</translation>
+ </message>
+ <message>
+ <source>VISU_NO_DUMP</source>
+ <translation>Pas de sauvegarde</translation>
+ </message>
+ <message>
+ <source>VISU_ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>VISU_ORIGIN_AND_SIZE</source>
+ <translation>Origine && taille</translation>
+ </message>
+ <message>
+ <source>VISU_PLOT3D</source>
+ <translation>Plot3D</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_MED_FULL_LOAD</source>
+ <translation>Chargement complet de MED</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_MED_IMPORT</source>
+ <translation>Importer des fichiers MED</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_SECOND_TAB</source>
+ <translation>Ecart de valeurs, balayage, importation MED, ombrage</translation>
+ </message>
+ <message>
+ <source>VISU_RANGE_TO_USE</source>
+ <translation>Intervalle de valeurs à utiliser</translation>
+ </message>
+ <message>
+ <source>Representation</source>
+ <translation>Représentation </translation>
+ </message>
+ <message>
+ <source>VISU_REPRESENT_PROPS</source>
+ <translation>Propriétés de la représentation </translation>
+ </message>
+ <message>
+ <source>VISU_SCALAR_BAR</source>
+ <translation>Barre scalaire</translation>
+ </message>
+ <message>
+ <source>VISU_SCALAR_MAP</source>
+ <translation>Carte scalaire</translation>
+ </message>
+ <message>
+ <source>VISU_SCALAR_MAP_ON_DEFORMED_SHAPE</source>
+ <translation>Carte scalaire sur une déformation</translation>
+ </message>
+ <message>
+ <source>VISU_SCALAR_MODE</source>
+ <translation>Mode scalaire</translation>
+ </message>
+ <message>
+ <source>VISU_SCALAR_RANGE</source>
+ <translation>Intervalle de valeurs scalaire:</translation>
+ </message>
+ <message>
+ <source>VISU_SHOW_BOUNDARY_EDGES</source>
+ <translation>Montrer les arêtes frontières</translation>
+ </message>
+ <message>
+ <source>VISU_SHOW_FEATURE_EDGES</source>
+ <translation>Montrer les arêtes</translation>
+ </message>
+ <message>
+ <source>VISU_SHOW_MANIFOLD_EDGES</source>
+ <translation>Montrer les arêtes complexes</translation>
+ </message>
+ <message>
+ <source>VISU_SHOW_NON_MANIFOLD_EDGES</source>
+ <translation>Montrer les arêtes simples</translation>
+ </message>
+ <message>
+ <source>VISU_SHRINK</source>
+ <translation>Contraction</translation>
+ </message>
+ <message>
+ <source>VISU_SIN_SWEEP</source>
+ <translation>Sinusoidal ( sin( t - PI/2 ) )</translation>
+ </message>
+ <message>
+ <source>VISU_STREAM_LINES</source>
+ <translation>Lignes de courant</translation>
+ </message>
+ <message>
+ <source>VISU_STREAM_LINES_PREF</source>
+ <translation>Préférences des lignes de courant</translation>
+ </message>
+ <message>
+ <source>VISU_STREAM_LINES_USED_POINTS</source>
+ <translation>Points utilisés</translation>
+ </message>
+ <message>
+ <source>VISU_SWEEPING_MODES</source>
+ <translation>Mode de balayage</translation>
+ </message>
+ <message>
+ <source>VISU_SWEEPING_PREF</source>
+ <translation>Préférences du balayage</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES</source>
+ <translation>Tables</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_EDITING_PROPS</source>
+ <translation>Paramètres d'édition des tables</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_ENABLE_EDITING</source>
+ <translation>Permettre l'édition</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_SORT_POLICY</source>
+ <translation>Règles de triage</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_EMPTY_LOWEST</source>
+ <translation>Les cellules vides sont considérées comme les valeurs les plus basses</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_EMPTY_HIGHEST</source>
+ <translation>Les cellules vides sont considérées comme les valeurs les plus hautes</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_EMPTY_FIRST</source>
+ <translation>Les cellules vides sont toujours les premières</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_EMPTY_LAST</source>
+ <translation>Les cellules vides sont toujours les dernières</translation>
+ </message>
+ <message>
+ <source>VISU_TABLES_EMPTY_IGNORE</source>
+ <translation>Les cellules vides sont ignorées</translation>
+ </message>
+ <message>
+ <source>VISU_TIME_STAMP_FREQUENCY</source>
+ <translation>Fréquence du pas de temps (pour générer AVI)</translation>
+ </message>
+ <message>
+ <source>VISU_TIME_STEP</source>
+ <translation>Pas de temps (secondes)</translation>
+ </message>
+ <message>
+ <source>VISU_TITLE</source>
+ <translation>Titre</translation>
+ </message>
+ <message>
+ <source>VISU_TYPE_OF_MARKER</source>
+ <translation>Type de repère</translation>
+ </message>
+ <message>
+ <source>QUADRATIC_REPRESENT_MODE</source>
+ <translation>Représentation des éléments 2D quadratiques</translation>
+ </message>
+ <message>
+ <source>MAX_ARC_ANGLE</source>
+ <translation>Angle maximal</translation>
+ </message>
+ <message>
+ <source>VISU_SHRINK_FACTOR</source>
+ <translation>Facteur de contraction</translation>
+ </message>
+ <message>
+ <source>VISU_USE_SHADING</source>
+ <translation>Utiliser l'ombrage</translation>
+ </message>
+ <message>
+ <source>VISU_VECTORS</source>
+ <translation>Vecteurs</translation>
+ </message>
+ <message>
+ <source>VISU_VERTICAL</source>
+ <translation>Verticale</translation>
+ </message>
+ <message>
+ <source>VISU_WIDTH</source>
+ <translation>Largeur:</translation>
+ </message>
+ <message>
+ <source>VISU_X</source>
+ <translation>X:</translation>
+ </message>
+ <message>
+ <source>VISU_Y</source>
+ <translation>Y:</translation>
+ </message>
+ <message>
+ <source>WRN_EXTRA_MEMORY_REQUIRED</source>
+ <translation>Le cache demande plus de mémoire pour construire la présentation (%1 Mb).
+Voulez-vous l'agrandir?</translation>
+ </message>
+ <message>
+ <source>WRN_NO_AVAILABLE_DATA</source>
+ <translation>Pas de données disponibles dans la sélection</translation>
+ </message>
+ <message>
+ <source>WRN_STUDY_LOCKED</source>
+ <translation>L'étude courante est fermée</translation>
+ </message>
+ <message>
+ <source>WRN_VISU</source>
+ <translation>Avertissement Post-Pro</translation>
+ </message>
+ <message>
+ <source>WRN_VISU_WARNING</source>
+ <translation>Avertissement</translation>
+ </message>
+ <message>
+ <source>INF_FAILED</source>
+ <translation> impossible!</translation>
+ </message>
+ <message>
+ <source>VISU_IS_UNITS</source>
+ <translation>Montrer les unités dans le titre</translation>
+ </message>
+ <message>
+ <source>VISU_LABELS_FORMAT</source>
+ <translation>Format des libellés</translation>
+ </message>
+ <message>
+ <source>VISU_TITLE_SIZE</source>
+ <translation>Taille du titre (%):</translation>
+ </message>
+ <message>
+ <source>VISU_TITLE_HEIGHT</source>
+ <translation>Hauteur du titre (%):</translation>
+ </message>
+ <message>
+ <source>VISU_LABEL_SIZE</source>
+ <translation>Taille des libellés (%):</translation>
+ </message>
+ <message>
+ <source>VISU_LABEL_HEIGHT</source>
+ <translation>Hauteur des libellés (%):</translation>
+ </message>
+ <message>
+ <source>VISU_BAR_WIDTH</source>
+ <translation>Largeur de la barre (%):</translation>
+ </message>
+ <message>
+ <source>VISU_BAR_HEIGHT</source>
+ <translation>Hauteur de la barre (%):</translation>
+ </message>
+ <message>
+ <source>VISU_AUTOMATIC_FIT_ALL</source>
+ <translation>Zoom adapté automatique</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_GENERAL</source>
+ <translation>Général</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_GROUP_PRECISION</source>
+ <translation>Précision des champs d'entrée</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_visual_data_precision</source>
+ <translation>Précision des données visuelles</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_length_precision</source>
+ <translation>Précision de la longueur</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_angle_precision</source>
+ <translation>Précision angulaire</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_len_tol_precision</source>
+ <translation>Tolérance de la précision de la longueur</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_parametric_precision</source>
+ <translation>Précision paramétrique</translation>
+ </message>
+ <message>
+ <source>VISU_PREF_memory_precision</source>
+ <translation>Précision de la taille de la mémoire</translation>
+ </message>
+ <message>
+ <source>MED import</source>
+ <translation>Import MED</translation>
+ </message>
+ <message>
+ <source>MED files import</source>
+ <translation>Import de fichiers MED</translation>
+ </message>
+ <message>
+ <source>Use build progress</source>
+ <translation>Utiliser les paramètres d'import au chargement</translation>
+ </message>
+ <message>
+ <source>Full MED loading</source>
+ <translation>Charger tout le fichier</translation>
+ </message>
+ <message>
+ <source>Build at once</source>
+ <translation>Charger en une fois</translation>
+ </message>
+ <message>
+ <source>Build fields</source>
+ <translation>Construire les champs</translation>
+ </message>
+ <message>
+ <source>Build min/max</source>
+ <translation>Construire les min/max</translation>
+ </message>
+ <message>
+ <source>Build groups</source>
+ <translation>Construire les groupes</translation>
+ </message>
+ <message>
+ <source>Close dialog at finish</source>
+ <translation>Fermer la fenêtre à la fin</translation>
+ </message>
+ <message>
+ <source>VISU_PRECISION_HINT</source>
+ <translation>
+Il est possible de modifier la valeur de la précision avec
+le '%1' paramètre des préférences du module Post-Pro.</translation>
+ </message>
+ <message>
+ <source>VISU_REALLY_DELETE</source>
+ <translation>Voulez-vous supprimer cet(s) %1 objet(s): %2</translation>
+ </message>
+ <message>
+ <source>WRN_NO_APPROPRIATE_SELECTION</source>
+ <translation>Pas d'objets appropriés sélectionnés</translation>
+ </message>
+ <message>
+ <source>VISU_PLUGINS_OTHER</source>
+ <translation>Extensions pour la VISU</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI</name>
+ <message>
+ <source>PRECISION</source>
+ <translation>Précision</translation>
+ </message>
+ <message>
+ <source>DLG_LINEWIDTH_CMT1</source>
+ <translation>Définir la valeur entre</translation>
+ </message>
+ <message>
+ <source>DLG_LINEWIDTH_CMT2</source>
+ <translation>1 (mince) et 10 (épais)</translation>
+ </message>
+ <message>
+ <source>DLG_LINEWIDTH_TITLE</source>
+ <translation>Largeur de la ligne</translation>
+ </message>
+ <message>
+ <source>DLG_OPACITY_CMT1</source>
+ <translation>Définir la valeur entre</translation>
+ </message>
+ <message>
+ <source>DLG_OPACITY_CMT2</source>
+ <translation>0 (transparent) et 100 (opaque)</translation>
+ </message>
+ <message>
+ <source>DLG_OPACITY_TITLE</source>
+ <translation>Opacité</translation>
+ </message>
+ <message>
+ <source>ERR_ACTIVATE_VIEW3D</source>
+ <translation>Activez la scène 3D avant</translation>
+ </message>
+ <message>
+ <source>ERR_ERROR_DURING_EXPORT</source>
+ <translation>L'erreur est apparue au cours de l'exportation du fichier</translation>
+ </message>
+ <message>
+ <source>ERR_SCALARBAR_PARAMS</source>
+ <translation>Avertissement! Les paramètres ne sont pas corrects</translation>
+ </message>
+ <message>
+ <source>FLT_ALL_FILES</source>
+ <translation>Tous les fichiers (*.*)</translation>
+ </message>
+ <message>
+ <source>FLT_MED_FILES</source>
+ <translation>Fichiers MED (*.med)</translation>
+ </message>
+ <message>
+ <source>FLT_SAUV_FILES</source>
+ <translation>Fichiers SAUV (*.sauv*)</translation>
+ </message>
+ <message>
+ <source>FLT_TABLE_FILES</source>
+ <translation>Tables (*.txt *.tab *.csv)</translation>
+ </message>
+ <message>
+ <source>IMPORT_FROM_FILE</source>
+ <translation>Importer à partir du fichier</translation>
+ </message>
+ <message>
+ <source>MEN_ACTOR_SELECTION</source>
+ <translation>Sélection de l'acteur</translation>
+ </message>
+ <message>
+ <source>MEN_ARRANGE_ACTORS</source>
+ <translation>Arranger les acteurs</translation>
+ </message>
+ <message>
+ <source>MEN_MANAGE_CACHE</source>
+ <translation>Gérer</translation>
+ </message>
+ <message>
+ <source>MEN_CELL_COLOR</source>
+ <translation>Couleur de la cellule</translation>
+ </message>
+ <message>
+ <source>MEN_CELL_SELECTION</source>
+ <translation>Sélection de la cellule</translation>
+ </message>
+ <message>
+ <source>MEN_CLEAR_CONTAINER</source>
+ <translation>Effacer</translation>
+ </message>
+ <message>
+ <source>MEN_CLIPPING</source>
+ <translation>Plans de coupe</translation>
+ </message>
+ <message>
+ <source>MEN_COLOR</source>
+ <translation>Couleur...</translation>
+ </message>
+ <message>
+ <source>MEN_COPY_PRS</source>
+ <translation>Copier</translation>
+ </message>
+ <message>
+ <source>MEN_CREATE_CURVES</source>
+ <translation>Créer les courbes</translation>
+ </message>
+ <message>
+ <source>MEN_CREATE_MANY_PRS</source>
+ <translation>Créer des présentations</translation>
+ </message>
+ <message>
+ <source>MEN_CREATE_PLOT2D</source>
+ <translation>Créer une scène Plot2d</translation>
+ </message>
+ <message>
+ <source>MEN_CREATE_PRS</source>
+ <translation>Créer une présentation</translation>
+ </message>
+ <message>
+ <source>MEN_CREATE_TABLE</source>
+ <translation>Créer une table</translation>
+ </message>
+ <message>
+ <source>MEN_CUBE_AXES</source>
+ <translation>Axes gradués</translation>
+ </message>
+ <message>
+ <source>MEN_CURVE_PROPS</source>
+ <translation>Paramètres...</translation>
+ </message>
+ <message>
+ <source>MEN_CURVE_SCALE</source>
+ <translation>Facteur d'échelle...</translation>
+ </message>
+ <message>
+ <source>MEN_CUT_LINES</source>
+ <translation>Lignes de coupe</translation>
+ </message>
+ <message>
+ <source>MEN_CUT_SEGMENT</source>
+ <translation>Segments de coupe</translation>
+ </message>
+ <message>
+ <source>MEN_CUT_PLANES</source>
+ <translation>Plans de coupe</translation>
+ </message>
+ <message>
+ <source>MEN_DEFORMED_SHAPE</source>
+ <translation>Déformation</translation>
+ </message>
+ <message>
+ <source>MEN_DELETE_OBJS</source>
+ <translation>Supprimer</translation>
+ </message>
+ <message>
+ <source>MEN_DELETE_VIEWPARAMS</source>
+ <translation>Supprimer les paramètres de visualisation</translation>
+ </message>
+ <message>
+ <source>MEN_SHOW</source>
+ <translation>Visualiser</translation>
+ </message>
+ <message>
+ <source>MEN_SHOW_SCALAR_BAR</source>
+ <translation>Visualiser la barre scalaire</translation>
+ </message>
+ <message>
+ <source>MEN_DISPLAY_ONLY</source>
+ <translation>Afficher uniquement</translation>
+ </message>
+ <message>
+ <source>MEN_DISPLAY_SELECTION</source>
+ <translation>Afficher la sélection</translation>
+ </message>
+ <message>
+ <source>MEN_EDGE_COLOR</source>
+ <translation>Couleur d'arête</translation>
+ </message>
+ <message>
+ <source>MEN_EDIT_CONTAINER</source>
+ <translation>Editer...</translation>
+ </message>
+ <message>
+ <source>MEN_EDIT_PRS</source>
+ <translation>Editer...</translation>
+ </message>
+ <message>
+ <source>MEN_HIDE</source>
+ <translation>Cacher</translation>
+ </message>
+ <message>
+ <source>MEN_HIDE_SCALAR_BAR</source>
+ <translation>Cacher la barre scalaire</translation>
+ </message>
+ <message>
+ <source>MEN_ERASE_ALL</source>
+ <translation>Cacher tous</translation>
+ </message>
+ <message>
+ <source>MEN_EXPORT_TABLE</source>
+ <translation>Exporter la table</translation>
+ </message>
+ <message>
+ <source>VISU_MEN_EXPORT_MED</source>
+ <translation>Exporter au format MED</translation>
+ </message>
+ <message>
+ <source>MEN_FEATURE_EDGES</source>
+ <translation>Montrer les arêtes</translation>
+ </message>
+ <message>
+ <source>MEN_FEATURE_EDGES_DISABLE</source>
+ <translation>Désactiver les caractéristiques des arêtes</translation>
+ </message>
+ <message>
+ <source>MEN_FREE_SCALAR_BARS</source>
+ <translation>Utiliser l'intervalle de valeurs du champ</translation>
+ </message>
+ <message>
+ <source>MEN_GAUSS_POINT_SELECTION</source>
+ <translation>Sélection du point de Gauss</translation>
+ </message>
+ <message>
+ <source>MEN_GLOBAL_SELECTION</source>
+ <translation>Sélection globale</translation>
+ </message>
+ <message>
+ <source>MEN_HOLO_RENDER</source>
+ <translation>Holographie</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT</source>
+ <translation>Importer</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT_FROM_FILE</source>
+ <translation>Fichier MED</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT_MED_FIELD</source>
+ <translation>Importer un champ</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT_MED_STRUCTURE</source>
+ <translation>Importer une structure</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT_MED_TIMESTAMP</source>
+ <translation>Importer un pas de temps</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT_SAUV</source>
+ <translation>Fichier SAUV</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT_TABLE</source>
+ <translation>Table du fichier</translation>
+ </message>
+ <message>
+ <source>MEN_INSIDEFRAME</source>
+ <translation>Cadre interne</translation>
+ </message>
+ <message>
+ <source>MEN_ISO_SURFACES</source>
+ <translation>Surfaces iso</translation>
+ </message>
+ <message>
+ <source>MEN_LINE_WIDTH</source>
+ <translation>Largeur de la ligne</translation>
+ </message>
+ <message>
+ <source>MEN_SHRINK_FACTOR</source>
+ <translation>Facteur de contraction</translation>
+ </message>
+ <message>
+ <source>MEN_MERGE_SCALAR_BARS</source>
+ <translation>Fusionner l'intervalle de valeurs scalaire</translation>
+ </message>
+ <message>
+ <source>MEN_MULTIPR_VIEW_FULL_RES</source>
+ <translation>Visualiser avec une haute résolution</translation>
+ </message>
+ <message>
+ <source>MEN_MULTIPR_VIEW_HIDE</source>
+ <translation>Cacher</translation>
+ </message>
+ <message>
+ <source>MEN_MULTIPR_VIEW_LOW_RES</source>
+ <translation>Visualiser à faible résolution</translation>
+ </message>
+ <message>
+ <source>MEN_MULTIPR_VIEW_MEDIUM_RES</source>
+ <translation>Visualiser à moyenne résolution</translation>
+ </message>
+ <message>
+ <source>MEN_NOSHADING</source>
+ <translation>Sans ombrage</translation>
+ </message>
+ <message>
+ <source>MEN_TRANSPARENCY</source>
+ <translation>Transparence</translation>
+ </message>
+ <message>
+ <source>MEN_PARALLEL_ANIMATION</source>
+ <translation>Animation parallèle...</translation>
+ </message>
+ <message>
+ <source>MEN_PARTIAL_SELECTION</source>
+ <translation>Sélection partiale</translation>
+ </message>
+ <message>
+ <source>MEN_PLOT3D_FROM_CUTPLANE</source>
+ <translation>Graphe 3D</translation>
+ </message>
+ <message>
+ <source>MEN_PLOT_3D</source>
+ <translation>Graphe 3D</translation>
+ </message>
+ <message>
+ <source>MEN_POINT_EVOLUTION</source>
+ <translation>Evolution du point</translation>
+ </message>
+ <message>
+ <source>MEN_POINT_SELECTION</source>
+ <translation>Sélection d'un point</translation>
+ </message>
+ <message>
+ <source>MEN_POINT_MARKER</source>
+ <translation>Repère de point</translation>
+ </message>
+ <message>
+ <source>MEN_POINTS</source>
+ <translation>Points</translation>
+ </message>
+ <message>
+ <source>MEN_PROPERTIES</source>
+ <translation>Paramètres</translation>
+ </message>
+ <message>
+ <source>MEN_RENAME</source>
+ <translation>Renommer...</translation>
+ </message>
+ <message>
+ <source>MEN_RENAME_CONTAINER</source>
+ <translation>Renommer...</translation>
+ </message>
+ <message>
+ <source>MEN_RENAME_TABLE</source>
+ <translation>Renommer...</translation>
+ </message>
+ <message>
+ <source>MEN_REPRESENTATION</source>
+ <translation>Représentation</translation>
+ </message>
+ <message>
+ <source>MEN_RESTORE_VIEWPARAMS</source>
+ <translation>Restaurer les paramètres de visualisation</translation>
+ </message>
+ <message>
+ <source>MEN_SAVE_VIEWPARAMS</source>
+ <translation>Sauvegarder les paramètres de visualisation</translation>
+ </message>
+ <message>
+ <source>MEN_SCALAR_MAP</source>
+ <translation>Carte scalaire</translation>
+ </message>
+ <message>
+ <source>MEN_DEFORMED_SHAPE_AND_SCALAR_MAP</source>
+ <translation>Déformation et carte scalaire</translation>
+ </message>
+ <message>
+ <source>MEN_SCALING</source>
+ <translation>Echelle</translation>
+ </message>
+ <message>
+ <source>MEN_SELECTION</source>
+ <translation>Sélection</translation>
+ </message>
+ <message>
+ <source>MEN_SELECTION_PANEL</source>
+ <translation>Panneau de sélection</translation>
+ </message>
+ <message>
+ <source>MEN_SHADING</source>
+ <translation>Ombrage activé</translation>
+ </message>
+ <message>
+ <source>MEN_SHOW_ANIMATION</source>
+ <translation>Visualiser...</translation>
+ </message>
+ <message>
+ <source>MEN_SHOW_EVOLUTION</source>
+ <translation>Visualiser...</translation>
+ </message>
+ <message>
+ <source>MEN_SHOW_TABLE</source>
+ <translation>Visualiser la table</translation>
+ </message>
+ <message>
+ <source>MEN_SHRINK</source>
+ <translation>Contraction</translation>
+ </message>
+ <message>
+ <source>MEN_STREAM_LINES</source>
+ <translation>Lignes de courant</translation>
+ </message>
+ <message>
+ <source>MEN_SUCCCESSIVE_ANIMATION</source>
+ <translation>Animation successive...</translation>
+ </message>
+ <message>
+ <source>MEN_SURFACE</source>
+ <translation>Surface</translation>
+ </message>
+ <message>
+ <source>MEN_SURFACEFRAME</source>
+ <translation>Surface</translation>
+ </message>
+ <message>
+ <source>MEN_SWEEP</source>
+ <translation>Balayer</translation>
+ </message>
+ <message>
+ <source>MEN_TRANSLATE_PRS</source>
+ <translation>Translation de la présentation</translation>
+ </message>
+ <message>
+ <source>MEN_UNSHRINK</source>
+ <translation>Décontraction</translation>
+ </message>
+ <message>
+ <source>MEN_VECTORS</source>
+ <translation>Vecteurs</translation>
+ </message>
+ <message>
+ <source>MEN_VISUALIZATION</source>
+ <translation>Visualisation</translation>
+ </message>
+ <message>
+ <source>MEN_WIREFRAME</source>
+ <translation>Contours</translation>
+ </message>
+ <message>
+ <source>MEN_FILTER_SCALARS</source>
+ <translation>Filtrer par scalaires...</translation>
+ </message>
+ <message>
+ <source>MEN_VALUES_LABELING</source>
+ <translation>Libellés des valeurs</translation>
+ </message>
+ <message>
+ <source>VISU_VALUES_LABELING_PARAMS</source>
+ <translation>Paramètres des libellés</translation>
+ </message>
+ <message>
+ <source>MEN_2D_QUADRATIC_MODE</source>
+ <translation>2D quadratique</translation>
+ </message>
+ <message>
+ <source>MEN_VISU_ARCQUAD_MODE</source>
+ <translation>Arcs</translation>
+ </message>
+ <message>
+ <source>MEN_VISU_LINEQUAD_MODE</source>
+ <translation>Lignes</translation>
+ </message>
+ <message>
+ <source>MEN_VISU_SHOW_DEVIATION</source>
+ <translation>Afficher la déviation</translation>
+ </message>
+ <message>
+ <source>TOOL_IMPORT</source>
+ <translation>Importer</translation>
+ </message>
+ <message>
+ <source>TOOL_REPRESENTATION</source>
+ <translation>Représentation</translation>
+ </message>
+ <message>
+ <source>TOOL_SELECTION</source>
+ <translation>Sélection</translation>
+ </message>
+ <message>
+ <source>TOOL_NAVIGATION</source>
+ <translation>Navigation</translation>
+ </message>
+ <message>
+ <source>TOOL_VISUALISATION</source>
+ <translation>Visualisation</translation>
+ </message>
+ <message>
+ <source>USE_BUILD_PROGRESS</source>
+ <translation>Choisir les paramètres d'import au chargement</translation>
+ </message>
+ <message>
+ <source>FIRST_STR_AS_TITLE</source>
+ <translation>Utiliser la ligne première en tant que le titre</translation>
+ </message>
+ <message>
+ <source>MEN_LOAD_COMPONENT_DATA</source>
+ <translation>Charger les données des composants</translation>
+ </message>
+ <message>
+ <source>FLT_DISTRIBUTED_MED_FILES</source>
+ <translation>Fichiers MED distribués (*_maitre.med)</translation>
+ </message>
+ <message>
+ <source>SHOW_LEVEL_LABELS</source>
+ <translation>Montrer les libellés de niveau</translation>
+ </message>
+ <message>
+ <source>MEN_FILE_INFO</source>
+ <translation>Information du fichier MED</translation>
+ </message>
+ <message>
+ <source>ERR_ERROR_IN_THE_FILE</source>
+ <translation>Erreur au fichier</translation>
+ </message>
+ <message>
+ <source>ERR_FILE_NOT_EXISTS</source>
+ <translation>Le fichier n'existe pas</translation>
+ </message>
+ <message>
+ <source>IMPORT_ERRORS</source>
+ <translation>L'importation s'est finie avec quelques erreurs</translation>
+ </message>
+ <message>
+ <source>TLT_IMPORT_TABLE</source>
+ <translation>Importer une table</translation>
+ </message>
+ <message>
+ <source>UNKNOWN_IMPORT_ERROR</source>
+ <translation>Erreur inconnue</translation>
+ </message>
+ <message>
+ <source>UNSUPPORTED_FILE_FORMAT</source>
+ <translation>Format de fichier non supporté</translation>
+ </message>
+ <message>
+ <source>VALUES_LABELING</source>
+ <translation>Libellés des valeurs</translation>
+ </message>
+ <message>
+ <source>LABELS</source>
+ <translation>Libellés</translation>
+ </message>
+ <message>
+ <source>COLOR</source>
+ <translation>Couleur</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_AxisWg</name>
+ <message>
+ <source>AXIS_NAME</source>
+ <translation>Nom de l'axe</translation>
+ </message>
+ <message>
+ <source>FONT</source>
+ <translation>Police</translation>
+ </message>
+ <message>
+ <source>IS_VISIBLE</source>
+ <translation>Est visible</translation>
+ </message>
+ <message>
+ <source>LABELS</source>
+ <translation>Libellés</translation>
+ </message>
+ <message>
+ <source>LENGTH</source>
+ <translation>Longueur</translation>
+ </message>
+ <message>
+ <source>NAME</source>
+ <translation>Nom</translation>
+ </message>
+ <message>
+ <source>NUMBER</source>
+ <translation>Nombre</translation>
+ </message>
+ <message>
+ <source>OFFSET</source>
+ <translation>Décalage</translation>
+ </message>
+ <message>
+ <source>TICK_MARKS</source>
+ <translation>Marques de graduation</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_BuildProgressDlg</name>
+ <message>
+ <source>BUILD_ALL</source>
+ <translation>Construire tout</translation>
+ </message>
+ <message>
+ <source>BUILD_AT_ONCE</source>
+ <translation>Construire simultanément</translation>
+ </message>
+ <message>
+ <source>BUILD_ENTITIES</source>
+ <translation>Construire les entités</translation>
+ </message>
+ <message>
+ <source>BUILD_FIELDS</source>
+ <translation>Construire les champs</translation>
+ </message>
+ <message>
+ <source>BUILD_GROUPS</source>
+ <translation>Construire les groupes</translation>
+ </message>
+ <message>
+ <source>BUILD_MINMAX</source>
+ <translation>Construire min/max</translation>
+ </message>
+ <message>
+ <source>CLOSE</source>
+ <translation>Fermer</translation>
+ </message>
+ <message>
+ <source>CLOSE_AT_FINISH</source>
+ <translation>Fermer la fenêtre à la fin</translation>
+ </message>
+ <message>
+ <source>DLG_BUILD_PROGRESS_TITLE</source>
+ <translation>Paramètres d'import</translation>
+ </message>
+ <message>
+ <source>ERR_ERROR_IN_THE_FILE</source>
+ <translation>Erreur dans le fichier</translation>
+ </message>
+ <message>
+ <source>FILE_NAME</source>
+ <translation>Importer un fichier: </translation>
+ </message>
+ <message>
+ <source>FLT_ALL_FILES</source>
+ <translation>Tous les fichiers (*.*)</translation>
+ </message>
+ <message>
+ <source>FLT_MED_FILES</source>
+ <translation>Fichiers MED (*.med)</translation>
+ </message>
+ <message>
+ <source>FLT_SAUV_FILES</source>
+ <translation>Fichiers SAUV (*.sauv*)</translation>
+ </message>
+ <message>
+ <source>HELP</source>
+ <translation>Aide</translation>
+ </message>
+ <message>
+ <source>IMPORT_FROM_FILE</source>
+ <translation>Importer à partir d'un fichier</translation>
+ </message>
+ <message>
+ <source>IMPORT_PROGRESS</source>
+ <translation>Progression de l'importation </translation>
+ </message>
+ <message>
+ <source>IMPORT_SETTINGS</source>
+ <translation>Paramètres</translation>
+ </message>
+ <message>
+ <source>IMPORT_TIME</source>
+ <translation>Temps</translation>
+ </message>
+ <message>
+ <source>START</source>
+ <translation>Début</translation>
+ </message>
+ <message>
+ <source>TIME</source>
+ <translation>Temps écoulé : </translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ClippingDlg</name>
+ <message>
+ <source>AUTO_APPLY_CHK</source>
+ <translation>Applique automatiquement</translation>
+ </message>
+ <message>
+ <source>BUT_DELETE</source>
+ <translation>Supprimer</translation>
+ </message>
+ <message>
+ <source>BUT_NEW</source>
+ <translation>Nouveau</translation>
+ </message>
+ <message>
+ <source>GRP_IJK_AXIS</source>
+ <translation>Axe</translation>
+ </message>
+ <message>
+ <source>GRP_PARAMETERS</source>
+ <translation>Paramètres</translation>
+ </message>
+ <message>
+ <source>GRP_PLANES</source>
+ <translation>Plans de coupe</translation>
+ </message>
+ <message>
+ <source>I_RADIO_BTN</source>
+ <translation>I</translation>
+ </message>
+ <message>
+ <source>J_RADIO_BTN</source>
+ <translation>J</translation>
+ </message>
+ <message>
+ <source>K_RADIO_BTN</source>
+ <translation>K</translation>
+ </message>
+ <message>
+ <source>LBL_DISTANCE</source>
+ <translation>Distance</translation>
+ </message>
+ <message>
+ <source>LBL_IJK_INDEX</source>
+ <translation>Index (de 0 Ã ...)</translation>
+ </message>
+ <message>
+ <source>LBL_IJK_INDEX_TO_arg</source>
+ <translation>Index (de 0 Ã %1) </translation>
+ </message>
+ <message>
+ <source>LBL_ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION_XY</source>
+ <translation>Rotation autour de Z (X Ã Y):</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION_XZ</source>
+ <translation>Rotation autour de Y (X Ã Z):</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION_YX</source>
+ <translation>Rotation autour de Z (Y Ã X):</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION_YZ</source>
+ <translation>Rotation autour de X (Y Ã Z):</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION_ZX</source>
+ <translation>Rotation autour de Y (Z Ã X):</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION_ZY</source>
+ <translation>Rotation autour de X (Z Ã Y):</translation>
+ </message>
+ <message>
+ <source>PARALLEL_XOY_COMBO_ITEM</source>
+ <translation>|| X-Y</translation>
+ </message>
+ <message>
+ <source>PARALLEL_YOZ_COMBO_ITEM</source>
+ <translation>|| Y-Z</translation>
+ </message>
+ <message>
+ <source>PARALLEL_ZOX_COMBO_ITEM</source>
+ <translation>|| Z-X</translation>
+ </message>
+ <message>
+ <source>PLANES_COMBO_ITEM_i</source>
+ <translation>Plan# %1</translation>
+ </message>
+ <message>
+ <source>PLANES_COMBO_ITEM_no</source>
+ <translation>Pas de plans</translation>
+ </message>
+ <message>
+ <source>REVERSE_NORMAL_CHK</source>
+ <translation>Inverser le vecteur normal</translation>
+ </message>
+ <message>
+ <source>SHOW_PREVIEW_CHK</source>
+ <translation>Prévisualiser</translation>
+ </message>
+ <message>
+ <source>TAB_IJK_STRUCTURED</source>
+ <translation>IJK (Structuré)</translation>
+ </message>
+ <message>
+ <source>TAB_NON_STRUCTURED</source>
+ <translation>Non structuré</translation>
+ </message>
+ <message>
+ <source>TITLE</source>
+ <translation>Changer le plan de coupe</translation>
+ </message>
+ <message>
+ <source>WRN_EMPTY_RESULTING_PRS</source>
+ <translation>Impossible d'utiliser les plans de coupe indiqués à cause des limitations VTK.
+Indiquez une présentation non vide.</translation>
+ </message>
+ <message>
+ <source>GRP_TYPE</source>
+ <translation>Type de plan</translation>
+ </message>
+ <message>
+ <source>GLOBAL_BTN</source>
+ <translation>Plans globaux</translation>
+ </message>
+ <message>
+ <source>LOCAL_BTN</source>
+ <translation>Plans locaux</translation>
+ </message>
+ <message>
+ <source>GRP_VIEWER_PLANES</source>
+ <translation>Plans définis dans la scène</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_CubeAxesDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Axes gradués</translation>
+ </message>
+ <message>
+ <source>IS_VISIBLE</source>
+ <translation>Est visible</translation>
+ </message>
+ <message>
+ <source>X_AXIS</source>
+ <translation>Axe X</translation>
+ </message>
+ <message>
+ <source>Y_AXIS</source>
+ <translation>Axe Y</translation>
+ </message>
+ <message>
+ <source>Z_AXIS</source>
+ <translation>Axe Z</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_CursorDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation>&Annuler</translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation>&OK</translation>
+ </message>
+ <message>
+ <source>TextLabel1</source>
+ <translation>Définir la valeur entre</translation>
+ </message>
+ <message>
+ <source>TextLabel2</source>
+ <translation>minimale et maximale</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_CutLinesDlg</name>
+ <message>
+ <source>Cut Lines Definition</source>
+ <translation>Définition des lignes de coupe</translation>
+ </message>
+ <message>
+ <source>Position</source>
+ <translation>Position</translation>
+ </message>
+ <message>
+ <source>Set default</source>
+ <translation>Définir par défaut</translation>
+ </message>
+ <message>
+ <source>Scalar Bar</source>
+ <translation>Barre scalaire</translation>
+ </message>
+ <message>
+ <source>Input</source>
+ <translation>Données d'entrée</translation>
+ </message>
+ <message>
+ <source>PLANE_NUMBER</source>
+ <translation>Plan n°%1</translation>
+ </message>
+ <message>
+ <source>BASE_PLANE_POS</source>
+ <translation>Position du plan de base</translation>
+ </message>
+ <message>
+ <source>LBL_ABSOLUTE_LENGTH</source>
+ <translation>Utiliser la longueur absolue</translation>
+ </message>
+ <message>
+ <source>LBL_GENERATE_CURVES</source>
+ <translation>Générer les courbes</translation>
+ </message>
+ <message>
+ <source>LBL_GENERATE_TABLE</source>
+ <translation>Générer une table de données</translation>
+ </message>
+ <message>
+ <source>LBL_INVERT_CURVES</source>
+ <translation>Inverser toutes les courbes</translation>
+ </message>
+ <message>
+ <source>LBL_LINES_CUT</source>
+ <translation>Découper les plans</translation>
+ </message>
+ <message>
+ <source>LBL_LINES_PLANE</source>
+ <translation>Plan de lignes</translation>
+ </message>
+ <message>
+ <source>LBL_NB_PLANS</source>
+ <translation>Nombre de plans:</translation>
+ </message>
+ <message>
+ <source>LBL_POS</source>
+ <translation>Déplacement (0...1):</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION</source>
+ <translation>Rotations</translation>
+ </message>
+ <message>
+ <source>LBL_ROT_X</source>
+ <translation>Rotation autour de X (Y Ã Z):</translation>
+ </message>
+ <message>
+ <source>LBL_ROT_Y</source>
+ <translation>Rotation autour de Y (Z Ã X):</translation>
+ </message>
+ <message>
+ <source>LBL_ROT_Z</source>
+ <translation>Rotation autour de Z (X Ã Y):</translation>
+ </message>
+ <message>
+ <source>LBL_SHOW_PREVIEW</source>
+ <translation>Prévisualiser</translation>
+ </message>
+ <message>
+ <source>PARALLEL_XOY</source>
+ <translation>|| X-Y</translation>
+ </message>
+ <message>
+ <source>PARALLEL_YOZ</source>
+ <translation>|| Y-Z</translation>
+ </message>
+ <message>
+ <source>PARALLEL_ZOX</source>
+ <translation>|| Z-X</translation>
+ </message>
+ <message>
+ <source>SET_DEFAULT</source>
+ <translation>Définir par défaut</translation>
+ </message>
+ <message>
+ <source>TXT_ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_CutSegmentDlg</name>
+ <message>
+ <source>Cut Segment Definition</source>
+ <translation>Définition des segments de coupe</translation>
+ </message>
+ <message>
+ <source>Scalar Bar</source>
+ <translation>Barre scalaire</translation>
+ </message>
+ <message>
+ <source>Input</source>
+ <translation>Données d'entrée</translation>
+ </message>
+ <message>
+ <source>LBL_ABSOLUTE_LENGTH</source>
+ <translation>Utiliser la longueur absolue</translation>
+ </message>
+ <message>
+ <source>LBL_CUT_SEGMENT</source>
+ <translation>Segments de coupe</translation>
+ </message>
+ <message>
+ <source>LBL_GENERATE_CURVES</source>
+ <translation>Générer une courbe</translation>
+ </message>
+ <message>
+ <source>LBL_GENERATE_TABLE</source>
+ <translation>Générer une table de données</translation>
+ </message>
+ <message>
+ <source>LBL_INVERT_CURVES</source>
+ <translation>Inverser les courbes</translation>
+ </message>
+ <message>
+ <source>LBL_POINT_1</source>
+ <translation>Point 1:</translation>
+ </message>
+ <message>
+ <source>LBL_POINT_2</source>
+ <translation>Point 2:</translation>
+ </message>
+ <message>
+ <source>LBL_SEGMENT</source>
+ <translation>Segments</translation>
+ </message>
+ <message>
+ <source>LBL_SHOW_PREVIEW</source>
+ <translation>Prévisualiser</translation>
+ </message>
+ <message>
+ <source>LBL_X</source>
+ <translation>X</translation>
+ </message>
+ <message>
+ <source>LBL_Y</source>
+ <translation>Y</translation>
+ </message>
+ <message>
+ <source>LBL_Z</source>
+ <translation>Z</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_CutPlanesDlg</name>
+ <message>
+ <source>Cut Planes Definition</source>
+ <translation>Définition des plans de coupe</translation>
+ </message>
+ <message>
+ <source>Cut Planes</source>
+ <translation>Plans de coupe</translation>
+ </message>
+ <message>
+ <source>Scalar Bar</source>
+ <translation>Barre scalaire</translation>
+ </message>
+ <message>
+ <source>Input</source>
+ <translation>Données d'entrée</translation>
+ </message>
+ <message>
+ <source>&Cancel</source>
+ <translation>&Annuler</translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation>&OK</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_CutPlanesPane</name>
+ <message>
+ <source>Position</source>
+ <translation>Position</translation>
+ </message>
+ <message>
+ <source>Set default</source>
+ <translation>Définir par défaut</translation>
+ </message>
+ <message>
+ <source>LBL_NB_PLANS</source>
+ <translation>Nombre de plans:</translation>
+ </message>
+ <message>
+ <source>LBL_POS</source>
+ <translation>Déplacement (0...1):</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION</source>
+ <translation>Rotations</translation>
+ </message>
+ <message>
+ <source>LBL_ROT_X</source>
+ <translation>Rotation autour de X (Y Ã Z):</translation>
+ </message>
+ <message>
+ <source>LBL_ROT_Y</source>
+ <translation>Rotation autour de Y (Z Ã X):</translation>
+ </message>
+ <message>
+ <source>LBL_ROT_Z</source>
+ <translation>Rotation autour de Z (X Ã Y):</translation>
+ </message>
+ <message>
+ <source>LBL_SHOW_PREVIEW</source>
+ <translation>Prévisualiser</translation>
+ </message>
+ <message>
+ <source>PARALLEL_XOY</source>
+ <translation>// X-Y</translation>
+ </message>
+ <message>
+ <source>PARALLEL_YOZ</source>
+ <translation>// Y-Z</translation>
+ </message>
+ <message>
+ <source>PARALLEL_ZOX</source>
+ <translation>// Z-X</translation>
+ </message>
+ <message>
+ <source>TXT_ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>LBL_DEFORMATION</source>
+ <translation>Déformation</translation>
+ </message>
+ <message>
+ <source>LBL_DEFROMATION_SCALE</source>
+ <translation>Facteur d'échelle :</translation>
+ </message>
+ <message>
+ <source>LBL_DEFROMATION_VECT</source>
+ <translation>Vecteurs :</translation>
+ </message>
+ <message>
+ <source>PLANE_NUMBER</source>
+ <translation>Plan n°%1</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_DeformedShapeDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation>&Annuler</translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation>&OK</translation>
+ </message>
+ <message>
+ <source>DEFORMED_SHAPE_TAB</source>
+ <translation>Déformation</translation>
+ </message>
+ <message>
+ <source>DLG_TITLE</source>
+ <translation>Déformation</translation>
+ </message>
+ <message>
+ <source>INPUT_TAB</source>
+ <translation>Entrée</translation>
+ </message>
+ <message>
+ <source>MAGNITUDE_COLORING</source>
+ <translation>Coloration selon la magnitude</translation>
+ </message>
+ <message>
+ <source>SCALAR_BAR_TAB</source>
+ <translation>Barre scalaire</translation>
+ </message>
+ <message>
+ <source>SCALE_FACTOR</source>
+ <translation>Facteur d'échelle:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_EditContainerDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation>&Annuler</translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation>&OK</translation>
+ </message>
+ <message>
+ <source>LBL_CONTAINER</source>
+ <translation>Conteneur</translation>
+ </message>
+ <message>
+ <source>LBL_STUDY</source>
+ <translation>Etude</translation>
+ </message>
+ <message>
+ <source>TXT_CURVE</source>
+ <translation>Courbe</translation>
+ </message>
+ <message>
+ <source>TXT_TABLE</source>
+ <translation>Table</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_EvolutionDlg</name>
+ <message>
+ <source>COMPONENT</source>
+ <translation>Composant</translation>
+ </message>
+ <message>
+ <source>ERR_EXTRACTION_OF_DATA_FAILED</source>
+ <translation>Impossible d'extraire les données !</translation>
+ </message>
+ <message>
+ <source>ERR_INVALID_SELECTION</source>
+ <translation>La sélection n'est pas valide !</translation>
+ </message>
+ <message>
+ <source>FIELD</source>
+ <translation>Champ</translation>
+ </message>
+ <message>
+ <source>POINT</source>
+ <translation>Point</translation>
+ </message>
+ <message>
+ <source>PARAMETERS</source>
+ <translation>Paramètres</translation>
+ </message>
+ <message>
+ <source>TITLE</source>
+ <translation>Evolution sur un point</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_FeatureEdgesPanel</name>
+ <message>
+ <source>WINDOW_TITLE</source>
+ <translation>Caractéristiques des arêtes</translation>
+ </message>
+ <message>
+ <source>FEATURE_EDGES_ANGLE</source>
+ <translation>Angle des arêtes</translation>
+ </message>
+ <message>
+ <source>FEATURE_EDGES_COLORING</source>
+ <translation>Couleur</translation>
+ </message>
+ <message>
+ <source>FEATURE_EDGES_PROPERTIES</source>
+ <translation>Propriétés des arêtes</translation>
+ </message>
+ <message>
+ <source>SHOW_BOUNDARY_EDGES</source>
+ <translation>Montrer les arêtes frontières</translation>
+ </message>
+ <message>
+ <source>SHOW_FEATURE_EDGES</source>
+ <translation>Montrer les arêtes</translation>
+ </message>
+ <message>
+ <source>SHOW_MANIFOLD_EDGES</source>
+ <translation>Montrer les arêtes complexes</translation>
+ </message>
+ <message>
+ <source>SHOW_NON_MANIFOLD_EDGES</source>
+ <translation>Montrer les arêtes simples</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_FileDlg</name>
+ <message>
+ <source>FULL_LOAD</source>
+ <translation>Chargement complet du fichier courant</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_FindPane</name>
+ <message>
+ <source>BETWEEN</source>
+ <translation>Entre</translation>
+ </message>
+ <message>
+ <source>CONDITION</source>
+ <translation>Avec une valeur scalaire de:</translation>
+ </message>
+ <message>
+ <source>FIND_TITLE</source>
+ <translation>Trouver</translation>
+ </message>
+ <message>
+ <source>INCORRECT_VALUES</source>
+ <translation>Les valeurs d'entrée ne sont pas correctes</translation>
+ </message>
+ <message>
+ <source>MAXIMUM</source>
+ <translation>Maximum</translation>
+ </message>
+ <message>
+ <source>MINIMUM</source>
+ <translation>Minimum</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_FontWg</name>
+ <message>
+ <source>ARIAL</source>
+ <translation>Arial</translation>
+ </message>
+ <message>
+ <source>BOLD</source>
+ <translation>Gras</translation>
+ </message>
+ <message>
+ <source>COURIER</source>
+ <translation>Courrier</translation>
+ </message>
+ <message>
+ <source>ITALIC</source>
+ <translation>Italique</translation>
+ </message>
+ <message>
+ <source>SHADOW</source>
+ <translation>Ombrage</translation>
+ </message>
+ <message>
+ <source>TIMES</source>
+ <translation>Times</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_GaussPointsDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation>&Annuler</translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation>&OK</translation>
+ </message>
+ <message>
+ <source>DEFORMED_SHAPE</source>
+ <translation>Déformations</translation>
+ </message>
+ <message>
+ <source>DEFORMED_SHAPE_TITLE</source>
+ <translation>Déformations</translation>
+ </message>
+ <message>
+ <source>DLG_PREF_TITLE</source>
+ <translation>Préférences des points de Gauss</translation>
+ </message>
+ <message>
+ <source>DLG_PROP_TITLE</source>
+ <translation>Propriétés des points de Gauss</translation>
+ </message>
+ <message>
+ <source>DLG_TITLE</source>
+ <translation>Points de Gauss </translation>
+ </message>
+ <message>
+ <source>GAUSS_POINTS_TAB</source>
+ <translation>Points de Gauss </translation>
+ </message>
+ <message>
+ <source>GEOMETRY</source>
+ <translation>Géométrie</translation>
+ </message>
+ <message>
+ <source>INPUT_TAB</source>
+ <translation>Entrée</translation>
+ </message>
+ <message>
+ <source>PRS_TITLE</source>
+ <translation>Présentation</translation>
+ </message>
+ <message>
+ <source>RESULTS</source>
+ <translation>Résultats</translation>
+ </message>
+ <message>
+ <source>SCALAR_BAR_TAB</source>
+ <translation>Barre scalaire </translation>
+ </message>
+ <message>
+ <source>SCALE_FACTOR</source>
+ <translation>Facteur d'échelle:</translation>
+ </message>
+ <message>
+ <source>WARNING</source>
+ <translation>Avertissement</translation>
+ </message>
+ <message>
+ <source>Text properties...</source>
+ <translation>Propriétés du texte</translation>
+ </message>
+ <message>
+ <source>Bar properties...</source>
+ <translation>Propriétés de la barre</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_GaussScalarBarPane</name>
+ <message>
+ <source>ACTIVE_BAR_GRP</source>
+ <translation>Activer la barre</translation>
+ </message>
+ <message>
+ <source>BICOLOR</source>
+ <translation>Bicouleur</translation>
+ </message>
+ <message>
+ <source>COLORS_LABELS_GRP</source>
+ <translation>Couleurs et libellés</translation>
+ </message>
+ <message>
+ <source>DIMENSIONS_GRP</source>
+ <translation>Dimensions</translation>
+ </message>
+ <message>
+ <source>HIDE_SCALAR_BAR</source>
+ <translation>Cacher la barre scalaire</translation>
+ </message>
+ <message>
+ <source>DISPLAYED</source>
+ <translation>Visualisé</translation>
+ </message>
+ <message>
+ <source>FIELD_RANGE_BTN</source>
+ <translation>Utiliser l'intervalle de valeurs des champs</translation>
+ </message>
+ <message>
+ <source>GLOBAL</source>
+ <translation>Global</translation>
+ </message>
+ <message>
+ <source>HORIZONTAL_BTN</source>
+ <translation>Horizontal</translation>
+ </message>
+ <message>
+ <source>IMPOSED_RANGE_BTN</source>
+ <translation>Utiliser l'intervalle de valeurs imposé</translation>
+ </message>
+ <message>
+ <source>LBL_HEIGHT</source>
+ <translation>Hauteur:</translation>
+ </message>
+ <message>
+ <source>LBL_MAX</source>
+ <translation>Max:</translation>
+ </message>
+ <message>
+ <source>LBL_MIN</source>
+ <translation>Min:</translation>
+ </message>
+ <message>
+ <source>LBL_NB_COLORS</source>
+ <translation>Nombres de couleurs:</translation>
+ </message>
+ <message>
+ <source>LBL_NB_LABELS</source>
+ <translation>Nombre de libellés:</translation>
+ </message>
+ <message>
+ <source>LBL_SPACING</source>
+ <translation>Espacement:</translation>
+ </message>
+ <message>
+ <source>LBL_WIDTH</source>
+ <translation>Largeur:</translation>
+ </message>
+ <message>
+ <source>LBL_X</source>
+ <translation>X:</translation>
+ </message>
+ <message>
+ <source>LBL_Y</source>
+ <translation>Y:</translation>
+ </message>
+ <message>
+ <source>LOCAL</source>
+ <translation>Local</translation>
+ </message>
+ <message>
+ <source>LOGARITHMIC_SCALING</source>
+ <translation>Logarithmique</translation>
+ </message>
+ <message>
+ <source>ORIENTATION_GRP</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>ORIGIN_GRP</source>
+ <translation>Origine</translation>
+ </message>
+ <message>
+ <source>RAINBOW</source>
+ <translation>Palette de couleurs</translation>
+ </message>
+ <message>
+ <source>SAVE_DEFAULT_CHK</source>
+ <translation>Enregistrer par défaut</translation>
+ </message>
+ <message>
+ <source>SCALAR_MODE</source>
+ <translation>Scalar Mode</translation>
+ </message>
+ <message>
+ <source>SCALAR_RANGE_GRP</source>
+ <translation>Intervalle de valeurs:</translation>
+ </message>
+ <message>
+ <source>VERTICAL_BTN</source>
+ <translation>Vertical</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_GaussPointsSelectionPane</name>
+ <message>
+ <source>DISPLAY_PARENT_MESH</source>
+ <translation>Montrer l'élément du maillage parent</translation>
+ </message>
+ <message>
+ <source>PICKING_DLG_TITLE</source>
+ <translation>Désignation</translation>
+ </message>
+ <message>
+ <source>DATA_POSITION</source>
+ <translation>Position</translation>
+ </message>
+ <message>
+ <source>PARENT_ELEMENT</source>
+ <translation>ID parent:</translation>
+ </message>
+ <message>
+ <source>PARENT_ELEMENT_TIP</source>
+ <translation>ID de l'élément du maillage parent</translation>
+ </message>
+ <message>
+ <source>LOCAL_POINT</source>
+ <translation>ID local:</translation>
+ </message>
+ <message>
+ <source>LOCAL_POINT_TIP</source>
+ <translation>ID du point de Gauss local </translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_InputPanel</name>
+ <message>
+ <source>WINDOW_TITLE</source>
+ <translation>Panneau d'entrée</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_InputPane</name>
+ <message>
+ <source>ENTITY</source>
+ <translation>Entité :</translation>
+ </message>
+ <message>
+ <source>FIELD</source>
+ <translation>Champ :</translation>
+ </message>
+ <message>
+ <source>MED_FILE</source>
+ <translation>Fichier source :</translation>
+ </message>
+ <message>
+ <source>MESH</source>
+ <translation>Maillage :</translation>
+ </message>
+ <message>
+ <source>PRS_DATA_SOUIRCE</source>
+ <translation>Données source</translation>
+ </message>
+ <message>
+ <source>REINITIALIZE</source>
+ <translation>Mettre à jour automatiquement</translation>
+ </message>
+ <message>
+ <source>TIME_STAMP</source>
+ <translation>Pas de temps :</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_IsoSurfPane</name>
+ <message>
+ <source>MAX_VALUE</source>
+ <translation>Valeur maximale:</translation>
+ </message>
+ <message>
+ <source>MIN_VALUE</source>
+ <translation>Valeur minimale:</translation>
+ </message>
+ <message>
+ <source>MSG_MINMAX_VALUES</source>
+ <translation>Il faut que la valeur minimale soit inférieure à la valeur maximale</translation>
+ </message>
+ <message>
+ <source>NB_SURFACES</source>
+ <translation>Nombre de surfaces:</translation>
+ </message>
+ <message>
+ <source>MAGNITUDE_COLORING_CHK</source>
+ <translation>Coloration selon la magnitude</translation>
+ </message>
+ <message>
+ <source>SEL_COLOR_BTN</source>
+ <translation>Choisir la couleur</translation>
+ </message>
+ <message>
+ <source>SHOW_VALUES_CHK</source>
+ <translation>Montrer les valeurs (nb par surface)</translation>
+ </message>
+ <message>
+ <source>RANGE</source>
+ <translation>Intervalle de valeurs</translation>
+ </message>
+ <message>
+ <source>USE_SCALAR_BAR_RANGE</source>
+ <translation>Utiliser l'intervalle de valeurs de la barre scalaire</translation>
+ </message>
+ <message>
+ <source>USE_CUSTOM_RANGE</source>
+ <translation>Utiliser l'intervalle de valeurs personnalisé</translation>
+ </message>
+ <message>
+ <source>Update scalar bar range with these values</source>
+ <translation>Mettre à jour la barre avec ces valeurs</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_IsoSurfacesDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation>&Annuler</translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation>&OK</translation>
+ </message>
+ <message>
+ <source>DEFINE_ISOSURFACES</source>
+ <translation>Définition des surfaces isométriques</translation>
+ </message>
+ <message>
+ <source>Iso Surface</source>
+ <translation>Surfaces isométriques</translation>
+ </message>
+ <message>
+ <source>Scalar Bar</source>
+ <translation>Barre scalaire</translation>
+ </message>
+ <message>
+ <source>Input</source>
+ <translation>Données d'entrée</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ItemContainer</name>
+ <message>
+ <source>AUTO_CHECK_LBL</source>
+ <translation>Attribuer automatiquement</translation>
+ </message>
+ <message>
+ <source>CIRCLE_MARKER_LBL</source>
+ <translation>Cercle</translation>
+ </message>
+ <message>
+ <source>CROSS_MARKER_LBL</source>
+ <translation>Croix</translation>
+ </message>
+ <message>
+ <source>DAHSDOTDOT_LINE_LBL</source>
+ <translation>TiretPointPoint</translation>
+ </message>
+ <message>
+ <source>DASHDOT_LINE_LBL</source>
+ <translation>TiretPoint</translation>
+ </message>
+ <message>
+ <source>DASH_LINE_LBL</source>
+ <translation>Tiret</translation>
+ </message>
+ <message>
+ <source>DIAMOND_MARKER_LBL</source>
+ <translation>Diamant</translation>
+ </message>
+ <message>
+ <source>DOT_LINE_LBL</source>
+ <translation>Point</translation>
+ </message>
+ <message>
+ <source>DTRIANGLE_MARKER_LBL</source>
+ <translation>Triangle orienté en bas</translation>
+ </message>
+ <message>
+ <source>H</source>
+ <translation> H </translation>
+ </message>
+ <message>
+ <source>LTRIANGLE_MARKER_LBL</source>
+ <translation>Triangle orienté à gauche</translation>
+ </message>
+ <message>
+ <source>NONE_LINE_LBL</source>
+ <translation>Aucune</translation>
+ </message>
+ <message>
+ <source>NONE_MARKER_LBL</source>
+ <translation>Aucun</translation>
+ </message>
+ <message>
+ <source>RECTANGLE_MARKER_LBL</source>
+ <translation>Rectangle</translation>
+ </message>
+ <message>
+ <source>RTRIANGLE_MARKER_LBL</source>
+ <translation>Triangle orienté à droite</translation>
+ </message>
+ <message>
+ <source>SOLID_LINE_LBL</source>
+ <translation>Solide</translation>
+ </message>
+ <message>
+ <source>UTRIANGLE_MARKER_LBL</source>
+ <translation>Triangle orienté en haut</translation>
+ </message>
+ <message>
+ <source>V</source>
+ <translation> V </translation>
+ </message>
+ <message>
+ <source>XCROSS_MARKER_LBL</source>
+ <translation>Croix diagonale</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_Module</name>
+ <message>
+ <source>MEN_DESK_FILE_SAVE_GUI_STATE</source>
+ <translation>Sauvegarder l'état VISU</translation>
+ </message>
+ <message>
+ <source>MEN_GAUSS</source>
+ <translation>Gauss</translation>
+ </message>
+ <message>
+ <source>MEN_GAUSS_CREATE_PRS</source>
+ <translation>Points de Gauss</translation>
+ </message>
+ <message>
+ <source>MEN_GAUSS_NEW_VIEWER</source>
+ <translation>Visualiser les points</translation>
+ </message>
+ <message>
+ <source>MEN_OVERWRITE_CONFIGURATION</source>
+ <translation>Réécrire la configuration courante</translation>
+ </message>
+ <message>
+ <source>MEN_RESTORE_CONFIGURATION</source>
+ <translation>Restaurer la configuration Actuelle</translation>
+ </message>
+ <message>
+ <source>MEN_SAVE_CONFIGURATION</source>
+ <translation>Sauvegarder la Configuration Actuelle</translation>
+ </message>
+ <message>
+ <source>MEN_VISUALISATION</source>
+ <translation>Visualisation</translation>
+ </message>
+ <message>
+ <source>PRP_DESK_FILE_SAVE_GUI_STATE</source>
+ <translation>Sauvegarder l'état actuel des scènes, objets affichés, etc.</translation>
+ </message>
+ <message>
+ <source>TOOL_IMPORT</source>
+ <translation>La barre d'outils d'importation</translation>
+ </message>
+ <message>
+ <source>TOOL_VISUALISATION</source>
+ <translation>Visualisation</translation>
+ </message>
+ <message>
+ <source>TOT_DESK_FILE_SAVE_GUI_STATE</source>
+ <translation>Sauvegarder l'état VISU</translation>
+ </message>
+ <message>
+ <source>VISU_CAMERA_MOVE_PREF</source>
+ <translation>Nombre de pas entre deux positions</translation>
+ </message>
+ <message>
+ <source>VISU_CAMERA_PREF_GROUP_TTL</source>
+ <translation>Mouvement de la caméra</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL</source>
+ <translation>Curseur intérieur</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL</source>
+ <translation>Curseur extérieur</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_ACTIVE_BAR</source>
+ <translation>Barre active</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_ALPHA_TEXTURE</source>
+ <translation>Texture du canal alpha (16x16)</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_ALPHA_THRESHOLD</source>
+ <translation>Seuil du canal alpha</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_BICOLOR</source>
+ <translation>Bicouleur</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_CLAMP</source>
+ <translation>Taille maximale</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_COLOR</source>
+ <translation>Couleur</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_COLOR_GROUP_TTL</source>
+ <translation>Couleur</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_DEFORMED_SHAPE_GROUP_TTL</source>
+ <translation>Déformation</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_DISPLAY_GLOBAL</source>
+ <translation>Montrer la barre globale</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_FACE_LIMIT</source>
+ <translation>Notifier si le nombre de faces est supérieur</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_GEOMSPHERE</source>
+ <translation>Sphère géométrique</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_GEOM_GROUP_TTL</source>
+ <translation>Géométrie</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_GLOBAL</source>
+ <translation>Global</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_INCREMENT</source>
+ <translation>+/- Ratio</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_LOCAL</source>
+ <translation>Local</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_MAGNIFICATION</source>
+ <translation>Grossissement (%)</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_MAGNIFICATION_GROUP_TTL</source>
+ <translation>Grossissement (intérieure et extérieure)</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_MAIN_TEXTURE</source>
+ <translation>Texture principale (16x16)</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_MAX_SIZE</source>
+ <translation>Intervalle de valeurs pour la taille maximale (%)</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_MIN_SIZE</source>
+ <translation>Intervalle de valeurs pour la taille minimale (%)</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_OPENGLPOINT</source>
+ <translation>Point OpenGL</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_POINTSPRITE</source>
+ <translation>Point sprite</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL</source>
+ <translation>Primitive</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_PRIMITIVE_TYPE</source>
+ <translation>Type de primitive</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_RAINBOW</source>
+ <translation>Palette de couleur</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_RESOLUTION</source>
+ <translation>Résolution de la sphère géométrique</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_SCALAR_BAR_MODE</source>
+ <translation>Mode de la barre scalaire</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_SCALE_FACTOR</source>
+ <translation>Facteur scalaire</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_SIZE</source>
+ <translation>Taille des points (%)</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_SIZE_GROUP_TTL</source>
+ <translation>Taille</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_SPACING</source>
+ <translation>Espacement</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_TAB_TTL</source>
+ <translation>Points de Gauss</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_PREF_UNIFORM_COLOR</source>
+ <translation>Couleur uniforme</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_SCALAR_BAR_PREF_GROUP_TTL</source>
+ <translation>Barre scalaire des points de Gauss</translation>
+ </message>
+ <message>
+ <source>VISU_GAUSS_SCALAR_BAR_PREF_TAB_TTL</source>
+ <translation>Barre scalaire des points de Gauss</translation>
+ </message>
+ <message>
+ <source>VISU_KEYBOARD_PREF</source>
+ <translation>[+]/[-] Incrémentation de la vitesse</translation>
+ </message>
+ <message>
+ <source>VISU_KEYBOARD_PREF_GROUP_TTL</source>
+ <translation>Clavier</translation>
+ </message>
+ <message>
+ <source>VISU_MOUSE_PREF</source>
+ <translation>Comportement de la souris</translation>
+ </message>
+ <message>
+ <source>VISU_MOUSE_PREF_GROUP_TLT</source>
+ <translation>Souris</translation>
+ </message>
+ <message>
+ <source>VISU_MOUSE_PREF_KEYBOARD_FREE</source>
+ <translation>Sans clavier</translation>
+ </message>
+ <message>
+ <source>VISU_MOUSE_PREF_STANDARD</source>
+ <translation>Contrôles Salomé standards</translation>
+ </message>
+ <message>
+ <source>VISU_MOUSE_PREF_TAB_TLT</source>
+ <translation>Navigation</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_BELOW_POINT</source>
+ <translation>Centré sous le point</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_CAMERA_GROUP_TTL</source>
+ <translation>Mouvement de la caméra</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_CAMERA_MOVEMENT</source>
+ <translation>Activer le mouvement de la caméra</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_CURSOR_GROUP_TTL</source>
+ <translation>Curseur</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_CURSOR_SIZE</source>
+ <translation>Taille du curseur</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_DISPLAY_PARENT_MESH</source>
+ <translation>Visualiser l'élément du maillage parent</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_INFO_WINDOW</source>
+ <translation>Activer la fenêtre d'information</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_INFO_WINDOW_GROUP_TTL</source>
+ <translation>La fenêtre d'information</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_PARENT_MESH_TTL</source>
+ <translation>Elément du maillage parent</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_POINT_SELECTION_TOLERANCE</source>
+ <translation>Tolérance de la sélection du point </translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_POSITION</source>
+ <translation>Position</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_PYRAMID_HEIGHT</source>
+ <translation>Hauteur des pyramides</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_SELECTION_COLOR</source>
+ <translation>Couleur du curseur de sélection</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_STEP_NUMBER</source>
+ <translation>Nombre de pas entre deux positions</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_TAB_TTL</source>
+ <translation>Désignation</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_TOLERANCE_GROUP_TTL</source>
+ <translation>Tolérance</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_TOP_LEFT_CORNER</source>
+ <translation>Coin supérieur gauche de la vue 3D</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_TRANSPARENCY</source>
+ <translation>Transparence</translation>
+ </message>
+ <message>
+ <source>VISU_PICKING_PREF_ZOOM_FACTOR</source>
+ <translation>Facteur de zoom</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_ALL_DISLPAYED_FRAMES</source>
+ <translation>Enregistrer tous les cadres visualisés</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_FPS</source>
+ <translation>FPS</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_GROUP_TTL</source>
+ <translation>Paramètres</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_PROGRESSIVE</source>
+ <translation>Progressif</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_QUALITY</source>
+ <translation>Qualité</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_RECORDING_MODE</source>
+ <translation>Mode</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_SKIPPED_FRAMES</source>
+ <translation>Enregistrer avec un FPS donné</translation>
+ </message>
+ <message>
+ <source>VISU_RECORDER_PREF_TAB_TTL</source>
+ <translation>Enregistrer</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF</source>
+ <translation>Souris 3D</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_1</source>
+ <translation>Diminuer l'incrémentation de la vitesse</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_2</source>
+ <translation>Accroître l'incrémentation de la vitesse</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_3</source>
+ <translation>Diminuer le grossissement des points de Gauss</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_4</source>
+ <translation>Accroître le grossissement des points de Gauss</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_5</source>
+ <translation>Commutateur dominant / combiné</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_*</source>
+ <translation>Bouton *</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_1</source>
+ <translation>Bouton 1</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_10</source>
+ <translation>Bouton 10</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_11</source>
+ <translation>Bouton 11</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_2</source>
+ <translation>Bouton 2</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_3</source>
+ <translation>Bouton 3</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_4</source>
+ <translation>Bouton 4</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_5</source>
+ <translation>Bouton 5</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_6</source>
+ <translation>Bouton 6</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_7</source>
+ <translation>Bouton 7</translation>
+ </message>
+ <message>
+ <source>VISU_SPACEMOUSE_PREF_BTN_8</source>
+ <translation>Bouton 8</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_NameDlg</name>
+ <message>
+ <source>NAME_LBL</source>
+ <translation>Nom: </translation>
+ </message>
+ <message>
+ <source>TLT_RENAME</source>
+ <translation>Renommer</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_NonIsometricDlg</name>
+ <message>
+ <source>&Apply</source>
+ <translation>A&ppliquer</translation>
+ </message>
+ <message>
+ <source>&Cancel</source>
+ <translation>&Annuler</translation>
+ </message>
+ <message>
+ <source>&Reset</source>
+ <translation>&Restaurer</translation>
+ </message>
+ <message>
+ <source>DLG_TITLE</source>
+ <translation>Echelle</translation>
+ </message>
+ <message>
+ <source>LBL_X</source>
+ <translation>X :</translation>
+ </message>
+ <message>
+ <source>LBL_Y</source>
+ <translation>Y :</translation>
+ </message>
+ <message>
+ <source>LBL_Z</source>
+ <translation>Z :</translation>
+ </message>
+ <message>
+ <source>O&K</source>
+ <translation></translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_Plot3DDlg</name>
+ <message>
+ <source>INPUT_TAB_TITLE</source>
+ <translation>Entrée</translation>
+ </message>
+ <message>
+ <source>PLOT3D_TAB_TITLE</source>
+ <translation>Graphe 3D</translation>
+ </message>
+ <message>
+ <source>SCALAR_BAR_TAB_TITLE</source>
+ <translation>Barre scalaire</translation>
+ </message>
+ <message>
+ <source>TITLE</source>
+ <translation>Définition Graphe 3D </translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_Plot3DPane</name>
+ <message>
+ <source>CONTOUR</source>
+ <translation>Contour</translation>
+ </message>
+ <message>
+ <source>NUMBER_CONTOURS</source>
+ <translation>Nombre de contours:</translation>
+ </message>
+ <message>
+ <source>ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>POSITION</source>
+ <translation>Position</translation>
+ </message>
+ <message>
+ <source>POSITION_VALUE</source>
+ <translation>Valeur: </translation>
+ </message>
+ <message>
+ <source>PRESENTATION_TYPE</source>
+ <translation>Type de présentation</translation>
+ </message>
+ <message>
+ <source>PREVIEW</source>
+ <translation>Prévisualiser le plan de coupe</translation>
+ </message>
+ <message>
+ <source>RELATIVE</source>
+ <translation>Relatif</translation>
+ </message>
+ <message>
+ <source>ROTATIONS</source>
+ <translation>Rotations</translation>
+ </message>
+ <message>
+ <source>ROTATION_X</source>
+ <translation>Rotation autour de X (Y Ã Z):</translation>
+ </message>
+ <message>
+ <source>ROTATION_Y</source>
+ <translation>Rotation autour de Y (Z Ã X):</translation>
+ </message>
+ <message>
+ <source>ROTATION_Z</source>
+ <translation>Rotation autour de Z (X Ã Y):</translation>
+ </message>
+ <message>
+ <source>SCALE</source>
+ <translation>Facteur d'échelle:</translation>
+ </message>
+ <message>
+ <source>SURFACE</source>
+ <translation>Surface</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ScalarBarDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation>&Annuler</translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation>&OK</translation>
+ </message>
+ <message>
+ <source>DLG_PREF_TITLE</source>
+ <translation>Préférences de la barre scalaire</translation>
+ </message>
+ <message>
+ <source>DLG_PROP_TITLE</source>
+ <translation>Propriétés de la barre scalaire</translation>
+ </message>
+ <message>
+ <source>INPUT_TAB</source>
+ <translation>Données d'entrée</translation>
+ </message>
+ <message>
+ <source>SCALAR_BAR_TAB</source>
+ <translation>Barre scalaire</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ScalarBarPane</name>
+ <message>
+ <source>COLORS_LABELS_GRP</source>
+ <translation>Couleurs des libellés</translation>
+ </message>
+ <message>
+ <source>DIMENSIONS_GRP</source>
+ <translation>Dimensions (% de la taille de la vue)</translation>
+ </message>
+ <message>
+ <source>FIELD_RANGE_BTN</source>
+ <translation>Utiliser l'intervalle de valeurs du champ</translation>
+ </message>
+ <message>
+ <source>HORIZONTAL_BTN</source>
+ <translation>Horizontal</translation>
+ </message>
+ <message>
+ <source>IMPOSED_RANGE_BTN</source>
+ <translation>Utiliser l'intervalle de valeurs imposé</translation>
+ </message>
+ <message>
+ <source>LBL_HEIGHT</source>
+ <translation>Hauteur:</translation>
+ </message>
+ <message>
+ <source>LBL_MAX</source>
+ <translation>Max:</translation>
+ </message>
+ <message>
+ <source>LBL_MIN</source>
+ <translation>Min:</translation>
+ </message>
+ <message>
+ <source>LBL_NB_COLORS</source>
+ <translation>Nombre de couleurs:</translation>
+ </message>
+ <message>
+ <source>LBL_NB_LABELS</source>
+ <translation>Nombre de libellés</translation>
+ </message>
+ <message>
+ <source>LBL_SHOW_PREVIEW</source>
+ <translation>Prévisualisation</translation>
+ </message>
+ <message>
+ <source>SHOW_DISTRIBUTION</source>
+ <translation>Montrer la distribution</translation>
+ </message>
+ <message>
+ <source>FILTER_BY_SCALARS</source>
+ <translation>Filtrer par scalaires</translation>
+ </message>
+ <message>
+ <source>VALUES_LABELING</source>
+ <translation>Libellés des valeurs</translation>
+ </message>
+ <message>
+ <source>LBL_WIDTH</source>
+ <translation>Largeur:</translation>
+ </message>
+ <message>
+ <source>LBL_X</source>
+ <translation>X:</translation>
+ </message>
+ <message>
+ <source>LBL_Y</source>
+ <translation>Y:</translation>
+ </message>
+ <message>
+ <source>LOGARITHMIC_SCALING</source>
+ <translation>Logarithmique</translation>
+ </message>
+ <message>
+ <source>MSG_MINMAX_VALUES</source>
+ <translation>La valeur minimale devrait être inférieure ou égale à la valeur maximale</translation>
+ </message>
+ <message>
+ <source>ORIENTATION_GRP</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>ORIGIN_GRP</source>
+ <translation>Origine</translation>
+ </message>
+ <message>
+ <source>SAVE_DEFAULT_CHK</source>
+ <translation>Enregistrer par défaut</translation>
+ </message>
+ <message>
+ <source>SCALAR_MODE</source>
+ <translation>Mode scalaire</translation>
+ </message>
+ <message>
+ <source>SCALAR_RANGE_GRP</source>
+ <translation>Intervalle de valeurs:</translation>
+ </message>
+ <message>
+ <source>VERTICAL_BTN</source>
+ <translation>Vertical</translation>
+ </message>
+ <message>
+ <source>WRN_LOGARITHMIC_FIELD_RANGE</source>
+ <translation>Echelle logarithmique : l'intervalle de valeurs du champ contient des valeurs négatives, il est recommandé d'utiliser l'intervalle de valeurs imposé</translation>
+ </message>
+ <message>
+ <source>WRN_LOGARITHMIC_RANGE</source>
+ <translation>Echelle logarithmique : utiliser les valeurs positives de l'intervalle de valeurs imposé</translation>
+ </message>
+ <message>
+ <source>HIDE_SCALAR_BAR</source>
+ <translation>Cacher la barre scalaire</translation>
+ </message>
+ <message>
+ <source>Text properties...</source>
+ <translation>Propriétés du texte</translation>
+ </message>
+ <message>
+ <source>Bar properties...</source>
+ <translation>Propriétés de la barre</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_DeformedShapeAndScalarMapDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation>&Annuler</translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>DLG_TITLE</source>
+ <translation>Déformation et carte scalaire</translation>
+ </message>
+ <message>
+ <source>ERR_SCALAR_DATA_INCONSISTENT</source>
+ <translation>Les données scalaires du champ choisi sont incohérentes.
+Choisissez un autre champ.</translation>
+ </message>
+ <message>
+ <source>FIELD_ITEM</source>
+ <translation>Champ scalaire:</translation>
+ </message>
+ <message>
+ <source>INPUT_TAB</source>
+ <translation>Entrée</translation>
+ </message>
+ <message>
+ <source>SCALAR_BAR_TAB</source>
+ <translation>Barre scalaire</translation>
+ </message>
+ <message>
+ <source>DEFORMED_SHAPE_AND_SCALAR_MAP_TAB</source>
+ <translation>Déformation et carte scalaire</translation>
+ </message>
+ <message>
+ <source>SCALE_FACTOR</source>
+ <translation>Facteur d'échelle:</translation>
+ </message>
+ <message>
+ <source>TIMESTAMP_ITEM</source>
+ <translation>Pas de temps actuel:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_SetupPlot2dDlg</name>
+ <message>
+ <source>BUT_NO</source>
+ <translation>Non</translation>
+ </message>
+ <message>
+ <source>BUT_YES</source>
+ <translation>Oui</translation>
+ </message>
+ <message>
+ <source>QUE_WANT_SAME_UNITS</source>
+ <translation>Voulez-vous choisir tous les objets ayant les mêmes unités de l'axe vertical?</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_Sweep</name>
+ <message>
+ <source>TITLE</source>
+ <translation>Balayage</translation>
+ </message>
+ <message>
+ <source>MEN_SWEEP_PANE</source>
+ <translation>Balayage</translation>
+ </message>
+ <message>
+ <source>NAVIGATION_TAB</source>
+ <translation>Navigation</translation>
+ </message>
+ <message>
+ <source>START_SWEEP_POSITION</source>
+ <translation>0 %</translation>
+ </message>
+ <message>
+ <source>END_SWEEP_POSITION</source>
+ <translation>100 %</translation>
+ </message>
+ <message>
+ <source>IS_CYCLED</source>
+ <translation>En boucle</translation>
+ </message>
+ <message>
+ <source>PROPERTIES_TAB</source>
+ <translation>Propriétés</translation>
+ </message>
+ <message>
+ <source>MODE</source>
+ <translation>Mode:</translation>
+ </message>
+ <message>
+ <source>LINEAR</source>
+ <translation>Linéaire</translation>
+ </message>
+ <message>
+ <source>COSINUSOIDAL</source>
+ <translation>( 1 - cos( t ) ) / 2</translation>
+ </message>
+ <message>
+ <source>SINUSOIDAL</source>
+ <translation>sin( t - Pi / 2 )</translation>
+ </message>
+ <message>
+ <source>NUMBER_OF_STEPS</source>
+ <translation>Nombre de as:</translation>
+ </message>
+ <message>
+ <source>INTERVAL</source>
+ <translation>Intervalle</translation>
+ </message>
+ <message>
+ <source>[ 0, +PI ]</source>
+ <translation>[ 0, +PI ]</translation>
+ </message>
+ <message>
+ <source>[ -PI, +PI ]</source>
+ <translation>[ -PI, +PI ]</translation>
+ </message>
+ <message>
+ <source>DELAY_BETWEEN_STEPS</source>
+ <translation>Délai de pas [ sec ]:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_Slider</name>
+ <message>
+ <source>TITLE</source>
+ <translation>Barre de défilement</translation>
+ </message>
+ <message>
+ <source>MEN_SLIDER_PANE</source>
+ <translation>Barre de défilement</translation>
+ </message>
+ <message>
+ <source>NAVIGATION_TAB</source>
+ <translation>Navigation</translation>
+ </message>
+ <message>
+ <source>IS_CYCLED</source>
+ <translation>En boucle</translation>
+ </message>
+ <message>
+ <source>PROPERTIES_TAB</source>
+ <translation>Propriétés</translation>
+ </message>
+ <message>
+ <source>MINIMAL_MEMORY</source>
+ <translation>Minimale</translation>
+ </message>
+ <message>
+ <source>LIMITED_MEMORY</source>
+ <translation>Limité</translation>
+ </message>
+ <message>
+ <source>MEMORY_UNITS</source>
+ <translation>Mb</translation>
+ </message>
+ <message>
+ <source>USED_BY_CACHE</source>
+ <translation>Utilisé:</translation>
+ </message>
+ <message>
+ <source>AVAILABLE_MEMORY</source>
+ <translation>Libre:</translation>
+ </message>
+ <message>
+ <source>SPEED</source>
+ <translation>Vitesse</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_StreamLinesDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation>&Annuler</translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>DLG_TITLE</source>
+ <translation>Préférences des lignes de courant</translation>
+ </message>
+ <message>
+ <source>LBL_DIRECTION</source>
+ <translation>Direction</translation>
+ </message>
+ <message>
+ <source>LBL_INTEGRATION_STEP</source>
+ <translation>Pas d'intégration</translation>
+ </message>
+ <message>
+ <source>LBL_PROPAGATION_TIME</source>
+ <translation>Temps de propagation</translation>
+ </message>
+ <message>
+ <source>LBL_SOURCE_TYPE</source>
+ <translation>Type de source</translation>
+ </message>
+ <message>
+ <source>LBL_STEP_LENGTH</source>
+ <translation>Longueur de pas</translation>
+ </message>
+ <message>
+ <source>LBL_USED_POINTS</source>
+ <translation>Points utilisés (0..1)</translation>
+ </message>
+ <message>
+ <source>MAGNITUDE_COLORING_CHK</source>
+ <translation>Coloration selon la magnitude</translation>
+ </message>
+ <message>
+ <source>SOURCE_GRP</source>
+ <translation>Source</translation>
+ </message>
+ <message>
+ <source>USE_COLOR_BTN</source>
+ <translation>Utiliser la couleur</translation>
+ </message>
+ <message>
+ <source>STREAM_MEMORY_ALERT</source>
+ <translation>Impossible de créer la présentation avec les paramètres initiaux à cause de la mémoire insuffisante.
+Quelques paramètres ont été changés. Voulez-vous conitnuer?</translation>
+ </message>
+ <message>
+ <source>None</source>
+ <translation>Aucune</translation>
+ </message>
+ <message>
+ <source>Entity</source>
+ <translation>Entité</translation>
+ </message>
+ <message>
+ <source>Family</source>
+ <translation>Famille</translation>
+ </message>
+ <message>
+ <source>Group</source>
+ <translation>Groupe</translation>
+ </message>
+ <message>
+ <source>Presentation</source>
+ <translation>Présentation</translation>
+ </message>
+ <message>
+ <source>Forward</source>
+ <translation>En avant</translation>
+ </message>
+ <message>
+ <source>Backward</source>
+ <translation>En arrière</translation>
+ </message>
+ <message>
+ <source>Both</source>
+ <translation>Les deux</translation>
+ </message>
+ <message>
+ <source>Stream Lines</source>
+ <translation>Lignes de courant</translation>
+ </message>
+ <message>
+ <source>Input</source>
+ <translation>Données d'entrée</translation>
+ </message>
+ <message>
+ <source>Scalar Bar</source>
+ <translation>Barre scalaire</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_SweepPrefDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation>&Annuler</translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>DLG_TITLE</source>
+ <translation>Préférences de balayage</translation>
+ </message>
+ <message>
+ <source>LBL_NB_CYCLES</source>
+ <translation>Nombre de cycles:</translation>
+ </message>
+ <message>
+ <source>LBL_NB_STEPS</source>
+ <translation>Nombre de pas:</translation>
+ </message>
+ <message>
+ <source>LBL_TIME_STEP</source>
+ <translation>Pas de temps (seconde):</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_TextPrefDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation>&Annuler</translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>LBL_BOLD</source>
+ <translation>Gras</translation>
+ </message>
+ <message>
+ <source>LBL_ITALIC</source>
+ <translation>Italique</translation>
+ </message>
+ <message>
+ <source>LBL_LABELS</source>
+ <translation>Libellés</translation>
+ </message>
+ <message>
+ <source>LBL_SHADOW</source>
+ <translation>Ombrage</translation>
+ </message>
+ <message>
+ <source>LBL_TITLE</source>
+ <translation>Titre</translation>
+ </message>
+ <message>
+ <source>TIT_TEXT_PREF</source>
+ <translation>Propriétés du texte</translation>
+ </message>
+</context>
+<context>
+ <name>SetupDlg</name>
+ <message>
+ <source>Setup Animation</source>
+ <translation>Régler l'animation</translation>
+ </message>
+ <message>
+ <source>Use range of time stamps</source>
+ <translation>Utiliser un intervalle de pas de temps</translation>
+ </message>
+ <message>
+ <source>From</source>
+ <translation>Depuis</translation>
+ </message>
+ <message>
+ <source>To</source>
+ <translation>jusqu'Ã </translation>
+ </message>
+ <message>
+ <source>Use sequence of time stamps</source>
+ <translation>Utiliser certains pas de temps</translation>
+ </message>
+ <message>
+ <source>Indices</source>
+ <translation>Indices</translation>
+ </message>
+ <message>
+ <source>Fields</source>
+ <translation>Champs</translation>
+ </message>
+ <message>
+ <source>Properties</source>
+ <translation>Propriétés</translation>
+ </message>
+ <message>
+ <source>Properties...</source>
+ <translation>Propriétés...</translation>
+ </message>
+ <message>
+ <source>Arrange...</source>
+ <translation>Organiser...</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_TimeAnimationDlg</name>
+ <message>
+ <source>&OK</source>
+ <translation>&OK</translation>
+ </message>
+ <message>
+ <source>Setup Animation...</source>
+ <translation>Régler l'animation...</translation>
+ </message>
+ <message>
+ <source>Generate frames</source>
+ <translation>Générer les images</translation>
+ </message>
+ <message>
+ <source>Properties</source>
+ <translation>Propriétés</translation>
+ </message>
+ <message>
+ <source>Saving</source>
+ <translation>Sauvegarde</translation>
+ </message>
+ <message>
+ <source>Save pictures to directory</source>
+ <translation>Enregistrer les images</translation>
+ </message>
+ <message>
+ <source>Saving format:</source>
+ <translation>Format d'enregistrement :</translation>
+ </message>
+ <message>
+ <source>Path:</source>
+ <translation>Chemin :</translation>
+ </message>
+ <message>
+ <source>Browse...</source>
+ <translation>Parcourir...</translation>
+ </message>
+ <message>
+ <source>Save animation to AVI file</source>
+ <translation>Enregistrer l'animation dans un film AVI</translation>
+ </message>
+ <message>
+ <source>Time stamp frequency:</source>
+ <translation>Fréquence des pas de temps :</translation>
+ </message>
+ <message>
+ <source>Publish to study</source>
+ <translation>Publier dans l'étude</translation>
+ </message>
+ <message>
+ <source>Save Animation</source>
+ <translation>Enregistrer l'animation</translation>
+ </message>
+ <message>
+ <source>Select file</source>
+ <translation>Choisir un fichier</translation>
+ </message>
+ <message>
+ <source>ERROR</source>
+ <translation>Erreur</translation>
+ </message>
+ <message>
+ <source>MSG_NO_ANIMATIONDATA</source>
+ <translation>Il n'y a pas de données pour l'animation</translation>
+ </message>
+ <message>
+ <source>MSG_NO_AVI_MAKER</source>
+ <translation>L'outil jpeg2yuv, nécessaire pour l'enregistrement AVI, n'est pas disponible.
+Consulter la documentation.</translation>
+ </message>
+ <message>
+ <source>MSG_NO_SUPPORTED_IMAGE_FORMATS</source>
+ <translation>Il n'y a pas de formats disponibles pour les images de sortie.
+Consulter la documentation de QT.</translation>
+ </message>
+ <message>
+ <source>MSG_INVALID_IMAGE_FORMAT_INDEX</source>
+ <translation>Le format d'image choisi n'est pas supporté.</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_TransparencyDlg</name>
+ <message>
+ <source>BUT_CLOSE</source>
+ <translation>Fermer</translation>
+ </message>
+ <message>
+ <source>TRANSPARENCY_OPAQUE</source>
+ <translation>Opaque</translation>
+ </message>
+ <message>
+ <source>TRANSPARENCY_TITLE</source>
+ <translation>Changer la transparence</translation>
+ </message>
+ <message>
+ <source>TRANSPARENCY_TRANSPARENT</source>
+ <translation>Transparent</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_VectorsDlg</name>
+ <message>
+ <source>&Cancel</source>
+ <translation>&Annuler</translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation>&OK</translation>
+ </message>
+ <message>
+ <source>ARROWS_BTN</source>
+ <translation>Flèches</translation>
+ </message>
+ <message>
+ <source>CENTER_BTN</source>
+ <translation>Centre</translation>
+ </message>
+ <message>
+ <source>CONES2_BTN</source>
+ <translation>Cônes (2)</translation>
+ </message>
+ <message>
+ <source>CONES6_BTN</source>
+ <translation>Cônes (6)</translation>
+ </message>
+ <message>
+ <source>DLG_TITLE</source>
+ <translation>Présentation d'un champ de vecteurs</translation>
+ </message>
+ <message>
+ <source>GLYPH_POSITION_GRP</source>
+ <translation>Position du glyphe</translation>
+ </message>
+ <message>
+ <source>GLYPH_TYPE_GRP</source>
+ <translation>Type du glyphe</translation>
+ </message>
+ <message>
+ <source>HEAD_BTN</source>
+ <translation>Tête</translation>
+ </message>
+ <message>
+ <source>INPUT_TAB</source>
+ <translation>Données d'entrée</translation>
+ </message>
+ <message>
+ <source>LBL_LINE_WIDTH</source>
+ <translation>Largeur de la ligne:</translation>
+ </message>
+ <message>
+ <source>LBL_SCALE_FACTOR</source>
+ <translation>Facteur d'échelle:</translation>
+ </message>
+ <message>
+ <source>MAGNITUDE_COLORING_CHK</source>
+ <translation>Coloration selon la magnitude</translation>
+ </message>
+ <message>
+ <source>SCALAR_BAR_TAB</source>
+ <translation>Barre scalaire</translation>
+ </message>
+ <message>
+ <source>SEL_COLOR_BTN</source>
+ <translation>Choisir la couleur</translation>
+ </message>
+ <message>
+ <source>TAIL_BTN</source>
+ <translation>Queue</translation>
+ </message>
+ <message>
+ <source>USE_GLYPHS_CHK</source>
+ <translation>Utiliser les glyphes</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_SelectionPanel</name>
+ <message>
+ <source>WINDOW_TITLE</source>
+ <translation>Sélection</translation>
+ </message>
+ <message>
+ <source>MODE_TITLE</source>
+ <translation>Sélection</translation>
+ </message>
+ <message>
+ <source>MODE_GAUSS_POINT</source>
+ <translation>Point de Gauss </translation>
+ </message>
+ <message>
+ <source>MODE_POINT</source>
+ <translation>Point</translation>
+ </message>
+ <message>
+ <source>MODE_CELL</source>
+ <translation>Cellule</translation>
+ </message>
+ <message>
+ <source>MODE_ACTOR</source>
+ <translation>Acteur</translation>
+ </message>
+ <message>
+ <source>MESH_NAME_LBL</source>
+ <translation>Nom du maillage:</translation>
+ </message>
+ <message>
+ <source>FIELD_NAME_LBL</source>
+ <translation>Nom du champ:</translation>
+ </message>
+ <message>
+ <source>POINT_DATA_TITLE</source>
+ <translation>Données du point</translation>
+ </message>
+ <message>
+ <source>DATA_ID_LBL</source>
+ <translation>ID:</translation>
+ </message>
+ <message>
+ <source>POINT_ID_HDR</source>
+ <translation>PointID</translation>
+ </message>
+ <message>
+ <source>CELL_ID_HDR</source>
+ <translation>CelluleID</translation>
+ </message>
+ <message>
+ <source>DATA_SCALAR_HDR</source>
+ <translation>Scalaire</translation>
+ </message>
+ <message>
+ <source>DATA_VECTOR_HDR</source>
+ <translation>Vecteur</translation>
+ </message>
+ <message>
+ <source>POINT_INFO</source>
+ <translation>Info du point</translation>
+ </message>
+ <message>
+ <source>CELL_INFO</source>
+ <translation>Cellule Info</translation>
+ </message>
+ <message>
+ <source>POINT_COORD_TITLE</source>
+ <translation>Coordonnées</translation>
+ </message>
+ <message>
+ <source>CELL_DATA_TITLE</source>
+ <translation>Données de la cellule</translation>
+ </message>
+ <message>
+ <source>CELL_DATA_ID_LBL</source>
+ <translation>ID:</translation>
+ </message>
+ <message>
+ <source>ACTOR_DATA_POSITION_TITLE</source>
+ <translation>Position</translation>
+ </message>
+ <message>
+ <source>ACTOR_DATA_SIZE_TITLE</source>
+ <translation>Taille</translation>
+ </message>
+ <message>
+ <source>SELECTION_PREFERENCES</source>
+ <translation>Préférences de la sélection...</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_SelectionPrefDlg</name>
+ <message>
+ <source>TLT_SELECTION_PREFERENCES</source>
+ <translation>Préférences de sélection </translation>
+ </message>
+ <message>
+ <source>BELOW_POINT</source>
+ <translation>Centré</translation>
+ </message>
+ <message>
+ <source>CAMERA_TITLE</source>
+ <translation>Mouvement de la caméra</translation>
+ </message>
+ <message>
+ <source>CURSOR_SIZE</source>
+ <translation>Taille du curseur:</translation>
+ </message>
+ <message>
+ <source>CURSOR_TITLE</source>
+ <translation>Curseur</translation>
+ </message>
+ <message>
+ <source>INFO_WINDOW_TITLE</source>
+ <translation>Fenêtre d'information</translation>
+ </message>
+ <message>
+ <source>POINT_TOLERANCE</source>
+ <translation>Tolérance du point</translation>
+ </message>
+ <message>
+ <source>POSITION</source>
+ <translation>Position:</translation>
+ </message>
+ <message>
+ <source>PYRAMID_HEIGHT</source>
+ <translation>Hauteur des pyramides:</translation>
+ </message>
+ <message>
+ <source>SELECTION_COLOR</source>
+ <translation>Sélection de la couleur du curseur:</translation>
+ </message>
+ <message>
+ <source>STEP_NUMBER</source>
+ <translation>Nombre de pas</translation>
+ </message>
+ <message>
+ <source>STEP_NUMBER_TIP</source>
+ <translation>Nombre de pas entre deux positions</translation>
+ </message>
+ <message>
+ <source>TOLERANCE_TITLE</source>
+ <translation>Tolérance</translation>
+ </message>
+ <message>
+ <source>TOP_LEFT_CORNER</source>
+ <translation>Angle haut-gauche </translation>
+ </message>
+ <message>
+ <source>TRANSPARENCY</source>
+ <translation>Transparence:</translation>
+ </message>
+ <message>
+ <source>ZOOM_FACTOR</source>
+ <translation>Facteur de zoom:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_BarPrefDlg</name>
+ <message>
+ <source>DIMENSIONS</source>
+ <translation>Dimensions (% de la taille du widget)</translation>
+ </message>
+ <message>
+ <source>WIDTH</source>
+ <translation>Largeur</translation>
+ </message>
+ <message>
+ <source>PRECISION</source>
+ <translation>Précision</translation>
+ </message>
+ <message>
+ <source>&OK</source>
+ <translation>&OK</translation>
+ </message>
+ <message>
+ <source>&Cancel</source>
+ <translation>&Annuler</translation>
+ </message>
+ <message>
+ <source>TIT_BAR_PREF</source>
+ <translation>Propriétés de la barre</translation>
+ </message>
+ <message>
+ <source>LBL_TITLE_W</source>
+ <translation>Taille du titre (%)</translation>
+ </message>
+ <message>
+ <source>LBL_LABEL_W</source>
+ <translation>Taille du libellé (%)</translation>
+ </message>
+ <message>
+ <source>LBL_LABEL_H</source>
+ <translation>Hauteur du libellé (%)</translation>
+ </message>
+ <message>
+ <source>LBL_BAR_W</source>
+ <translation>Largeur de la barre (%)</translation>
+ </message>
+ <message>
+ <source>LBL_BAR_H</source>
+ <translation>Hauteur de la barre (%)</translation>
+ </message>
+ <message>
+ <source>LBL_SHOW_UNITS</source>
+ <translation>Montrer les unités</translation>
+ </message>
+ <message>
+ <source>LBL_UNITS_FORMAT</source>
+ <translation>Format:</translation>
+ </message>
+ <message>
+ <source>MSG_LABEL_FORMAT</source>
+ <translation>Le format des libellés est invalide.</translation>
+ </message>
+ <message>
+ <source>MSG_BIG_SCALE</source>
+ <translation>Il est recommandé que la taille du libellé et la hauteur ou la largeur de la barre soient égales ou inférieures à 100%.</translation>
+ </message>
+ <message>
+ <source>MSG_BIG_SCALE_TLT</source>
+ <translation>Il faut que la taille du titre soit égale ou inférieure à 100%.</translation>
+ </message>
+ <message>
+ <source>AUTO</source>
+ <translation>auto</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_Table3DDlg</name>
+ <message>
+ <source>DLG_PREF_TITLE</source>
+ <translation>Préférences de la barre de la table 3D</translation>
+ </message>
+ <message>
+ <source>DLG_PROP_TITLE</source>
+ <translation>Paramètres de la barre scalaire</translation>
+ </message>
+ <message>
+ <source>Text properties...</source>
+ <translation>Propriétés du texte</translation>
+ </message>
+ <message>
+ <source>Bar properties...</source>
+ <translation>Propriétés de la barre</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_TableScalarBarPane</name>
+ <message>
+ <source>SCALAR_RANGE_GRP</source>
+ <translation>Intervalle de valeurs scalaire</translation>
+ </message>
+ <message>
+ <source>LOGARITHMIC_SCALING</source>
+ <translation>Echelle logarithmique</translation>
+ </message>
+ <message>
+ <source>FIELD_RANGE_BTN</source>
+ <translation>Utiliser l'intervalle de valeurs du champs</translation>
+ </message>
+ <message>
+ <source>IMPOSED_RANGE_BTN</source>
+ <translation>Utiliser l'intervalle de valeurs imposé</translation>
+ </message>
+ <message>
+ <source>LBL_MIN</source>
+ <translation>Min:</translation>
+ </message>
+ <message>
+ <source>LBL_MAX</source>
+ <translation>Max:</translation>
+ </message>
+ <message>
+ <source>COLORS_LABELS_GRP</source>
+ <translation>Couleurs et libellés</translation>
+ </message>
+ <message>
+ <source>LBL_NB_COLORS</source>
+ <translation>Nombre de couleurs:</translation>
+ </message>
+ <message>
+ <source>LBL_NB_LABELS</source>
+ <translation>Nombre de libellés</translation>
+ </message>
+ <message>
+ <source>ORIENTATION_GRP</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>VERTICAL_BTN</source>
+ <translation>Vertical</translation>
+ </message>
+ <message>
+ <source>HORIZONTAL_BTN</source>
+ <translation>Horizontal</translation>
+ </message>
+ <message>
+ <source>ORIGIN_GRP</source>
+ <translation>Origine</translation>
+ </message>
+ <message>
+ <source>LBL_X</source>
+ <translation>X:</translation>
+ </message>
+ <message>
+ <source>LBL_Y</source>
+ <translation>Y:</translation>
+ </message>
+ <message>
+ <source>LBL_SHOW_PREVIEW</source>
+ <translation>Prévisualiser</translation>
+ </message>
+ <message>
+ <source>DIMENSIONS_GRP</source>
+ <translation>Dimensions</translation>
+ </message>
+ <message>
+ <source>LBL_WIDTH</source>
+ <translation>Largeur:</translation>
+ </message>
+ <message>
+ <source>LBL_HEIGHT</source>
+ <translation>Hauteur:</translation>
+ </message>
+ <message>
+ <source>SAVE_DEFAULT_CHK</source>
+ <translation>Enregistrer les valeurs par défaut</translation>
+ </message>
+ <message>
+ <source>MSG_MINMAX_VALUES</source>
+ <translation>La valeur minimale devrait être inférieure ou égale à la valeur maximale</translation>
+ </message>
+ <message>
+ <source>WRN_LOGARITHMIC_RANGE</source>
+ <translation>Echelle logarithmique: utiliser les valeurs positives de l'intervalle imposé</translation>
+ </message>
+ <message>
+ <source>WRN_LOGARITHMIC_FIELD_RANGE</source>
+ <translation>Echelle logarithmique: l'intervalle de valeurs du champ contient des valeurs négatives, il est recommandé d'utiliser l'intervalle de valeurs imposé</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_Table3DPane</name>
+ <message>
+ <source>SCALE</source>
+ <translation>Facteur d'échelle:</translation>
+ </message>
+ <message>
+ <source>PRESENTATION_TYPE</source>
+ <translation>Type de présentation</translation>
+ </message>
+ <message>
+ <source>SURFACE</source>
+ <translation>Surface</translation>
+ </message>
+ <message>
+ <source>CONTOUR</source>
+ <translation>Contour</translation>
+ </message>
+ <message>
+ <source>NUMBER_CONTOURS</source>
+ <translation>Nombre de contours:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_FileInfoDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Information sur le fichier</translation>
+ </message>
+ <message>
+ <source>FILE_NAME</source>
+ <translation>Nom du fichier</translation>
+ </message>
+ <message>
+ <source>FILE_SIZE</source>
+ <translation>Taille du fichier (bytes)</translation>
+ </message>
+ <message>
+ <source>MED_VERSION</source>
+ <translation>Version de MED</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ClippingPlaneMgr</name>
+ <message>
+ <source>TITLE</source>
+ <translation>Configuration des plans de coupe</translation>
+ </message>
+ <message>
+ <source>TITLE_PLANES</source>
+ <translation>Définition des plans </translation>
+ </message>
+ <message>
+ <source>LBL_NAME</source>
+ <translation>Nom du plan</translation>
+ </message>
+ <message>
+ <source>BYVECTOR_TITLE</source>
+ <translation>Vecteur normal</translation>
+ </message>
+ <message>
+ <source>BYPLANE_TITLE</source>
+ <translation>Plan principal</translation>
+ </message>
+ <message>
+ <source>CHK_AUTOAPPLY</source>
+ <translation>Appliquer automatiquement</translation>
+ </message>
+ <message>
+ <source>CHK_SHOW_PREVIEW</source>
+ <translation>Prévisualiser</translation>
+ </message>
+ <message>
+ <source>ORIGIN_TITLE</source>
+ <translation>Origine</translation>
+ </message>
+ <message>
+ <source>DIRECTION_TITLE</source>
+ <translation>Direction</translation>
+ </message>
+ <message>
+ <source>LBL_ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>LBL_DISTANCE</source>
+ <translation>Distance</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION</source>
+ <translation>Rotation autour de %1</translation>
+ </message>
+ <message>
+ <source>BTN_NEW</source>
+ <translation>Nouveau</translation>
+ </message>
+ <message>
+ <source>BTN_DELETE</source>
+ <translation>Supprimer</translation>
+ </message>
+ <message>
+ <source>BTN_IMPORT</source>
+ <translation>Importer...</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation>Importer de...</translation>
+ </message>
+ <message>
+ <source>SELECT_VIEW</source>
+ <translation>Choisir la fenêtre:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_SegmentationMgr</name>
+ <message>
+ <source>MNU_CLIPPING_PLANE_MGR</source>
+ <translation>Plans de coupe</translation>
+ </message>
+ <message>
+ <source>DSK_CLIPPING_PLANE_MGR</source>
+ <translation>Gérer les plans de coupe dans la scène</translation>
+ </message>
+ <message>
+ <source>VISU_VIEW_TOOLBAR</source>
+ <translation>Outils VISU</translation>
+ </message>
+ <message>
+ <source>VISU_SETPLANES_MNU</source>
+ <translation>Définir le plan de coupe...</translation>
+ </message>
+ <message>
+ <source>MNU_SHOW_CLIPPINGPLANES</source>
+ <translation>Montrer les plans de coupe</translation>
+ </message>
+ <message>
+ <source>DSK_SHOW_CLIPPINGPLANES</source>
+ <translation>Montrer/cacher les plans de coupe</translation>
+ </message>
+ <message>
+ <source>MNU_ACTIVATE_CLIPPINGPLANES</source>
+ <translation>Désactiver les plans de coupe</translation>
+ </message>
+ <message>
+ <source>DSK_ACTIVATE_CLIPPINGPLANES</source>
+ <translation>Activer/désactiver les plans de coupe</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ClippingPanel</name>
+ <message>
+ <source>TITLE</source>
+ <translation>Plans de coupe</translation>
+ </message>
+ <message>
+ <source>PRESENTATIONS_LBL</source>
+ <translation>Présentations:</translation>
+ </message>
+ <message>
+ <source>PLANES_LBL</source>
+ <translation>Plans associés:</translation>
+ </message>
+ <message>
+ <source>NEW_BTN</source>
+ <translation>Nouveau...</translation>
+ </message>
+ <message>
+ <source>EDIT_BTN</source>
+ <translation>Editer...</translation>
+ </message>
+ <message>
+ <source>DELETE_BTN</source>
+ <translation>Supprimer</translation>
+ </message>
+ <message>
+ <source>TIT_DELETE_PLANE</source>
+ <translation>Supprimer le plan de coupe</translation>
+ </message>
+ <message>
+ <source>MSG_DELETE_PLANE</source>
+ <translation>Le plan de coupe %1 sera supprimé. Continuer?</translation>
+ </message>
+ <message>
+ <source>CHK_SHOW_PLANES</source>
+ <translation>Prévisualiser les plans</translation>
+ </message>
+ <message>
+ <source>CHK_ACTIVATE_PLANES</source>
+ <translation>Désactiver les plans</translation>
+ </message>
+ <message>
+ <source>CHK_AUTO_APPLY</source>
+ <translation>Appliquer automatiquement</translation>
+ </message>
+ <message>
+ <source>PLANES_TABLE_TITLES</source>
+ <translation>Plan actif</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ClippingPlaneDlg</name>
+ <message>
+ <source>TITLE</source>
+ <translation>Editer le plan de coupe</translation>
+ </message>
+ <message>
+ <source>LBL_NAME</source>
+ <translation>Nom du plan</translation>
+ </message>
+ <message>
+ <source>BYVECTOR_TITLE</source>
+ <translation>Vecteur normal</translation>
+ </message>
+ <message>
+ <source>BYPLANE_TITLE</source>
+ <translation>Plan principal</translation>
+ </message>
+ <message>
+ <source>CHK_AUTOAPPLY</source>
+ <translation>Global</translation>
+ </message>
+ <message>
+ <source>CHK_SHOW_PREVIEW</source>
+ <translation>Prévisualiser</translation>
+ </message>
+ <message>
+ <source>ORIGIN_TITLE</source>
+ <translation>Origine</translation>
+ </message>
+ <message>
+ <source>DIRECTION_TITLE</source>
+ <translation>Direction</translation>
+ </message>
+ <message>
+ <source>LBL_ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>LBL_DISTANCE</source>
+ <translation>Distance</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION</source>
+ <translation>Rotation autour de %1</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_FilterScalarsDlg</name>
+ <message>
+ <source>TITLE</source>
+ <translation>Filtre par scalaires</translation>
+ </message>
+ <message>
+ <source>BOXTITLE</source>
+ <translation>Filtre par intervalle de valeurs scalaires</translation>
+ </message>
+ <message>
+ <source>MINLBL</source>
+ <translation>Min:</translation>
+ </message>
+ <message>
+ <source>MAXLBL</source>
+ <translation>Max:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ValuesLabelingDlg</name>
+ <message>
+ <source>PARAMETERS_OF_VALUES_LABELING</source>
+ <translation>Paramètres des repères de valeurs</translation>
+ </message>
+ <message>
+ <source>LABELS</source>
+ <translation>Libellés</translation>
+ </message>
+ <message>
+ <source>FONT</source>
+ <translation>Police</translation>
+ </message>
+ <message>
+ <source>COLOR</source>
+ <translation>Couleur</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_ShrinkFactorDlg</name>
+ <message>
+ <source>SHRINKFACTOR_TITLE</source>
+ <translation>Changer le facteur de contraction</translation>
+ </message>
+ <message>
+ <source>SHRINKFACTOR_VALUE</source>
+ <translation>Facteur de contraction:</translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_PrimitiveBox</name>
+ <message>
+ <source>ALPHA_TEXTURE</source>
+ <translation>Texture du canal alpha (16x16) :</translation>
+ </message>
+ <message>
+ <source>ALPHA_THRESHOLD</source>
+ <translation>Seuil du canal alpha : </translation>
+ </message>
+ <message>
+ <source>CLAMP</source>
+ <translation>Taille maximale : </translation>
+ </message>
+ <message>
+ <source>FACE_LIMIT</source>
+ <translation>Notifier quand le nombre de faces est excessif : </translation>
+ </message>
+ <message>
+ <source>FACE_NUMBER</source>
+ <translation>Nombre de faces : </translation>
+ </message>
+ <message>
+ <source>GEOMETRICAL_SPHERE</source>
+ <translation>Sphère géométrique</translation>
+ </message>
+ <message>
+ <source>MAIN_TEXTURE</source>
+ <translation>Texture principale (16x16) : </translation>
+ </message>
+ <message>
+ <source>OPENGL_POINT</source>
+ <translation>Point OpenGL</translation>
+ </message>
+ <message>
+ <source>POINT_SPRITE</source>
+ <translation>Point Sprite</translation>
+ </message>
+ <message>
+ <source>PRIMITIVE_TITLE</source>
+ <translation>Primitive</translation>
+ </message>
+ <message>
+ <source>RESOLUTION</source>
+ <translation>Résolution : </translation>
+ </message>
+</context>
+<context>
+ <name>VisuGUI_SizeBox</name>
+ <message>
+ <source>COLOR</source>
+ <translation>Couleur : </translation>
+ </message>
+ <message>
+ <source>COLOR_TITLE</source>
+ <translation>Couleur</translation>
+ </message>
+ <message>
+ <source>GEOM_SIZE</source>
+ <translation>Taille des points (%) : </translation>
+ </message>
+ <message>
+ <source>INCREMENT</source>
+ <translation>+/- Ratio : </translation>
+ </message>
+ <message>
+ <source>MAGNIFICATION</source>
+ <translation>Magnification (%) : </translation>
+ </message>
+ <message>
+ <source>MAX_SIZE</source>
+ <translation>taille max. (%) : </translation>
+ </message>
+ <message>
+ <source>MIN_SIZE</source>
+ <translation>Intervalle des valeurs pour la taille min. (%) : </translation>
+ </message>
+ <message>
+ <source>OUTSIDE_SIZE</source>
+ <translation>Pourcentage de la taille normale (%) : </translation>
+ </message>
+ <message>
+ <source>SIZE_TITLE</source>
+ <translation>Taille</translation>
+ </message>
+ <message>
+ <source>UNIFORM_COLOR</source>
+ <translation>Couleur uniforme</translation>
+ </message>
+</context>
+<context>
+ <name>VISU_TableDlg</name>
+ <message>
+ <source>ERR_TABLE_NOT_AVAILABLE</source>
+ <translation>La table n'est pas disponible</translation>
+ </message>
+ <message>
+ <source>TABLE_OF_INTEGER_TLT</source>
+ <translation>Table d'entiers</translation>
+ </message>
+ <message>
+ <source>TABLE_OF_REAL_TLT</source>
+ <translation>Table de réels</translation>
+ </message>
+ <message>
+ <source>TABLE_UNKNOWN_TLT</source>
+ <translation>Table d'inconnus</translation>
+ </message>
+ <message>
+ <source>VIEW_TABLE_TLT</source>
+ <translation>Montrer la table</translation>
+ </message>
+ <message>
+ <source>ALLOW_EDIT_CHECK</source>
+ <translation>Permettre l'édition</translation>
+ </message>
+ <message>
+ <source>DO_UPDATE_CHECK</source>
+ <translation>Mise à jour immédiate</translation>
+ </message>
+ <message>
+ <source>ADD_COLUMN_BTN</source>
+ <translation>Ajouter une colonne</translation>
+ </message>
+ <message>
+ <source>ADD_ROW_BTN</source>
+ <translation>Ajouter une ligne</translation>
+ </message>
+ <message>
+ <source>ADJUST_CELLS_BTN</source>
+ <translation>Ajuster les cellules</translation>
+ </message>
+ <message>
+ <source>CLEAR_BTN</source>
+ <translation>Nettoyer</translation>
+ </message>
+ <message>
+ <source>REMOVE_COLUMN_BTN</source>
+ <translation>Supprimer la colonne</translation>
+ </message>
+ <message>
+ <source>REMOVE_ROW_BTN</source>
+ <translation>Supprimer la ligne</translation>
+ </message>
+ <message>
+ <source>SELECT_ALL_BTN</source>
+ <translation>Tout sélectionner</translation>
+ </message>
+ <message>
+ <source>SET_TITLE_TLT</source>
+ <translation>Définir le titre</translation>
+ </message>
+ <message>
+ <source>TITLE_LBL</source>
+ <translation>Titre:</translation>
+ </message>
+ <message>
+ <source>UNITS_TLT</source>
+ <translation>Unités</translation>
+ </message>
+</context>
+</TS>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI.cxx
// Author :
// Module : VISU
+#include <Standard_math.hxx> // E.A. must be included before Python.h to fix compilation on windows
+#ifdef HAVE_FINITE
+#undef HAVE_FINITE // VSR: avoid compilation warning on Linux : "HAVE_FINITE" redefined
+#endif
+#include "Python.h"
+
#include "VisuGUI.h"
// STL Includes
#include "SVTK_Functor.h"
//#include "SVTK_MainWindow.h"
+#include "VTKViewer_Algorithm.h"
+#include "VTKViewer_MarkerDlg.h"
+
#include "SPlot2d_ViewModel.h"
#include "VisuGUI_SetupPlot2dDlg.h"
#include "Plot2d_SetupCurveDlg.h"
#include "Plot2d_ViewManager.h"
+#include "Plot2d_SetupCurveScaleDlg.h"
#include "QtxPagePrefMgr.h"
#include "OB_Browser.h"
#include "SalomeApp_Application.h"
#include "SalomeApp_DataModel.h"
#include "SalomeApp_Study.h"
+#include "SalomeApp_DataObject.h"
#include "SalomeApp_CheckFileDlg.h"
#include "LightApp_SelectionMgr.h"
#include "VisuGUI_CursorDlg.h"
#include "VisuGUI_Selection.h"
#include "VisuGUI_TimeAnimation.h"
+#include "VisuGUI_EvolutionDlg.h"
#include "VisuGUI_EditContainerDlg.h"
#include "VisuGUI_ClippingDlg.h"
#include "VisuGUI_Plot3DDlg.h"
#include "VisuGUI_Displayer.h"
#include "VisuGUI_BuildProgressDlg.h"
#include "VisuGUI_TransparencyDlg.h"
-#include "VisuGUI_CacheDlg.h"
+#include "VisuGUI_ShrinkFactorDlg.h"
+//#include "VisuGUI_CacheDlg.h"
#include "VisuGUI_Table3dDlg.h"
#include "VisuGUI_ClippingPanel.h"
#include "VisuGUI_FilterScalarsDlg.h"
#include "VISU_CutLines_i.hh"
#include "VisuGUI_CutLinesDlg.h"
+#include "VISU_CutSegment_i.hh"
+#include "VisuGUI_CutSegmentDlg.h"
+
#include "VISU_StreamLines_i.hh"
#include "VisuGUI_StreamLinesDlg.h"
#include "VISU_Vectors_i.hh"
#include "VisuGUI_VectorsDlg.h"
-#include "VisuGUI_TableDlg.h"
+#include "VISU_TableDlg.h"
#include "VisuGUI_FileInfoDlg.h"
#include "SALOMEconfig.h"
#include "VisuGUI_Sweep.h"
#include <VISU_ScalarMapAct.h>
#include <VISU_GaussPtsAct.h>
-#include <VisuGUI_ValuesLabelingDlg.h>
+#include "VisuGUI_ValuesLabelingDlg.h"
using namespace VISU;
VisuGUI
::VisuGUI():
SalomeApp_Module( "VISU" ),
+ LightApp_Module("VISU"),
myDisplayer( 0 ),
mySlider( NULL ),
mySweep( NULL )
VisuGUI
::~VisuGUI()
{
+ if( myDisplayer ) {
+ delete myDisplayer;
+ myDisplayer = 0;
+ }
+
+ if( mySlider ) {
+ delete mySlider;
+ mySlider = 0;
+ }
+
+ if( mySweep ) {
+ delete mySweep;
+ mySweep = 0;
+ }
+}
+
+void
+VisuGUI
+::OnImportFromSauvFile()
+{
+ if(MYDEBUG) MESSAGE("VisuGUI::OnImportFromSauvFile()");
+
+ if ( CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this)) )
+ return;
+
+ SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
+
+ // Get file name(s)
+ QStringList aFilter;
+ aFilter.append( tr( "FLT_SAUV_FILES" ) );
+ aFilter.append( tr( "FLT_ALL_FILES" ) );
+
+ bool toUseBuildProgress = aResourceMgr->booleanValue("VISU", "use_build_progress", false);
+
+ SalomeApp_CheckFileDlg fd( GetDesktop(this), true, tr("USE_BUILD_PROGRESS") );
+ fd.setWindowTitle( tr( "IMPORT_FROM_FILE" ) );
+ fd.setFileMode( SalomeApp_CheckFileDlg::ExistingFiles );
+ fd.setFilters( aFilter );
+ fd.SetChecked( toUseBuildProgress );
+ if ( SalomeApp_CheckFileDlg::getLastVisitedPath().isEmpty() )
+ fd.setDirectory( QDir::currentPath() );
+
+ QStringList fileNames;
+ if ( !fd.exec() )
+ return; // cancelled, return
+
+ fileNames = fd.selectedFiles();
+ toUseBuildProgress = fd.IsChecked();
+
+ if ( fileNames.count() == 0 )
+ return; // nothing selected, return
+
+ SUIT_OverrideCursor wc;
+ QStringList errors;
+
+ for ( QStringList::ConstIterator it = fileNames.begin(); it != fileNames.end(); ++it ) {
+ QFileInfo aFileInfo( *it );
+
+ if ( !aFileInfo.exists() ) {
+ // file not exist
+ errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
+ arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
+ }
+ else {
+ std::string file_in = aFileInfo.filePath().toLatin1().constData();
+ std::string file_tmp = file_in + ".med";
+#ifdef WNT
+ std::string cmd = "%PYTHONBIN% ";
+#else
+ std::string cmd = "python ";
+#endif
+ cmd += "-c \"";
+ cmd += "from medutilities import convert ; convert(r'" + file_in + "', 'GIBI', 'MED', 1, r'" + file_tmp + "')";
+ cmd += "\"";
+ system(cmd.c_str());
+ QString fff(file_tmp.c_str());
+ aFileInfo = fff;
+ try {
+ if ( !toUseBuildProgress ) {
+ // build progress is not used, use build flags from settings
+ 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( tr( "IMPORT_FROM_FILE" ) + " " + aFileInfo.filePath() + " ... " );
+ application()->putInfo( anInfo );
+
+ VISU::Result_var aResult = GetVisuGen( this )->CreateResult( aFileInfo.filePath().toLatin1().constData() );
+
+ if ( CORBA::is_nil( aResult.in() ) ) {
+ errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
+ arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
+ }
+ else {
+ aResult->SetBuildFields( toBuildFields, toBuildMinMax );
+ aResult->SetBuildGroups( toBuildGroups );
+ aResult->Build( toBuildAll, toBuildAtOnce );
+ application()->putInfo( anInfo + tr("INF_DONE") );
+ }
+ } // if ( !toUseBuildProgress )
+ else {
+ // use build progress
+ wc.suspend();
+ VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
+ aBuildProgressDlg->setFileName( aFileInfo.filePath() );
+ aBuildProgressDlg->setGenerator( GetVisuGen(this) );
+ aBuildProgressDlg->exec();
+ wc.resume();
+ }
+ } // try
+ catch(...) {
+ errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
+ }
+ } // else // if ( !aFileInfo.exists() )
+ } // for (...)
+
+ if ( errors.count() > 0 ) {
+ SUIT_MessageBox::critical( GetDesktop(this),
+ tr("ERR_ERROR"),
+ tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
+ }
+ else {
+ UpdateObjBrowser(this);
+ }
}
void
SUIT_OverrideCursor wc;
QStringList errors;
+ QStringList anEntryList;
for ( QStringList::ConstIterator it = fileNames.begin(); it != fileNames.end(); ++it ) {
QFileInfo aFileInfo( *it );
if ( !aFileInfo.exists() ) {
// file not exist
errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
- arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
+ arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
}
else {
try {
- if ( !toUseBuildProgress ) {
- // build progress is not used, use build flags from settings
- 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( tr( "IMPORT_FROM_FILE" ) + " " + aFileInfo.filePath() + " ... " );
- application()->putInfo( anInfo );
-
- VISU::Result_var aResult = GetVisuGen( this )->CreateResult( aFileInfo.filePath().toLatin1().constData() );
-
- if ( CORBA::is_nil( aResult.in() ) ) {
- errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
- arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
- }
- else {
- aResult->SetBuildFields( toBuildFields, toBuildMinMax );
- aResult->SetBuildGroups( toBuildGroups );
- aResult->Build( toBuildAll, toBuildAtOnce );
- application()->putInfo( anInfo + tr("INF_DONE") );
- }
- } // if ( !toUseBuildProgress )
- else {
- // use build progress
- wc.suspend();
- VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
- aBuildProgressDlg->setFileName( aFileInfo.filePath() );
- aBuildProgressDlg->setGenerator( GetVisuGen(this) );
- aBuildProgressDlg->exec();
- wc.resume();
- }
+ if ( !toUseBuildProgress ) {
+ // build progress is not used, use build flags from settings
+ 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( tr( "IMPORT_FROM_FILE" ) + " " + aFileInfo.filePath() + " ... " );
+ application()->putInfo( anInfo );
+
+ VISU::Result_var aResult = GetVisuGen( this )->CreateResult( aFileInfo.filePath().toLatin1().constData() );
+
+ if ( CORBA::is_nil( aResult.in() ) ) {
+ errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
+ arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
+ }
+ else {
+ aResult->SetBuildFields( toBuildFields, toBuildMinMax );
+ aResult->SetBuildGroups( toBuildGroups );
+ aResult->Build( toBuildAll, toBuildAtOnce );
+ if( VISU::Result_i* aCResult = dynamic_cast<VISU::Result_i*>( VISU::GetServant( aResult ).in() ) )
+ anEntryList.append( aCResult->GetEntry().c_str() );
+ application()->putInfo( anInfo + tr("INF_DONE") );
+ }
+ } // if ( !toUseBuildProgress )
+ else {
+ // use build progress
+ wc.suspend();
+ VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
+ aBuildProgressDlg->setFileName( aFileInfo.filePath() );
+ aBuildProgressDlg->setGenerator( GetVisuGen(this) );
+ aBuildProgressDlg->exec();
+ wc.resume();
+ }
} // try
catch(...) {
- errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
+ errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
}
} // else // if ( !aFileInfo.exists() )
} // for (...)
if ( errors.count() > 0 ) {
SUIT_MessageBox::critical( GetDesktop(this),
- tr("ERR_ERROR"),
- tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
+ tr("ERR_ERROR"),
+ tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
}
else {
UpdateObjBrowser(this);
+ if( getApp() )
+ getApp()->browseObjects( anEntryList );
}
}
aFilter.append( tr("FLT_TABLE_FILES") );
aFilter.append( tr("FLT_ALL_FILES") );
- QString anInitialPath = "";
- if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
- anInitialPath = QDir::currentPath();
+ //QString anInitialPath = "";
+ //if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
+ // anInitialPath = QDir::currentPath();
+
+ //QStringList aFiles = SUIT_FileDlg::getOpenFileNames(GetDesktop(this),
+ // anInitialPath,
+ // aFilter,
+ // tr("TLT_IMPORT_TABLE"));
+
+ SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
+ bool aFirstStrAsTitle = aResourceMgr->booleanValue("VISU", "first_str_as_title", false);
+
+ SalomeApp_CheckFileDlg fd( GetDesktop(this), true, tr("FIRST_STR_AS_TITLE") );
+ fd.setWindowTitle( tr( "IMPORT_FROM_FILE" ) );
+ fd.setFileMode( SalomeApp_CheckFileDlg::ExistingFiles );
+ fd.setFilters( aFilter );
+ fd.SetChecked( aFirstStrAsTitle );
+ if ( SalomeApp_CheckFileDlg::getLastVisitedPath().isEmpty() )
+ fd.setDirectory( QDir::currentPath() );
+
+ QStringList aFiles;
+ if ( !fd.exec() )
+ return; // cancelled, return
+ aFiles = fd.selectedFiles();
+ aFirstStrAsTitle = fd.IsChecked();
- QStringList aFiles = SUIT_FileDlg::getOpenFileNames(GetDesktop(this),
- anInitialPath,
- aFilter,
- tr("TLT_IMPORT_TABLE"));
if ( aFiles.count() == 0 )
return; // nothing selected
QStringList errors;
+ QStringList anEntryList;
for ( QStringList::ConstIterator it = aFiles.begin(); it != aFiles.end(); ++it ) {
QFileInfo aFileInfo( *it );
if ( !aFileInfo.exists() ) {
errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
- arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
+ arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
}
else {
try {
- QString anInfo( tr("TLT_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." );
- application()->putInfo( anInfo );
+ QString anInfo( tr("TLT_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." );
+ application()->putInfo( anInfo );
- CORBA::Object_var anObject = GetVisuGen(this)->ImportTables(aFileInfo.filePath().toLatin1().constData());
+ SALOMEDS::SObject_var anObject =
+ GetVisuGen(this)->ImportTables(aFileInfo.filePath().toLatin1().constData(),
+ aFirstStrAsTitle);
- if (CORBA::is_nil(anObject.in())) {
- errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
- arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
- }
- else {
- application()->putInfo( anInfo + tr("INF_DONE") );
- }
+ if (CORBA::is_nil(anObject.in())) {
+ errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
+ arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
+ }
+ else {
+ anEntryList.append( anObject->GetID() );
+ application()->putInfo( anInfo + tr("INF_DONE") );
+ }
}
catch(...) {
- errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
+ errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNSUPPORTED_FILE_FORMAT" ) ) );
}
}
}
if ( errors.count() > 0 ) {
SUIT_MessageBox::critical( GetDesktop(this),
- tr("ERR_ERROR"),
- tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
+ tr("ERR_ERROR"),
+ tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
}
else {
UpdateObjBrowser(this);
+ if( getApp() )
+ getApp()->browseObjects( anEntryList );
}
}
if (!aTabAttr) return;
aTitle = aTabAttr->GetTitle().c_str();
} else {
- _PTR(AttributeTableOfInteger) aTabAttr (anAttr);
- if (!aTabAttr) return;
+ _PTR(AttributeTableOfInteger) aTabAttr (anAttr);
+ if (!aTabAttr) return;
aTitle = aTabAttr->GetTitle().c_str();
}
aTitle.simplified();
// get name for the file
QStringList aFilter;
- aFilter.append("Table Files (*.xls)");
+ aFilter.append("Table Files (*.txt *.tab)");
+ aFilter.append("CSV Table Files (*.csv)");
QFileInfo aFileInfo =
SUIT_FileDlg::getFileName(GetDesktop(this),
QString aFile = aFileInfo.filePath();
if (!aFile.isEmpty()) {
application()->putInfo(tr("MEN_EXPORT_TABLE") + " " + aFile + " ...");
- aDir = Qtx::dir(aFile, true);
+ aDir = Qtx::dir(aFile, true);
aResourceMgr->setValue("VISU", "OutputDir", aDir);
- try {
- GetVisuGen(this)->ExportTableToFile(GetSObject(aSObj), (const char*)aFile.toLatin1());
+ try {
+ GetVisuGen(this)->ExportTableToFile(GetSObject(aSObj), (const char*)aFile.toLatin1());
application()->putInfo(aFile + " " + tr("INF_DONE"));
- } catch(std::exception& exc) {
- INFOS(exc.what());
- SUIT_MessageBox::warning(GetDesktop(this),
+ } catch(std::exception& exc) {
+ INFOS(exc.what());
+ SUIT_MessageBox::warning(GetDesktop(this),
tr("WRN_VISU"),
- tr("ERR_ERROR_DURING_EXPORT") + " " + tr(exc.what()) );
+ tr("ERR_ERROR_DURING_EXPORT") + " " + tr(exc.what()) );
- } catch(...) {
- INFOS((const char*)tr("ERR_ERROR_DURING_EXPORT").toLatin1());
- SUIT_MessageBox::warning( GetDesktop(this),
+ } catch(...) {
+ INFOS((const char*)tr("ERR_ERROR_DURING_EXPORT").toLatin1());
+ SUIT_MessageBox::warning( GetDesktop(this),
tr("WRN_VISU"),
- tr("ERR_ERROR_DURING_EXPORT") );
+ tr("ERR_ERROR_DURING_EXPORT") );
- }
+ }
}
}
}
SALOME_ListIO aListIO;
aSelectionMgr->selectedObjects(aListIO);
+ QStringList anEntryList;
SALOME_ListIteratorOfListIO It (aListIO);
QApplication::setOverrideCursor(Qt::WaitCursor);
for (; It.More(); It.Next()) {
}
}
+ VISU::Result_var aResult;
CORBA::Object_var anObject = VISU::SObjectToObject(aSObject);
if (!CORBA::is_nil(anObject)) {
SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
if (!CORBA::is_nil(aMED.in()))
- GetVisuGen(this)->ImportMed(aSObject);
+ aResult = GetVisuGen(this)->ImportMed(aSObject);
SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject);
if (!CORBA::is_nil(aField.in()))
- GetVisuGen(this)->ImportMedField(aField);
+ aResult = GetVisuGen(this)->ImportMedField(aField);
} else {
SALOMEDS::SObject_var aSFather = aSObject->GetFather();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
CORBA::String_var aValue = aName->Value();
if (strcmp(aValue.in(), "MEDFIELD") == 0)
- GetVisuGen(this)->ImportMed(aSObject);
+ aResult = GetVisuGen(this)->ImportMed(aSObject);
}
+
+ if( !CORBA::is_nil( aResult ) )
+ if( VISU::Result_i* aCResult = dynamic_cast<VISU::Result_i*>( VISU::GetServant( aResult ).in() ) )
+ anEntryList.append( aCResult->GetEntry().c_str() );
}
}
UpdateObjBrowser(this, true);
+ if( getApp() )
+ getApp()->browseObjects( anEntryList );
QApplication::restoreOverrideCursor();
}
void
CreateCurves( SalomeApp_Module* theModule,
- VISU::CutLines_i* thePrs,
+ VISU::CutLinesBase_i* thePrs,
QDialog* theDlg,
const bool theCreate = true )
{
if ( !thePrs )
return;
- VisuGUI_CutLinesDlg* aCutDlg = dynamic_cast<VisuGUI_CutLinesDlg*>( theDlg );
- if ( !aCutDlg )
+
+ // temporary code, to be revised (VisuGUI_CutLinesDlg and VisuGUI_CutSegmentDlg classes
+ // should have common intermediate interface with at least two methods called below)
+ bool isGenerateTable = false;
+ bool isGenerateCurves = false;
+ if ( VisuGUI_CutLinesDlg* aCutDlg = dynamic_cast<VisuGUI_CutLinesDlg*>( theDlg ) ) {
+ isGenerateTable = aCutDlg->isGenerateTable();
+ isGenerateCurves = aCutDlg->isGenerateCurves();
+ }
+ else if ( VisuGUI_CutSegmentDlg* aCutDlg = dynamic_cast<VisuGUI_CutSegmentDlg*>( theDlg ) ) {
+ isGenerateTable = aCutDlg->isGenerateTable();
+ isGenerateCurves = aCutDlg->isGenerateCurves();
+ }
+ else
return;
_PTR(Study) aStudy = GetCStudy( GetAppStudy( theModule ) );
if( aTblObj ) {
_PTR(GenericAttribute) anAttr;
if (aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
- _PTR(ChildIterator) aChildIter = aStudy->NewChildIterator( aTblObj );
- SalomeApp_Study* salome_study = GetAppStudy( theModule );
- for( aChildIter->InitEx( false ); aChildIter->More(); aChildIter->Next() ){
- salome_study->deleteReferencesTo( aChildIter->Value() );
- _PTR(SObject) aSO = aChildIter->Value();
- if(aSO){
- Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aSO);
- if (aRestoringMap["myComment"] == "CURVE") {
- CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSO);
- if(!CORBA::is_nil(aCORBAObject)){
- PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
- if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aServant.in())){
- PlotRemoveCurve(theModule, aCurve);
- }
- }
- }
- }
+ _PTR(ChildIterator) aChildIter = aStudy->NewChildIterator( aTblObj );
+ SalomeApp_Study* salome_study = GetAppStudy( theModule );
+ for( aChildIter->InitEx( false ); aChildIter->More(); aChildIter->Next() ){
+ salome_study->deleteReferencesTo( aChildIter->Value() );
+ _PTR(SObject) aSO = aChildIter->Value();
+ if(aSO){
+ Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aSO);
+ if (aRestoringMap["myComment"] == "CURVE") {
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSO);
+ if(!CORBA::is_nil(aCORBAObject)){
+ PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aServant.in())){
+ PlotRemoveCurve(theModule, aCurve);
+ }
+ }
+ }
+ }
- }
+ }
aBuilder->RemoveObjectWithChildren( aTblObj ); // We should have only one child
- //UpdateObjBrowser(theModule,true,aTblObj);
+ //UpdateObjBrowser(theModule,true,aTblObj);
break;
}
}
}
}
- if ( aCutDlg->isGenerateTable() ) {
+ if ( isGenerateTable ) {
GetVisuGen( theModule )->CreateTable( thePrs->GetEntry().c_str() );
- if ( aCutDlg->isGenerateCurves() ) {
+ if ( isGenerateCurves ) {
if ( aSObject ) {
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
_PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject);
// create mesh presentation and display it in aViewWindow
VISU::Mesh_i* aPrs = CreateMesh(this, anIO, aViewWindow);
aViewWindow->highlight(anIO, 1);
- if (aPrs)
- emit presentationCreated(aPrs);
+ processPresentationCreated(aPrs);
}
void
// create mesh presentation and display it in aViewWindow
VISU::Mesh_i* aPrs = CreateMesh(this, anIO, aViewWindow);
aViewWindow->highlight(anIO, 1);
- if (aPrs)
- emit presentationCreated(aPrs);
+ processPresentationCreated(aPrs);
}
}
::OnCreateScalarMap()
{
Prs3d_i* aPrs = CreatePrs3d<VISU::ScalarMap_i,VisuGUI_ScalarBarDlg,1>(this);
- if (aPrs)
- emit presentationCreated(aPrs);
+ processPresentationCreated(aPrs);
}
::OnCreateDeformedShape()
{
Prs3d_i* aPrs = CreatePrs3d<VISU::DeformedShape_i,VisuGUI_DeformedShapeDlg,1>(this);
- if (aPrs)
- emit presentationCreated(aPrs);
+ processPresentationCreated(aPrs);
}
void
::OnCreateDeformedShapeAndScalarMap()
{
Prs3d_i* aPrs = CreatePrs3d<VISU::DeformedShapeAndScalarMap_i,VisuGUI_DeformedShapeAndScalarMapDlg,1>(this);
- if (aPrs)
- emit presentationCreated(aPrs);
+ processPresentationCreated(aPrs);
}
void
::OnCreateVectors()
{
Prs3d_i* aPrs = CreatePrs3d<VISU::Vectors_i,VisuGUI_VectorsDlg,1>(this);
- if (aPrs)
- emit presentationCreated(aPrs);
+ processPresentationCreated(aPrs);
}
void
::OnCreateIsoSurfaces()
{
Prs3d_i* aPrs = CreatePrs3d<VISU::IsoSurfaces_i,VisuGUI_IsoSurfacesDlg,1>(this);
- if (aPrs)
- emit presentationCreated(aPrs);
+ processPresentationCreated(aPrs);
}
void
::OnCreateCutPlanes()
{
Prs3d_i* aPrs = CreatePrs3d<VISU::CutPlanes_i,VisuGUI_CutPlanesDlg,0>(this);
- if (aPrs)
- emit presentationCreated(aPrs);
+ processPresentationCreated(aPrs);
}
void
::OnCreateCutLines()
{
Prs3d_i* aPrs = CreatePrs3d<VISU::CutLines_i,VisuGUI_CutLinesDlg,0>(this);
- if (aPrs)
- emit presentationCreated(aPrs);
+ processPresentationCreated(aPrs);
+}
+
+void
+VisuGUI
+::OnCreateCutSegment()
+{
+ Prs3d_i* aPrs = CreatePrs3d<VISU::CutSegment_i,VisuGUI_CutSegmentDlg,0>(this);
+ processPresentationCreated(aPrs);
}
void
::OnCreateStreamLines()
{
Prs3d_i* aPrs = CreatePrs3d<VISU::StreamLines_i,VisuGUI_StreamLinesDlg,1>(this);
- if (aPrs)
- emit presentationCreated(aPrs);
+ processPresentationCreated(aPrs);
}
void
::OnCreatePlot3D()
{
Prs3d_i* aPrs = CreatePrs3d<VISU::Plot3D_i,VisuGUI_Plot3DDlg,0>(this);
- if (aPrs)
- emit presentationCreated(aPrs);
+ processPresentationCreated(aPrs);
}
void
::OnCreatePlot2dView()
{
CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this));
- GetVisuGen( this )->CreateContainer();
+ VISU::Container_var aContainer = GetVisuGen( this )->CreateContainer();
UpdateObjBrowser(this);
+
+ if( !CORBA::is_nil( aContainer.in() ) ) {
+ if( VISU::Container_i* aCContainer = dynamic_cast<VISU::Container_i*>( VISU::GetServant( aContainer ).in() ) ) {
+ QStringList anEntryList;
+ anEntryList.append( aCContainer->GetEntry().c_str() );
+ if( getApp() )
+ getApp()->browseObjects( anEntryList );
+ }
+ }
}
void
switch (aType) {
case VISU::TPOINTMAP3D:
if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
- displayer()->Display(anIO->getEntry());
- aViewWindow->highlight(anIO, 1);
- aViewWindow->getRenderer()->ResetCameraClippingRange();
- aViewWindow->Repaint();
- break;
+ displayer()->Display(anIO->getEntry());
+ aViewWindow->highlight(anIO, 1);
+ aViewWindow->getRenderer()->ResetCameraClippingRange();
+ aViewWindow->Repaint();
+ break;
}
else {
- if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false))
- aPlot2d->Repaint();
- displayer()->Display(anIO->getEntry());
+ if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false))
+ aPlot2d->Repaint();
+ displayer()->Display(anIO->getEntry());
}
case VISU::TCURVE:
case VISU::TCONTAINER:
case VISU::TTABLE:
+ getViewManager(SPlot2d_Viewer::Type(), true);
displayer()->Display(anIO->getEntry());
+ aSelectionMgr->setSelectedObjects(aList);
break;
default: {
VISU::Prs3d_i* aPrs3d = VISU::GetPrs3dFromBase(aBase);
if(aPrs3d){
- if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
- displayer()->Display(anIO->getEntry());
- aViewWindow->highlight(anIO, 1);
- aViewWindow->getRenderer()->ResetCameraClippingRange();
- aViewWindow->Repaint();
- }
+ if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
+ displayer()->Display(anIO->getEntry());
+ aViewWindow->highlight(anIO, 1);
+ aViewWindow->getRenderer()->ResetCameraClippingRange();
+ aViewWindow->Repaint();
+ }
}
}
}
LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
if (!aSelectionMgr)
return;
-
+
SALOME_ListIO aSel, aList;
aSelectionMgr->selectedObjects(aSel);
extractContainers(aSel, aList);
case VISU::TTABLE: {
// Activate Plot2d
GetPlot2dViewer(this, true);
+ break;
}
case VISU::TCOLOREDPRS3DHOLDER :
case VISU::TPOINTMAP3D : {
aChild = anIter->Value();
CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aChild);
if(!CORBA::is_nil(aCORBAObject)){
- PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
- if( dynamic_cast<VISU::Curve_i*>(aServant.in()))
- hasCurvesChildren = true;
+ PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+ if( dynamic_cast<VISU::Curve_i*>(aServant.in()))
+ hasCurvesChildren = true;
}
}
if (hasCurvesChildren && ( aViewerType == SPlot2d_Viewer::Type() || aViewerType == SVTK_Viewer::Type() ) ) {
return;
} else {
- // activate SVTK Viewer
+ // activate SVTK Viewer
getApp()->getViewManager( SVTK_Viewer::Type(), true );
return;
}
vw->unHighlightAll();
if (vtkRenderer *aRen = vw->getRenderer()) {
vtkActor *anActor;
- vtkActorCollection *anActColl = aRen->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRen->GetActors());
+ vtkActorCollection *anActColl = aCopy.GetActors();
for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
if (anActor->GetVisibility() > 0)
if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
- RemoveScalarBarPosition(this, vw, anVISUActor->GetPrs3d());
+ RemoveScalarBarPosition(this, vw, anVISUActor->GetPrs3d());
anVISUActor->VisibilityOff();
}
}
//----------------------------------------------------------------------------
VISU::Prs3d_i*
GetPrsToModify(const SalomeApp_Module* theModule,
- Handle(SALOME_InteractiveObject)& theIO)
+ Handle(SALOME_InteractiveObject)& theIO)
{
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
if(aSelectionInfo.empty())
EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg, 0>(this, anIO, aPrs3d);
}
+//----------------------------------------------------------------------------
+void
+VisuGUI
+::OnEditCutSegment()
+{
+ Handle(SALOME_InteractiveObject) anIO;
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
+ EditPrs3d<VISU::CutSegment_i, VisuGUI_CutSegmentDlg, 0>(this, anIO, aPrs3d);
+}
+
//----------------------------------------------------------------------------
void
VisuGUI
break;
case VISU::WIREFRAME :
case VISU::INSIDEFRAME :
+ case VISU::FEATURE_EDGES :
anOldColor = aMesh->GetLinkColor();
break;
case VISU::SHADED :
break;
case VISU::SHADED :
case VISU::SURFACEFRAME :
+ case VISU::FEATURE_EDGES :
aMesh->SetCellColor(aNewColor);
break;
}
return;
VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d);
- if(!aMesh)
+ VISU::ScalarMap_i* aScalarMap = dynamic_cast<VISU::ScalarMap_i*>(aPrs3d);
+ if(!aMesh && !aScalarMap)
return;
- SALOMEDS::Color anOldColor = aMesh->GetLinkColor(), aNewColor;
+ SALOMEDS::Color anOldColor, aNewColor;
+ if (aMesh)
+ anOldColor = aMesh->GetLinkColor();
+ else if (aScalarMap)
+ anOldColor = aScalarMap->GetLinkColor();
+
+
QColor aColor (int(255*anOldColor.R),
- int(255*anOldColor.G),
- int(255*anOldColor.B));
+ int(255*anOldColor.G),
+ int(255*anOldColor.B));
QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this));
if (aColorNew.isValid()) {
aNewColor.R = aColorNew.red()/255.;
aNewColor.G = aColorNew.green()/255.;
aNewColor.B = aColorNew.blue()/255.;
- aMesh->SetLinkColor(aNewColor);
- RecreateActor(this, aMesh);
+ if (aMesh)
+ aMesh->SetLinkColor(aNewColor);
+ else
+ aScalarMap->SetLinkColor(aNewColor);
+ RecreateActor(this, aPrs3d);
}
}
VISU_ActorBase* anActorBase = NULL;
VISU::Prs3d_i* aPrs3d = NULL;
SVTK_ViewWindow* aViewWindow = NULL;
- float oldlwid;
+ float oldlwid = 1;
bool isPrs3d = false;
if (GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor)) {
isPrs3d = true;
+ oldlwid = anActor->GetLineWidth();
}
else {
aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this);
VisuGUI_CursorDlg* CursorDlg =
new VisuGUI_CursorDlg (GetDesktop(this), (const char*)tr("DLG_LINEWIDTH_TITLE").toLatin1(), TRUE);
- CursorDlg->helpFileName = "viewing_3d_presentations_intro_page.html#width_opacity_anchor";
+ CursorDlg->helpFileName = "viewing_3d_presentations_page.html#width_opacity_anchor";
CursorDlg->Comment1->setText(tr("DLG_LINEWIDTH_CMT1"));
CursorDlg->Comment2->setText(tr("DLG_LINEWIDTH_CMT2"));
CursorDlg->SpinBox1->setMinimum(1);
delete CursorDlg;
}
+//----------------------------------------------------------------------------
+void
+VisuGUI
+::OnChangePointMarker()
+{
+ SALOME_ListIO aListIO;
+ GetSelectionMgr( this )->selectedObjects( aListIO );
+ if( aListIO.Extent() < 1 )
+ return;
+
+ VISU::StudyId2MarkerMap& aMarkerMap = GetVisuGen( this )->GetMarkerMap();
+ _PTR(Study) aCStudy = GetCStudy( GetAppStudy( this ) );
+ int aStudyId = aCStudy->StudyId();
+
+ QPixmap aPointSpritePixmap;
+ if( SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr() )
+ aPointSpritePixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_POINT_SPRITE" ) );
+
+ bool update = false;
+ for( SALOME_ListIteratorOfListIO It( aListIO ); It.More(); It.Next() )
+ {
+ Handle(SALOME_InteractiveObject)& anIO = It.Value();
+ std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList( this, anIO );
+ for( int i = 0, n = aPrsList.size(); i < n; i++ )
+ {
+ if( VISU::Prs3d_i* aPrs = aPrsList[i] )
+ {
+ VTKViewer_MarkerDlg* aDlg = new VTKViewer_MarkerDlg( GetDesktop( this ) );
+ aDlg->setHelpData( "VISU", "point_marker_page.html" );
+
+ aDlg->setCustomMarkerMap( aMarkerMap[ aStudyId ] );
+
+ aDlg->addExtraStdMarker( VTK::MT_POINT_SPRITE, aPointSpritePixmap );
+
+ VISU::MarkerType aMarkerTypeCurrent = aPrs->GetMarkerType();
+ VISU::MarkerScale aMarkerScaleCurrent = aPrs->GetMarkerScale();
+ int aMarkerTextureCurrent = aPrs->GetMarkerTexture();
+ if( aMarkerTypeCurrent != VISU::MT_USER )
+ aDlg->setStandardMarker( (VTK::MarkerType)aMarkerTypeCurrent, (VTK::MarkerScale)aMarkerScaleCurrent );
+ else
+ aDlg->setCustomMarker( aMarkerTextureCurrent );
+
+ if( aDlg->exec() )
+ {
+ aMarkerMap[ aStudyId ] = aDlg->getCustomMarkerMap();
+
+ VISU::MarkerType aMarkerTypeNew = (VISU::MarkerType)aDlg->getMarkerType();
+ VISU::MarkerScale aMarkerScaleNew = (VISU::MarkerScale)aDlg->getStandardMarkerScale();
+ int aMarkerTextureNew = aDlg->getCustomMarkerID();
+ if( aMarkerTypeNew != VISU::MT_USER )
+ aPrs->SetMarkerStd( aMarkerTypeNew, aMarkerScaleNew );
+ else
+ aPrs->SetMarkerTexture( aMarkerTextureNew );
+
+ aPrs->UpdateActors();
+ update = true;
+ }
+
+ delete aDlg;
+ }
+ }
+ }
+
+ if( update )
+ if( SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>( this ) )
+ vw->Repaint();
+}
+
+//----------------------------------------------------------------------------
+void
+VisuGUI
+::OnChangeShrinkFactor()
+{
+ VisuGUI_ShrinkFactorDlg* aDialog = new VisuGUI_ShrinkFactorDlg( this );
+ aDialog->show();
+}
+
//----------------------------------------------------------------------------
void
VisuGUI
Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
_PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
- if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase))
+ if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase)) {
aSObject = GetCStudy( GetAppStudy( this ) )->FindObjectID( aTable->GetObjectEntry() );
-
- if( !IsSObjectTable( aSObject ) )
- return;
-
- VisuGUI_TableDlg* dlg = new VisuGUI_TableDlg( GetDesktop( this ),
- aSObject,
- false,
- //SAL2670 Orientation of show tables
- VisuGUI_TableDlg::ttAuto,
- Qt::Vertical );
- dlg->show();
+ if( IsSObjectTable( aSObject ) ) {
+ VISU_TableDlg* dlg = new VISU_TableDlg( GetDesktop( this ),
+ GetCStudy( GetAppStudy( this ) ),
+ aTable,
+ false,
+ //SAL2670 Orientation of show tables
+ VISU_TableDlg::ttAuto,
+ Qt::Vertical );
+ dlg->show();
+ }
+ }
}
//----------------------------------------------------------------------------
VisuGUI
::SetScalarBarVisibility(bool theVisibility)
{
- printf ("\nOnHideScalarBar");
LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
SALOME_ListIO aListIO;
aSelectionMgr->selectedObjects(aListIO);
bool update = false;
for (; It.More(); It.Next()) {
Handle(SALOME_InteractiveObject)& anIO = It.Value();
- std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
- if (!aPrsList.empty()) {
+ std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO, true);
+ if ( aPrsList.size()>0 ) {
for (int i = 0, n = aPrsList.size(); i < n; i++) {
VISU::Prs3d_i* aPrsObject = aPrsList[i];
if (aPrsObject) {
- VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
- if (aScalar) {
+ if (VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject)) {
aScalar->SetBarVisible( theVisibility );
RecreateActor(this, aScalar);
update = true;
+ } else if (VISU::GaussPoints_i* aGauss = dynamic_cast<VISU::GaussPoints_i*>(aPrsObject)) {
+ aGauss->SetBarVisible( theVisibility );
+ RecreateActor(this, aGauss);
+ update = true;
}
}
}
_PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
- if((aBase && aBase->GetType() == VISU::TCUTLINES) || IsSObjectTable(aSObject)) {
+ if(aBase &&
+ (aBase->GetType() == VISU::TCUTLINES || aBase->GetType() == VISU::TCUTSEGMENT) ||
+ IsSObjectTable(aSObject)) {
GetVisuGen( this )->CreateTable( aSObject->GetID().c_str() );
UpdateObjBrowser(this);
}
anIO = it.Value();
if (anIO->hasEntry()) {
if (IsRemovable(anIO->getEntry(), this)) {
- aNameList.append("\n - ");
- // Get Name Of the Main Object if it's a referenced object
- VISU::TObjectInfo anObjectInfo = GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
- if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
- _PTR(SObject) aRefSObject;
- if (aSObject->ReferencedObject(aRefSObject)) {
- QString aRefName = QString::fromStdString ( aRefSObject->GetName() );
- aNameList.append( aRefName );
- }
- else
- aNameList.append(anIO->getName());
- }
- anEntries[i++] = anIO->getEntry();
+ aNameList.append("\n - ");
+ // Get Name Of the Main Object if it's a referenced object
+ VISU::TObjectInfo anObjectInfo = GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
+ if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
+ _PTR(SObject) aRefSObject;
+ if (aSObject->ReferencedObject(aRefSObject)) {
+ QString aRefName = QString::fromStdString ( aRefSObject->GetName() );
+ aNameList.append( aRefName );
+ }
+ else
+ aNameList.append(anIO->getName());
+ }
+ anEntries[i++] = anIO->getEntry();
}
}
}
nbSelected = i;
if (nbSelected < 1) {
SUIT_MessageBox::warning(GetDesktop(this),
- QObject::tr("WRN_VISU"),
- QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
+ QObject::tr("WRN_VISU"),
+ QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
return;
}
if ( SUIT_MessageBox::question( GetDesktop(this),
- QObject::tr( "WRN_VISU" ),
- QObject::tr( "VISU_REALLY_DELETE" ).arg( nbSelected ).arg( aNameList ),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No ) != SUIT_MessageBox::Yes )
+ QObject::tr( "WRN_VISU" ),
+ QObject::tr( "VISU_REALLY_DELETE" ).arg( nbSelected ).arg( aNameList ),
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No ) != SUIT_MessageBox::Yes )
return;
// There is a transaction
emit beforeObjectDelete(QString(aSObject->GetID().c_str()));
_PTR(SObject) aRefSObject;
if (aSObject->ReferencedObject(aRefSObject)) {
- // It can be a reference on curve, published under a container.
- // In this case the curve should be removed from the container.
- // See bug 10441.
- VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(this), aRefSObject->GetID());
- VISU::Base_i* aRefBase = aRefObjectInfo.myBase;
- if(aRefBase && aRefBase->GetType() == VISU::TMESH){
- DeleteSObject(this, aCStudy, aRefSObject);
- UpdateObjBrowser(this, true, aRefSObject);
- }else if(aRefBase && aRefBase->GetType() == VISU::TCURVE){
- CORBA::Object_var anObject = ClientSObjectToObject(aRefSObject);
- VISU::Curve_var aCurve = VISU::Curve::_narrow(anObject);
- _PTR(SObject) aParentSO = aSObject->GetFather();
- VISU::TObjectInfo aParentObjectInfo = GetObjectByEntry(GetAppStudy(this), aParentSO->GetID());
- if(VISU::Base_i* aParentBase = aParentObjectInfo.myBase){
- if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aParentBase)){
- if(aContainer->GetNbCurves() > 0){
- aContainer->RemoveCurve(aCurve);
- UpdateObjBrowser(this, true, aParentSO);
- }
- }
- }
- }
+ // It can be a reference on curve, published under a container.
+ // In this case the curve should be removed from the container.
+ // See bug 10441.
+ VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(this), aRefSObject->GetID());
+ VISU::Base_i* aRefBase = aRefObjectInfo.myBase;
+ if(aRefBase && aRefBase->GetType() == VISU::TMESH){
+ DeleteSObject(this, aCStudy, aRefSObject);
+ UpdateObjBrowser(this, true, aRefSObject);
+ }else if(aRefBase && aRefBase->GetType() == VISU::TCURVE){
+ CORBA::Object_var anObject = ClientSObjectToObject(aRefSObject);
+ VISU::Curve_var aCurve = VISU::Curve::_narrow(anObject);
+ _PTR(SObject) aParentSO = aSObject->GetFather();
+ VISU::TObjectInfo aParentObjectInfo = GetObjectByEntry(GetAppStudy(this), aParentSO->GetID());
+ if(VISU::Base_i* aParentBase = aParentObjectInfo.myBase){
+ if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aParentBase)){
+ if(aContainer->GetNbCurves() > 0){
+ aContainer->RemoveCurve(aCurve);
+ UpdateObjBrowser(this, true, aParentSO);
+ }
+ }
+ }
+ }
}
else{
- DeleteSObject(this, aCStudy, aSObject);
- UpdateObjBrowser(this, true, aSObject);
+ DeleteSObject(this, aCStudy, aSObject);
+ UpdateObjBrowser(this, true, aSObject);
}
}
}
if(VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase){
if(aBase->GetType() == VISU::TTABLE || aBase->GetType() == VISU::TPOINTMAP3D) {
if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase)){
- _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
- _PTR(SObject) aSObject = aStudy->FindObjectID( aTable->GetObjectEntry() );
- if(IsSObjectTable(aSObject)){
- VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, GetDesktop(this));
- if(aDlg->exec() == QDialog::Accepted){
- if(!IsStudyLocked(aStudy)){
- // if study is not locked - create new container, create curves and insert them
- // into container, then plot container if current viewer is of VIEW_PLOT2D type
- int horIndex;
- QList<int> verIndices, zIndices;
- aDlg->getCurvesSource( horIndex, verIndices, zIndices );
- if( horIndex >= 0 && verIndices.count() > 0 ){
- CORBA::Object_var aContainerObj = GetVisuGen(this)->CreateContainer();
- if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObj).in())){
- for( int i = 0; i < verIndices.count(); i++ ){
- VISU::Curve_var aCurveObject =
- GetVisuGen(this)->CreateCurveWithZ(aTable->_this(), horIndex+1, verIndices[i]+1, zIndices[i]+1 );
- if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
- bool isAuto;
- int marker, line, lineWidth;
- QColor color;
- if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
- line, lineWidth, color) && !isAuto )
- {
- SALOMEDS::Color c;
- c.R = color.red() /255.;
- c.G = color.green()/255.;
- c.B = color.blue() /255.;
- aCurve->SetColor( c );
- aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
- aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
- }
- aContainer->AddCurve(aCurveObject);
- }
- }
- UpdateObjBrowser(this);
- PlotContainer( this, aContainer, VISU::eDisplay );
- }
- }
- } else {
- // get name of SObject
- QString aSObjectName;
- _PTR(GenericAttribute) anAttr;
- if(aSObject->FindAttribute( anAttr, "AttributeName" )){
- _PTR(AttributeName) aName = anAttr;
- aSObjectName = QString( aName->Value().c_str() );
- }
- // if study is locked just get curves info and plot them
- // if current viewer is of VIEW_PLOT2D type
- QList<Plot2d_Curve*> container;
- aDlg->getCurves( container );
- if ( !container.isEmpty() ) {
- GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
- GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( aSObjectName );
- }
- }
- }
- delete aDlg;
- }
+ _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
+ _PTR(SObject) aSObject = aStudy->FindObjectID( aTable->GetObjectEntry() );
+ if(IsSObjectTable(aSObject)){
+ VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, aTable ,GetDesktop(this));
+ if(aDlg->exec() == QDialog::Accepted){
+ if(!IsStudyLocked(aStudy)){
+ // if study is not locked - create new container, create curves and insert them
+ // into container, then plot container if current viewer is of VIEW_PLOT2D type
+ int horIndex;
+ QList<int> verIndices, ver1Indices, ver2Indices, zIndices;
+ aDlg->getCurvesSource( horIndex, ver1Indices, ver2Indices, zIndices );
+ verIndices = ver1Indices + ver2Indices;
+ if( horIndex >= 0 && verIndices.count() > 0 ){
+ CORBA::Object_var aContainerObj = GetVisuGen(this)->CreateContainer();
+ if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObj).in())){
+ for( int i = 0; i < verIndices.count(); i++ ){
+ bool isV2 = ver2Indices.contains(verIndices[i]);
+ VISU::Curve_var aCurveObject =
+ GetVisuGen(this)->CreateCurveWithZExt(aTable->_this(),
+ aDlg->idx(horIndex)+1,
+ aDlg->idx(verIndices[i])+1,
+ aDlg->idx(zIndices[i])+1, isV2 );
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
+ bool isAuto;
+ int marker, line, lineWidth;
+ QColor color;
+ if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
+ line, lineWidth, color) && !isAuto )
+ {
+ SALOMEDS::Color c;
+ c.R = color.red() /255.;
+ c.G = color.green()/255.;
+ c.B = color.blue() /255.;
+ aCurve->SetColor( c );
+ aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
+ aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
+ }
+ aContainer->AddCurve(aCurveObject);
+ }
+ }
+ UpdateObjBrowser(this);
+ PlotContainer( this, aContainer, VISU::eDisplay );
+ }
+ }
+ } else {
+ // get name of SObject
+ QString aSObjectName;
+ _PTR(GenericAttribute) anAttr;
+ if(aSObject->FindAttribute( anAttr, "AttributeName" )){
+ _PTR(AttributeName) aName = anAttr;
+ aSObjectName = QString( aName->Value().c_str() );
+ }
+ // if study is locked just get curves info and plot them
+ // if current viewer is of VIEW_PLOT2D type
+ QList<Plot2d_Curve*> container;
+ aDlg->getCurves( container );
+ if ( !container.isEmpty() ) {
+ GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
+ GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( aSObjectName );
+ }
+ }
+ }
+ delete aDlg;
+ }
}
}
}else if(!aSelectionItem.myIO.IsNull()){
// check if Table SObject is selected
_PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
if(IsSObjectTable(aSObject)){
- VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, GetDesktop(this));
+ VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, NULL, GetDesktop(this));
if(aDlg->exec() == QDialog::Accepted){
- _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
+ _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
if(!IsStudyLocked(aStudy)){
// if study is not locked - create new table and container objects, create curves
// and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
int horIndex;
- QList<int> verIndices, zIndices;
- aDlg->getCurvesSource( horIndex, verIndices, zIndices );
+ QList<int> verIndices, ver1Indices, ver2Indices, zIndices;
+ aDlg->getCurvesSource( horIndex, verIndices, ver2Indices, zIndices );
+ verIndices = ver1Indices + ver2Indices;
if ( horIndex >= 0 && verIndices.count() > 0 ) {
VISU::Table_var aTableObject = GetVisuGen(this)->CreateTable(aSObject->GetID().c_str());
if(!CORBA::is_nil(aTableObject)){
- VISU::Container_var aContainerObject = GetVisuGen(this)->CreateContainer();
+ VISU::Container_var aContainerObject = GetVisuGen(this)->CreateContainer();
VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObject).in());
- for ( int i = 0; i < verIndices.count(); i++ ) {
- VISU::Curve_var aCurveObject = GetVisuGen(this)->CreateCurveWithZ
- ( aTableObject, horIndex+1, verIndices[i]+1, zIndices[i]+1 );
- if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
- bool isAuto;
- int marker, line, lineWidth;
- QColor color;
- if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
- line, lineWidth, color) && !isAuto )
- {
- SALOMEDS::Color c;
- c.R = color.red()/255.;
- c.G = color.green()/255.;
- c.B = color.blue()/255.;
- aCurve->SetColor( c );
- aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
- aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
- }
- aContainerObject->AddCurve(aCurveObject);
- }
- }
- UpdateObjBrowser(this);
- PlotContainer( this, aContainer, VISU::eDisplay );
- }
- }
+ for ( int i = 0; i < verIndices.count(); i++ ) {
+ bool isV2 = ver2Indices.contains(verIndices[i]);
+ VISU::Curve_var aCurveObject = GetVisuGen(this)->CreateCurveWithZExt
+ ( aTableObject, horIndex+1, verIndices[i]+1, zIndices[i]+1, isV2 );
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
+ bool isAuto;
+ int marker, line, lineWidth;
+ QColor color;
+ if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
+ line, lineWidth, color) && !isAuto )
+ {
+ SALOMEDS::Color c;
+ c.R = color.red()/255.;
+ c.G = color.green()/255.;
+ c.B = color.blue()/255.;
+ aCurve->SetColor( c );
+ aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
+ aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
+ }
+ aContainerObject->AddCurve(aCurveObject);
+ }
+ }
+ UpdateObjBrowser(this);
+ PlotContainer( this, aContainer, VISU::eDisplay );
+ }
+ }
} else {
- // get name of SObject
- QString aSObjectName;
- _PTR(GenericAttribute) anAttr;
- if(aSObject->FindAttribute(anAttr, "AttributeName")){
- _PTR(AttributeName) aName = anAttr;
- aSObjectName = QString( aName->Value().c_str() );
- }
+ // get name of SObject
+ QString aSObjectName;
+ _PTR(GenericAttribute) anAttr;
+ if(aSObject->FindAttribute(anAttr, "AttributeName")){
+ _PTR(AttributeName) aName = anAttr;
+ aSObjectName = QString( aName->Value().c_str() );
+ }
// if study is locked just get curves info and plot them
QList<Plot2d_Curve*> container;
aDlg->getCurves( container );
}
}
+//----------------------------------------------------------------------------
+void
+VisuGUI
+::OnCurveScale()
+{
+ if(IsStudyLocked(GetCStudy(GetAppStudy(this))))
+ return;
+
+ VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects( this );
+ int nbSel = aSelectionInfo.size();
+ QList<VISU::Curve_i*> curList;
+ bool isValuesEquals = true;
+ double value;
+
+ for (int i = 0; i < nbSel; i++ ) {
+ VISU::TSelectionItem aSelectionItem = aSelectionInfo[i];
+ VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
+ if(!aBase)
+ continue;
+
+ if(aBase->GetType() == VISU::TCURVE)
+ // Curve object
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBase)) {
+ curList.append(aCurve);
+ if( i>0 && isValuesEquals )
+ isValuesEquals = (value == aCurve->GetScale());
+ value = aCurve->GetScale();
+ }
+ }
+
+ Plot2d_SetupCurveScaleDlg aDlg(GetDesktop( this ));
+ if( isValuesEquals )
+ aDlg.setScale(value);
+
+ if( aDlg.exec() == QDialog::Accepted )
+ for ( int i = 0; i < curList.size(); ++i )
+ curList.at(i)->SetScale( aDlg.getScale() );
+}
//----------------------------------------------------------------------------
void
VisuGUI
if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase)){
if(aContainer && aContainer->GetNbCurves() > 0){
aContainer->Clear();
+ VISU::updateContainerVisibility(aContainer);
UpdateObjBrowser(this);
}
}
if (aDlg->exec()) {
aDlg->storeToPrsObject(aContainer);
UpdateObjBrowser(this, true);
+ delete aDlg;
+ VISU::updateContainerVisibility(aContainer);
}
- delete aDlg;
}
//----------------------------------------------------------------------------
VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp
}
-//----------------------------------------------------------------------------
-void
-VisuGUI
-::OnRename()
-{
- _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
- if (CheckLock(aCStudy,GetDesktop(this)))
- return;
-
- VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
- if (aSelectionInfo.empty())
- return;
-
- VisuGUI_Selection aSel (this);
- aSel.init("", getApp()->selectionMgr());
- if (aSel.count() < 1) return;
-
- bool isAny = false; // is there any appropriate object selected
- for (int i = 0; i < aSelectionInfo.size(); i++) {
- VISU::TSelectionItem aSelectionItem = aSelectionInfo[i];
- VISU::TObjectInfo anObjectInfo = aSelectionItem.myObjectInfo;
-
- _PTR(SObject) aSObject = anObjectInfo.mySObject;
- if (!aSObject)
- continue;
-
- // Check, if the selected object can be renamed
- QString aStr = aSel.parameter(i, "type" ).toString();
- if (aStr == "VISU::TSCALARMAP" || aStr == "VISU::TISOSURFACES" ||
- aStr == "VISU::TDEFORMEDSHAPE" || aStr == "VISU::TCUTPLANES" ||
- aStr == "VISU::TCUTLINES" || aStr == "VISU::TVECTORS" ||
- aStr == "VISU::TSTREAMLINES" || aStr == "VISU::TPLOT3D" ||
- aStr == "VISU::TSCALARMAPONDEFORMEDSHAPE" || aStr == "VISU::TCOLOREDPRS3DHOLDER" ||
- aStr == "VISU::TTABLE" || aStr == "VISU::TCURVE" || aStr == "VISU::TCONTAINER" ||
- aStr == "VISU::POINTMAP3D" || aStr == "VISU::TVIEW3D" ||
- aStr == "VISU::TMESH" || aStr == "VISU::TPOINTMAP3D" || aStr == "VISU::TGAUSSPOINTS")
- {
- _PTR(GenericAttribute) anAttr;
- if (aSObject->FindAttribute(anAttr, "AttributeName")) {
- isAny = true;
- _PTR(AttributeName) aName (anAttr);
- QString Name = VisuGUI_NameDlg::getName( GetDesktop( this ), aName->Value().c_str() );
- if (!Name.isEmpty()) {
- QApplication::setOverrideCursor(Qt::WaitCursor);
-
- // rename specific objects
- if (VISU::Base_i* aBase = anObjectInfo.myBase) {
- switch (aBase->GetType()) {
- case VISU::TCURVE: { // Curve object
- if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBase))
- aCurve->SetName(Name.toLatin1().constData(), true);
- break;
- }
- case VISU::TTABLE: { // Table object
- if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase))
- aTable->SetName(Name.toLatin1().constData(), true);
- break;
- }
- case VISU::TPOINTMAP3D: { // Table object
- if (VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(aBase)) {
- aTable3d->SetTitle(Name.toLatin1().constData());
- aTable3d->UpdateActors();
- }
- break;
- }
- case VISU::TCONTAINER: { // Container object
- if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase))
- aContainer->SetName(Name.toLatin1().constData(), true);
- break;
- }
- default: {
- }}
- }
-
- // rename the study object
- Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
- aName->SetValue(Name.toLatin1().constData()); // rename the SObject
- anIO->setName(Name.toLatin1().constData()); // rename the InteractiveObject
-
- ViewManagerList aViewManagerList;
- getApp()->viewManagers(SPlot2d_Viewer::Type(), aViewManagerList);
- SUIT_ViewManager* aViewManager;
- foreach( aViewManager, aViewManagerList ) {
- if (Plot2d_ViewManager* aManager = dynamic_cast<Plot2d_ViewManager*>(aViewManager)) {
- if (SPlot2d_Viewer* aViewer = dynamic_cast<SPlot2d_Viewer*>(aManager->getViewModel()))
- aViewer->renameAll( anIO, Name.toLatin1().constData() );
- }
- }
-
- UpdateObjBrowser(this, false);
- QApplication::restoreOverrideCursor();
- }
- }
- }
- } // for
-
- if (!isAny) {
- SUIT_MessageBox::warning(GetDesktop(this),
- QObject::tr("WRN_VISU"),
- QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
- }
-}
-
//----------------------------------------------------------------------------
void
VisuGUI
VisuGUI::
OnSucccessiveTimeAnimation()
{
- OnTimeAnimation(VISU::Animation::SUCCESSIVE);
+ OnTimeAnimation(VISU::Animation::SUCCESSIVE);
+}
+
+//----------------------------------------------------------------------------
+void
+VisuGUI
+::OnShowAnimation()
+{
+ if (!VISU::GetActiveViewWindow<SVTK_ViewWindow>(this))
+ return;
+
+ LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+ SALOME_ListIO aListIO;
+ aSelectionMgr->selectedObjects(aListIO);
+
+ if (aListIO.Extent() != 1)
+ return;
+
+ const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
+
+ _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
+
+ _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
+ if (!aSObj)
+ return;
+
+ VISU::VISUType aType = VISU::Storable::SObject2Type( aSObj );
+ if (aType != VISU::TANIMATION)
+ return;
+
+ VisuGUI_TimeAnimationDlg* aAnimationDlg =
+ new VisuGUI_TimeAnimationDlg(this, aCStudy);
+ aAnimationDlg->restoreFromStudy(aSObj);
+ aAnimationDlg->show();
+}
+
+//----------------------------------------------------------------------------
+void
+VisuGUI
+::OnPointEvolution()
+{
+ _PTR(Study) aCStudy = GetCStudy( GetAppStudy( this ) );
+ VisuGUI_EvolutionDlg* aDlg = new VisuGUI_EvolutionDlg( this, aCStudy );
+
+ LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr( this );
+ SALOME_ListIO aListIO;
+ aSelectionMgr->selectedObjects( aListIO );
+
+ SALOME_ListIteratorOfListIO It( aListIO );
+ for( ; It.More(); It.Next() )
+ {
+ _PTR(SObject) aSObject = aCStudy->FindObjectID( It.Value()->getEntry() );
+ if( !aDlg->setField( aSObject ) )
+ {
+ SUIT_MessageBox::warning( GetDesktop( this ),
+ tr( "WRN_VISU" ),
+ tr( "ERR_CANT_CREATE_EVOLUTION" ) );
+ delete aDlg;
+ return;
+ }
+ }
+ aDlg->show();
}
//----------------------------------------------------------------------------
void
VisuGUI
-::OnShowAnimation()
+::OnShowEvolution()
{
- if (!VISU::GetActiveViewWindow<SVTK_ViewWindow>(this))
- return;
-
- LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+ LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr( this );
SALOME_ListIO aListIO;
- aSelectionMgr->selectedObjects(aListIO);
+ aSelectionMgr->selectedObjects( aListIO );
- if (aListIO.Extent() != 1)
+ if( aListIO.Extent() != 1 )
return;
const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
- _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
-
- _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
- if (!aSObj)
+ _PTR(Study) aCStudy = GetCStudy( GetAppStudy( this ) );
+ _PTR(SObject) aSObj = aCStudy->FindObjectID( anIO->getEntry() );
+ if( !aSObj )
return;
VISU::VISUType aType = VISU::Storable::SObject2Type( aSObj );
- if (aType != VISU::TANIMATION)
+ if( aType != VISU::TEVOLUTION )
return;
- VisuGUI_TimeAnimationDlg* aAnimationDlg =
- new VisuGUI_TimeAnimationDlg(this, aCStudy);
- aAnimationDlg->restoreFromStudy(aSObj);
- aAnimationDlg->show();
+ VisuGUI_EvolutionDlg* aDlg = new VisuGUI_EvolutionDlg( this, aCStudy );
+ aDlg->restoreFromStudy( aSObj );
+ aDlg->show();
}
//----------------------------------------------------------------------------
case VISU::TCUTLINES:
TSameAsFactory<VISU::TCUTLINES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
break;
+ case VISU::TCUTSEGMENT:
+ TSameAsFactory<VISU::TCUTSEGMENT>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
+ break;
case VISU::TISOSURFACES:
TSameAsFactory<VISU::TISOSURFACES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
break;
if( myPanels.find( SelectionPanelId ) != myPanels.end() )
{
if( VisuGUI_SelectionPanel* aSelectionPanel =
- dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
+ dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
{
- if( aSelectionPanel->isVisible() )
- aSelectionPanel->hide();
- else
- aSelectionPanel->show();
+ if( aSelectionPanel->isVisible() )
+ aSelectionPanel->hide();
+ else
+ aSelectionPanel->show();
}
}
}
else if( myPanels.find( SelectionPanelId ) != myPanels.end() )
{
if( VisuGUI_SelectionPanel* aSelectionPanel =
- dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
- aSelectionPanel->setSelectionMode( anId - VISU_ACTOR_SELECTION );
+ dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
+ aSelectionPanel->setSelectionMode( anId - VISU_ACTOR_SELECTION );
}
}
// At least one action must be checked
tr("MEN_IMPORT_FROM_FILE"), "", (Qt::CTRL + Qt::Key_I), aParent, false,
this, SLOT(OnImportFromFile()));
+ createAction( VISU_IMPORT_SAUV, "", QIcon(),
+ tr("MEN_IMPORT_SAUV"), "", 0, aParent, false,
+ this, SLOT(OnImportFromSauvFile()));
+
createAction( VISU_IMPORT_TABLE, "", QIcon(),
tr("MEN_IMPORT_TABLE"), "", 0, aParent, false,
this, SLOT(OnImportTableFromFile()));
tr("MEN_CUT_LINES"), "", 0, aParent, false,
this, SLOT(OnCreateCutLines()));
+ aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_SEGMENT"));
+ createAction( VISU_CUT_SEGMENT, tr("MEN_CUT_SEGMENT"), QIcon(aPixmap),
+ tr("MEN_CUT_SEGMENT"), "", 0, aParent, false,
+ this, SLOT(OnCreateCutSegment()));
+
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D"));
createAction( VISU_PLOT_3D, tr("MEN_PLOT_3D"), QIcon(aPixmap),
tr("MEN_PLOT_3D"), "", 0, aParent, false,
tr("MEN_CURVE_PROPS"), "", 0, aParent, false,
this, SLOT(OnCurveProperties()));
- createAction( VISU_RENAME, tr("MEN_RENAME"), QIcon(),
- tr("MEN_RENAME"), "", Qt::Key_F2, aParent, false,
- this, SLOT(OnRename()));
+ createAction( VISU_CURVE_SCALE, tr("MEN_CURVE_SCALE"), QIcon(),
+ tr("MEN_CURVE_SCALE"), "", 0, aParent, false,
+ this, SLOT(OnCurveScale()));
createAction( VISU_EDIT_CONTAINER, tr("MEN_EDIT_CONTAINER"), QIcon(),
tr("MEN_EDIT_CONTAINER"), "", 0, aParent, false,
tr("MEN_EDGE_COLOR"), "", 0, aParent, false,
this, SLOT(OnChangeWireframeColor()));
- createAction( VISU_OPACITY, tr("MEN_OPACITY"), QIcon(),
- tr("MEN_OPACITY"), "", 0, aParent, false,
+ createAction( VISU_OPACITY, tr("MEN_TRANSPARENCY"), QIcon(),
+ tr("MEN_TRANSPARENCY"), "", 0, aParent, false,
this, SLOT(OnChangeOpacity()));
createAction( VISU_LINE_WIDTH, tr("MEN_LINE_WIDTH"), QIcon(),
tr("MEN_LINE_WIDTH"), "", 0, aParent, false,
this, SLOT(OnChangeLines()));
+ createAction( VISU_POINT_MARKER, tr("MEN_POINT_MARKER"), QIcon(),
+ tr("MEN_POINT_MARKER"), "", 0, aParent, false,
+ this, SLOT(OnChangePointMarker()));
+
+ createAction( VISU_SHRINK_FACTOR, tr("MEN_SHRINK_FACTOR"), QIcon(),
+ tr("MEN_SHRINK_FACTOR"), "", 0, aParent, false,
+ this, SLOT(OnChangeShrinkFactor()));
+
createAction( VISU_EDIT_SCALARMAP, tr("MEN_EDIT_PRS"), QIcon(),
tr("MEN_EDIT_PRS"), "", 0, aParent, false,
tr("MEN_EDIT_PRS"), "", 0, aParent, false,
this, SLOT(OnEditCutLines()));
+ createAction( VISU_EDIT_CUTSEGMENT, tr("MEN_EDIT_PRS"), QIcon(),
+ tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+ this, SLOT(OnEditCutSegment()));
+
createAction( VISU_EDIT_ISOSURFACES, tr("MEN_EDIT_PRS"), QIcon(),
tr("MEN_EDIT_PRS"), "", 0, aParent, false,
this, SLOT(OnEditIsoSurfaces()));
tr("MEN_SUCCCESSIVE_ANIMATION"), "", 0, aParent, false,
this, SLOT(OnSucccessiveTimeAnimation()));
+ createAction( VISU_POINT_EVOLUTION, tr("MEN_POINT_EVOLUTION"), QIcon(),
+ tr("MEN_POINT_EVOLUTION"), "", 0, aParent, false,
+ this, SLOT(OnPointEvolution()));
+
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ERASE_ALL"));
createAction( VISU_ERASE_ALL, tr("MEN_ERASE_ALL"), QIcon(aPixmap),
tr("MEN_ERASE_ALL"), "", 0, aParent, false,
tr("MEN_GAUSS_POINT_SELECTION"), "", 0, aParent, true,
this, SLOT(OnSwitchSelectionMode()));
- // Defenition of the actions for the "Navigation" tool bar
+ // Definition of the actions for the "Navigation" tool bar
registerAction( VISU_SLIDER_PANEL, mySlider->toggleViewAction() );
registerAction( VISU_SWEEP_PANEL, mySweep->toggleViewAction() );
tr("MEN_SHOW_ANIMATION"), "", 0, aParent, false,
this, SLOT(OnShowAnimation()));
+ createAction( VISU_SHOW_EVOLUTION, tr("MEN_SHOW_EVOLUTION"), QIcon(),
+ tr("MEN_SHOW_EVOLUTION"), "", 0, aParent, false,
+ this, SLOT(OnShowEvolution()));
+
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D"));
createAction( VISU_PLOT3D_FROM_CUTPLANE, tr("MEN_PLOT3D_FROM_CUTPLANE"), QIcon(aPixmap),
tr("MEN_PLOT3D_FROM_CUTPLANE"), "", 0, aParent, false,
tr("MEN_FILE_INFO"), "", 0, aParent, false,
this, SLOT(OnFileInfo()));
- createAction( VISU_EXPORT_MED, tr("MEN_EXPORT_MED"), QIcon(),
- tr("MEN_EXPORT_MED"), "", 0, aParent, false,
+ createAction( VISU_EXPORT_MED, tr("VISU_MEN_EXPORT_MED"), QIcon(),
+ tr("VISU_MEN_EXPORT_MED"), "", 0, aParent, false,
this, SLOT(OnExportMED()));
createAction( VISU_FILTERSCALARS, tr("MEN_FILTER_SCALARS"), QIcon(),
tr("MEN_FILTER_SCALARS"), "", 0, aParent, false,
this, SLOT(OnFilterScalars()));
-
+
createAction( VISU_VALUES_LABELING, tr("MEN_VALUES_LABELING"), QIcon(),
tr("MEN_VALUES_LABELING"), "", 0, aParent, true,
- this, SLOT(OnValuesLabeling()));
+ this, SLOT(OnValuesLabeling()));
createAction( VISU_VALUES_LABELING_PARAMS, tr("VISU_VALUES_LABELING_PARAMS"), QIcon(),
tr("VISU_VALUES_LABELING_PARAMS"), "", 0, aParent, false,
- this, SLOT(OnValuesLabelingParams()));
+ this, SLOT(OnValuesLabelingParams()));
+
+ createAction(VISU_ARCQUAD_MODE, tr("MEN_VISU_ARCQUAD_MODE"), QIcon(),
+ tr("MEN_VISU_ARCQUAD_MODE"), "",0, aParent, true,
+ this, SLOT(OnArcQuadMode()));
+
+ createAction(VISU_LINEQUAD_MODE, tr("MEN_VISU_LINEQUAD_MODE"),QIcon(),
+ tr("MEN_VISU_LINEQUAD_MODE"), "",0, aParent, true,
+ this, SLOT(OnLineQuadMode()));
+
+ createAction(VISU_SHOW_DEVIATION, tr("MEN_VISU_SHOW_DEVIATION"),QIcon(),
+ tr("MEN_VISU_SHOW_DEVIATION"), "",0, aParent, true,
+ this, SLOT(OnShowDeviation()));
}
int anImportId = createMenu( tr( "MEN_IMPORT" ), aMenuId, -1, 10 );
createMenu( VISU_IMPORT_FROM_FILE, anImportId ); // import from file
+ createMenu( VISU_IMPORT_SAUV, anImportId ); // import sauv file
createMenu( VISU_IMPORT_TABLE, anImportId ); // import table
aMenuId = createMenu( tr( "MEN_VISUALIZATION" ), -1, -1, 30 );
createMenu( VISU_ISO_SURFACES, aMenuId, 10 ); // iso surfaces
createMenu( VISU_CUT_PLANES, aMenuId, 10 ); // cut planes
createMenu( VISU_CUT_LINES, aMenuId, 10 ); // cut lines
+ createMenu( VISU_CUT_SEGMENT, aMenuId, 10 ); // cut segment
createMenu( VISU_STREAM_LINES, aMenuId, 10 ); // stream lines
createMenu( VISU_PLOT_3D, aMenuId, 10 ); // Plot3d
createMenu( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, aMenuId, 10 ); // scalar map on deformed shape
createMenu( VISU_WIREFRAME, parentId, 10 ); // wireframe
createMenu( VISU_SURFACE, parentId, 10 ); // surface
createMenu( VISU_ERASE_ALL, aMenuId, 10 ); // erase all
+
+ parentId = createMenu( tr( "MEN_2D_QUADRATIC_MODE" ), aMenuId, 10 ); // 2D quadratic mode
+ createMenu( VISU_LINEQUAD_MODE, parentId, 10 ); // lines
+ createMenu( VISU_ARCQUAD_MODE, parentId, 10 ); // arcs
+
}
void
createTool( VISU_ISO_SURFACES, aToolId );
createTool( VISU_CUT_PLANES, aToolId );
createTool( VISU_CUT_LINES, aToolId );
+ createTool( VISU_CUT_SEGMENT, aToolId );
createTool( VISU_STREAM_LINES, aToolId );
createTool( VISU_PLOT_3D, aToolId );
createTool( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, aToolId );
// VISU root commands
mgr->insert( action( VISU_IMPORT_FROM_FILE ), -1, -1, -1 ); // import MED file
+ mgr->insert( action( VISU_IMPORT_SAUV ), -1, -1, -1 ); // import SAUV file
mgr->insert( action( VISU_IMPORT_TABLE ), -1, -1, -1 ); // import tables from file
mgr->insert( action( VISU_PLOT2D ), -1, -1, -1 ); // create Plot2d View
mgr->insert( action( VISU_ISO_SURFACES ), -1, -1, -1 ); // iso surface
mgr->insert( action( VISU_CUT_PLANES ), -1, -1, -1 ); // cut planes
mgr->insert( action( VISU_CUT_LINES ), -1, -1, -1 ); // cut lines
+ mgr->insert( action( VISU_CUT_SEGMENT ), -1, -1, -1 ); // cut segment
mgr->insert( action( VISU_DEFORMED_SHAPE ), -1, -1, -1 ); // deformed shape
mgr->insert( action( VISU_VECTORS ), -1, -1, -1 ); // vectors
mgr->insert( action( VISU_STREAM_LINES ), -1, -1, -1 ); // stream lines
mgr->insert( action( VISU_EDIT_DEFORMEDSHAPE ), -1, -1, -1 );
mgr->insert( action( VISU_EDIT_CUTPLANES ), -1, -1, -1 );
mgr->insert( action( VISU_EDIT_CUTLINES ), -1, -1, -1 );
+ mgr->insert( action( VISU_EDIT_CUTSEGMENT ), -1, -1, -1 );
mgr->insert( action( VISU_EDIT_ISOSURFACES ), -1, -1, -1 );
mgr->insert( action( VISU_EDIT_VECTORS ), -1, -1, -1 );
mgr->insert( action( VISU_EDIT_STREAMLINES ), -1, -1, -1 );
mgr->insert( action( VISU_FILTERSCALARS ), -1, -1, -1 );
- // rename
- mgr->insert( action( VISU_RENAME ), -1, -1, -1 );
-
// copy
mgr->insert( action( VISU_COPY_PRS ), -1, -1, -1 );
// delete
mgr->insert( action( VISU_CLEAR_CONTAINER ), -1, -1, -1 );
-
+
// labeling
mgr->insert( separator(), -1, -1, -1 );
mgr->insert( action( VISU_VALUES_LABELING ), -1, -1, -1 );
mgr->insert( action( VISU_SHADING ) , parentId, -1, -1 ); // shading
mgr->insert( action( VISU_NOSHADING ) , parentId, -1, -1 ); // noshading
+ //"2D Quadratic" submenu
+ parentId = mgr->insert( tr( "MEN_2D_QUADRATIC_MODE" ), -1, -1 );
+ mgr->insert( action( VISU_LINEQUAD_MODE ), parentId, -1, -1 ); // line representation
+ mgr->insert( action( VISU_ARCQUAD_MODE ), parentId, -1, -1 ); // arc representation
+
// "Properties" submenu
parentId = mgr->insert( tr( "MEN_PROPERTIES" ), -1, -1 );
- mgr->insert( action( VISU_CELL_COLOR ), parentId, -1, -1 ); // cell color
- mgr->insert( action( VISU_EDGE_COLOR ), parentId, -1, -1 ); // edge color
- mgr->insert( action( VISU_COLOR ) , parentId, -1, -1 ); // color
- mgr->insert( action( VISU_OPACITY ) , parentId, -1, -1 ); // opacity
- mgr->insert( action( VISU_LINE_WIDTH ), parentId, -1, -1 ); // line width
+ mgr->insert( action( VISU_CELL_COLOR ), parentId, -1, -1 ); // cell color
+ mgr->insert( action( VISU_EDGE_COLOR ), parentId, -1, -1 ); // edge color
+ mgr->insert( action( VISU_COLOR ) , parentId, -1, -1 ); // color
+ mgr->insert( action( VISU_OPACITY ) , parentId, -1, -1 ); // opacity
+ mgr->insert( action( VISU_LINE_WIDTH ), parentId, -1, -1 ); // line width
+ mgr->insert( action( VISU_POINT_MARKER ), parentId, -1, -1 ); // point marker
+ mgr->insert( action( VISU_SHRINK_FACTOR ), parentId, -1, -1 ); // shrink factor
mgr->insert( separator(), -1, -1, -1 );
mgr->insert( separator(), -1, -1, -1 );
+ mgr->insert( action( VISU_POINT_EVOLUTION ), -1, -1, -1 );
+
+ mgr->insert( separator(), -1, -1, -1 );
+
// view parameters commands
mgr->insert( action( VISU_SAVE_VIEW_PARAMS ), -1, -1, -1 ); // save view params
mgr->insert( action( VISU_SAVE_VIEW_PARAMS_1 ), -1, -1, -1 ); // save view params
mgr->insert( action( VISU_ARRANGE_ACTORS ), -1, -1, -1 ); // arrange actors
mgr->insert( action( VISU_CURVE_PROPS ), -1, -1, -1 ); // curve properties
+ mgr->insert( action( VISU_CURVE_SCALE ), -1, -1, -1 ); // curve scale
+ //Show deviation command on curve
+ mgr->insert( action( VISU_SHOW_DEVIATION ), -1, -1, -1 ); // deviation
mgr->insert( action( VISU_MULTIPR_FULL_RES ), -1, -1, -1 );
mgr->insert( action( VISU_MULTIPR_MED_RES ), -1, -1, -1 );
// Rules
QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
- "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
- "'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCOLOREDPRS3DHOLDER'");
+ "'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
+ "'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCOLOREDPRS3DHOLDER'");
QString aSimplePrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
- "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
- "'VISU::TSCALARMAPONDEFORMEDSHAPE'");
+ "'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
+ "'VISU::TSCALARMAPONDEFORMEDSHAPE'");
// VISU root commands
QString aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'";
mgr->setRule( action( VISU_IMPORT_FROM_FILE ), aRule );
+ mgr->setRule( action( VISU_IMPORT_SAUV ), aRule );
mgr->setRule( action( VISU_IMPORT_TABLE ), aRule );
mgr->setRule( action( VISU_PLOT2D ), aRule );
mgr->setRule( action( VISU_ISO_SURFACES ), aRule );
mgr->setRule( action( VISU_CUT_PLANES ), aRule );
mgr->setRule( action( VISU_CUT_LINES ), aRule );
+ mgr->setRule( action( VISU_CUT_SEGMENT ), aRule );
mgr->setRule( action( VISU_PLOT_3D ), aRule );
aRule += " and nbComponents>1";
mgr->setRule( action( VISU_DEFORMED_SHAPE ), aRule );
QString aTableOrContShow = "(($type in {'VISU::TTABLE' 'VISU::TPOINTMAP3D' 'VISU::TCONTAINER'}) and isPlot2dViewer and hasCurves and isThereAreHiddenCurves)";
QString orCurveVisible = "or (type='VISU::TCURVE' and isVisible)";
QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")";
- QString aPrsVisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}) and isVisible and (not isPlot2dViewer))";
- QString aPrsInvisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "})" + andInvisible + " and (not isPlot2dViewer))";
+ QString aPrsVisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}) and isVisible and (not isPlot2dViewer))";
+ QString aPrsInvisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})" + andInvisible + " and (not isPlot2dViewer))";
QString aComponent = "( selcount=1 and canBeDisplayed and isVisuComponent )";
- QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible +
- " or (client='ObjectBrowser' and (" + aTableOrContHide + orCurveVisible + "))) ) or " + aComponent;
+ QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed or type in {'VISU::TCONTAINER' 'VISU::TCURVE'}) and (" + aPrsVisible +
+ " or ( (" + aTableOrContHide + orCurveVisible + "))) ) or " + aComponent;
- QString aDisplayRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsInvisible +
- " or (client='ObjectBrowser' and (" + aTableOrContShow + orCurveInvisible + "))) ) or " + aComponent;
+ QString aDisplayRule = "( selcount>0 and ({true} in $canBeDisplayed or type in {'VISU::TCONTAINER' 'VISU::TCURVE'}) and (" + aPrsInvisible +
+ " or ( (" + aTableOrContShow + orCurveInvisible + "))) ) or " + aComponent;
- QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "})"
- " or (client='ObjectBrowser' and ((type='VISU::TTABLE' and nbChildren>0) or"
- " ($type in {'VISU::TCURVE' 'VISU::TCONTAINER'})))) ) or" + aComponent;
+ QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed or type in {'VISU::TCONTAINER' 'VISU::TCURVE'}) and (($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})"
+ " or ( ((type='VISU::TTABLE' and nbChildren>0) or (type='VISU::TCONTAINER' and hasCurves) or"
+ " (type='VISU::TCURVE')))) ) or" + aComponent;
- QString aScalarBarHideRule = "( selcount>0 and ($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}) and isScalarMapAct=1 and " + aPrsVisible + " and isScalarBarVisible )";
- QString aScalarBarShowRule = "( selcount>0 and ($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}) and isScalarMapAct=1 and " + aPrsVisible + " and (not isScalarBarVisible) )";
+ QString aScalarBarHideRule = "( selcount>0 and ($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}) and (isScalarMapAct=1 or isGaussPtsAct=1 ) and " + aPrsVisible + " and isScalarBarVisible )";
+ QString aScalarBarShowRule = "( selcount>0 and ($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}) and ( isScalarMapAct=1 or isGaussPtsAct=1 ) and " + aPrsVisible + " and (not isScalarBarVisible) )";
mgr->setRule( action( VISU_ERASE ), anEraseRule );
mgr->setRule( action( VISU_DISPLAY ), aDisplayRule );
aRule = "selcount=1 and $type in { " + aSimplePrsAll + "}";
mgr->setRule( action( VISU_FILTERSCALARS ), aRule );
-
+
// labeling
aRule = "hasActor=1 and selcount=1 and $type in { 'VISU::TGAUSSPOINTS'" + aPrsAll + " }";
mgr->setRule( action( VISU_VALUES_LABELING ), "{true} in $isValuesLabeled", QtxPopupMgr::ToggleRule );
mgr->setRule( action( VISU_VALUES_LABELING_PARAMS ), aRule, QtxPopupMgr::VisibleRule );
+ //2D quadratic
+ aRule = "isVisible and hasActor=1 and selcount=1 and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
+ mgr->setRule (action(VISU_ARCQUAD_MODE), aRule , QtxPopupMgr::VisibleRule);
+ mgr->setRule (action(VISU_LINEQUAD_MODE),aRule , QtxPopupMgr::VisibleRule);
+
+ mgr->setRule (action(VISU_ARCQUAD_MODE), aRule + " and quadratic2DMode='VISU::ARCS'", QtxPopupMgr::ToggleRule);
+ mgr->setRule (action(VISU_LINEQUAD_MODE),aRule + " and quadratic2DMode='VISU::LINES'", QtxPopupMgr::ToggleRule);
+
+
// view parameters
aRule = "selcount=1 and type='VISU::TVIEW3D' and activeView='VTKViewer'";
mgr->setRule( action( VISU_SAVE_VIEW_PARAMS_1 ), aRule );
" 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' "
- "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
+ "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
QString aFeatureEdgesType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
// "Properties" submenu
mgr->setRule( action( VISU_CELL_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'" );
- mgr->setRule( action( VISU_EDGE_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'" );
+ mgr->setRule( action( VISU_EDGE_COLOR ), aRule + aSurfFrameType + " and representation='VISU::SURFACEFRAME'" );
mgr->setRule( action( VISU_COLOR ), aRule + " and ((type='VISU::TMESH'"
- " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}) "
+ " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::FEATURE_EDGES'}) "
"or (type='VISU::TDEFORMEDSHAPE' and hasActor=1))" );
mgr->setRule( action( VISU_OPACITY ), aRule + " and hasActor=1" );
- mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1" );
+ mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1 and representation!='VISU::POINT'" );
+ mgr->setRule( action( VISU_POINT_MARKER ), aRule + aLineType + " and hasActor=1 and representation='VISU::POINT'" );
+ mgr->setRule( action( VISU_SHRINK_FACTOR ), aRule + aShrinkType + " and isShrunk=1" );
- // rename command
QString aCurveAll = "'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER' 'VISU::POINTMAP3D'";
- aRule = "selcount=1 and ($type in {'VISU::TVIEW3D' 'VISU::TMESH' 'VISU::TPOINTMAP3D' " + aCurveAll + " " + aPrsAll + "})";
- mgr->setRule( action( VISU_RENAME ), aRule );
-
// copy presentation command
aRule = "selcount=1 and ($type in {" + aPrsAll + "})";
mgr->setRule( action( VISU_COPY_PRS ), aRule );
// Curve commands
aRule = "selcount=1 and type='VISU::TCURVE'";
mgr->setRule( action( VISU_CURVE_PROPS ), aRule );
+ mgr->setRule( action( VISU_CURVE_SCALE ), "selcount > 0 and type='VISU::TCURVE'");
// Table Commands
aRule = "selcount=1 and ( type='VISU::TPOINTMAP3D' or type='VISU::TTABLE')";
mgr->setRule( action( VISU_CLEAR_CONTAINER ), aRule );
mgr->setRule( action( VISU_EDIT_SCALARMAP ),
- "selcount=1 and type='VISU::TSCALARMAP'" );
+ "selcount=1 and type='VISU::TSCALARMAP'" );
mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
- "selcount=1 and type='VISU::TDEFORMEDSHAPE'" );
+ "selcount=1 and type='VISU::TDEFORMEDSHAPE'" );
mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP ),
- "selcount=1 and $type in {'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}" );
+ "selcount=1 and $type in {'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}" );
mgr->setRule( action( VISU_EDIT_CUTPLANES ),
- "selcount=1 and type='VISU::TCUTPLANES'" );
+ "selcount=1 and type='VISU::TCUTPLANES'" );
mgr->setRule( action( VISU_EDIT_CUTLINES ),
- "selcount=1 and type='VISU::TCUTLINES'" );
+ "selcount=1 and type='VISU::TCUTLINES'" );
+ mgr->setRule( action( VISU_EDIT_CUTSEGMENT ),
+ "selcount=1 and type='VISU::TCUTSEGMENT'" );
mgr->setRule( action( VISU_EDIT_ISOSURFACES ),
- "selcount=1 and type='VISU::TISOSURFACES'" );
+ "selcount=1 and type='VISU::TISOSURFACES'" );
mgr->setRule( action( VISU_EDIT_VECTORS ),
- "selcount=1 and type='VISU::TVECTORS'" );
+ "selcount=1 and type='VISU::TVECTORS'" );
mgr->setRule( action( VISU_EDIT_STREAMLINES ),
- "selcount=1 and type='VISU::TSTREAMLINES'" );
+ "selcount=1 and type='VISU::TSTREAMLINES'" );
mgr->setRule( action( VISU_EDIT_PLOT3D ),
- "selcount=1 and type='VISU::TPLOT3D'" );
+ "selcount=1 and type='VISU::TPLOT3D'" );
mgr->setRule( action( VISU_EDIT_POINTMAP3D ),
- "selcount=1 and type='VISU::TPOINTMAP3D'" );
+ "selcount=1 and type='VISU::TPOINTMAP3D'" );
- aRule = "selcount=1 and type='VISU::TCUTLINES' and nbNamedChildren=0";
+ aRule = "selcount=1 and $type in {'VISU::TCUTLINES' 'VISU::TCUTSEGMENT'} and nbNamedChildren=0";
mgr->setRule( action( VISU_CREATE_TABLE ), aRule );
- aRule = "selcount=1 and ($type in {" + aSimplePrsAll + "})";
+ aRule = "selcount=1 and ($type in {" + aSimplePrsAll + "}) and isFieldPrs=0";
mgr->setRule( action( VISU_SWEEP ), aRule );
aRule = "client='ObjectBrowser' and selcount>0";
aRule += " and activeView in {'VTKViewer' 'SVTK'}";
mgr->setRule( action( VISU_SUCCCESSIVEANIMATION ), aRule );
+ aRule = "client='ObjectBrowser' and selcount>0";
+ aRule += " and $type in {'VISU::TFIELD'}";
+ aRule += " and medEntity='NODE_ENTITY'";
+ aRule += " and nbTimeStamps>1";
+ mgr->setRule( action( VISU_POINT_EVOLUTION ), aRule );
+
aRule = "client='ObjectBrowser' and $type in {'VISU::TENTITY' 'VISU::TFAMILY' 'VISU::TGROUP'}";
mgr->setRule( action( VISU_CREATE_PRS ), aRule + " and selcount=1" );
mgr->setRule( action( VISU_CREATE_MANY_PRS ), aRule + " and selcount>1" );
mgr->setRule( action( VISU_EDIT_PLOT3D ),
- "selcount=1 and type='VISU::TPLOT3D'" );
+ "selcount=1 and type='VISU::TPLOT3D'" );
//aRule = "client='ObjectBrowser' and type='MEDFIELD'";
//mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
mgr->setRule( action( VISU_FILE_INFO ), "selcount=1 and type in {'VISU::TRESULT'}" );
mgr->setRule( action( VISU_EXPORT_MED ), "selcount=1 and type in {'VISU::TRESULT'}" );
+
+ aRule = "isPlot2dViewer and isVisible and selcount > 0 and type='VISU::TCURVE' and hasDeviation";
+ mgr->setRule (action(VISU_SHOW_DEVIATION), aRule , QtxPopupMgr::VisibleRule);
+ aRule = "isPlot2dViewer and isVisible and selcount > 0 and type='VISU::TCURVE' and hasDeviation and isDeviationDisplayed";
+ mgr->setRule (action(VISU_SHOW_DEVIATION), aRule , QtxPopupMgr::ToggleRule);
}
void VisuGUI::createPanels()
{
- myPanels.insert( SelectionPanelId, new VisuGUI_SelectionPanel( this ) );
- myPanels.insert( FeatureEdgesPanelId, new VisuGUI_FeatureEdgesPanel( this ) );
- myPanels.insert( ClippingPlanesPanelId, new VisuGUI_ClippingPanel( this ) );
-
- QMap< PanelId, VisuGUI_Panel* >::iterator it = myPanels.begin(), itEnd = myPanels.end();
- for( ; it != itEnd; ++it )
- {
- if( VisuGUI_Panel* aPanel = it.value() )
- {
- aPanel->hide();
- GetDesktop(this)->addDockWidget( Qt::RightDockWidgetArea, aPanel );
- }
+ myPanels[SelectionPanelId] = new VisuGUI_SelectionPanel( this );
+ myPanels[FeatureEdgesPanelId] = new VisuGUI_FeatureEdgesPanel( this );
+ myPanels[ClippingPlanesPanelId] = new VisuGUI_ClippingPanel( this );
+
+ VisuGUI_Panel* aPanel;
+ foreach( aPanel, myPanels ) {
+ getApp()->desktop()->addDockWidget( Qt::RightDockWidgetArea, aPanel );
+ aPanel->setVisible( false );
}
}
if (!anIO.IsNull() && anIO->hasEntry()) {
_PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
if ( !aSObject )
- continue;
+ continue;
if ( !isOBClient ) {
- QString aName = QString( aSObject->GetName().c_str() );
- while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of popup
- aName.remove( (aName.length() - 1), 1 );
- theTitle = aName;
+ QString aName = QString( aSObject->GetName().c_str() );
+ while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of popup
+ aName.remove( (aName.length() - 1), 1 );
+ theTitle = aName;
}
CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
if (CORBA::is_nil(aCORBAObject)) {
- VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
- if (aType == VISU::TTIMESTAMP) {
- _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(aSObject);
- _PTR(SObject) aPrs;
- for (; anIter->More(); anIter->Next()) {
- aPrs = anIter->Value();
- if (!aPrs)
- continue;
- std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(this, aPrs);
- nbPrs += aSubList.size();
- }
- }
+ VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
+ if (aType == VISU::TTIMESTAMP) {
+ _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(aSObject);
+ _PTR(SObject) aPrs;
+ for (; anIter->More(); anIter->Next()) {
+ aPrs = anIter->Value();
+ if (!aPrs)
+ continue;
+ std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(this, aPrs);
+ nbPrs += aSubList.size();
+ }
+ }
}
}
}
if (!anIO.IsNull() && anIO->hasEntry()) {
_PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
if ( !aSObject )
- continue;
+ continue;
VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
if (aType == VISU::TCURVE) {
- isCurves = true;
+ isCurves = true;
} else {
- VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
- if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
- if (aPrsObject->GetType() == VISU::TCUTPLANES) {
- if (VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject))
- isOneCutPlane = aCutPrs->GetNbPlanes() == 1;
- }
- }
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
+ if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
+ if (aPrsObject->GetType() == VISU::TCUTPLANES) {
+ if (VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject))
+ isOneCutPlane = aCutPrs->GetNbPlanes() == 1;
+ }
+ }
}
}
}
VISU::VISUType aType = VISU::Storable::RestoringMap2Type( aMap );
if (aType == VISU::TANIMATION) {
theMenu->addAction( action( VISU_SHOW_ANIMATION ) );
+ } else if (aType == VISU::TEVOLUTION) {
+ theMenu->addAction( action( VISU_SHOW_EVOLUTION ) );
} else if (isOBClient) {
if (IsSObjectTable(aSObject)) {
/* action( VISU_SHOW_TABLE )->addTo(theMenu);
if (aSFather1) {
std::string aValue = aSFather1->GetName();
if (strcmp(aValue.c_str(), "MEDFIELD") == 0) {
- theMenu->addAction( action( VISU_IMPORT_MED_FIELD ) ); // "Import Field"
+ theMenu->addAction( action( VISU_IMPORT_MED_FIELD ) ); // "Import Field"
}
}
}
setMenuShown( true );
setToolShown( true );
+ // import Python module that manages VISU plugins (need to be here because SalomePyQt API uses active module)
+ PyGILState_STATE gstate = PyGILState_Ensure();
+ PyObject* pluginsmanager=PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager");
+ if(pluginsmanager==NULL)
+ PyErr_Print();
+ else
+ {
+ PyObject* result=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"visu",tr("MEN_VISUALIZATION").toStdString().c_str(),tr("VISU_PLUGINS_OTHER").toStdString().c_str());
+ if(result==NULL)
+ PyErr_Print();
+ Py_XDECREF(result);
+ }
+ PyGILState_Release(gstate);
+ // end of GEOM plugins loading
+
// Reset actions accelerator keys
QList<QKeySequence> shortcuts;
shortcuts.append( QKeySequence(Qt::CTRL + Qt::Key_I) );
action(VISU_IMPORT_FROM_FILE)->setShortcuts(shortcuts);
action(VISU_DELETE_OBJS)->setEnabled(true); // Delete: Key_Delete
- action(VISU_RENAME )->setEnabled(true); // Rename: Key_F2
((VisuGUI_ClippingPanel*) myPanels[ClippingPlanesPanelId])->init();
-
+ GetVisuGen( this )->GetClippingPlaneMgr().SetStudy(GetCStudy(dynamic_cast<SalomeApp_Study*>(theStudy)),true);
emit moduleActivated();
return aResult;
setMenuShown( false );
setToolShown( false );
- QMap< PanelId, VisuGUI_Panel* >::iterator it = myPanels.begin(), itEnd = myPanels.end();
- for( ; it != itEnd; ++it )
- {
- if( VisuGUI_Panel* aPanel = it.value() )
- aPanel->hide();
- }
-
// Unset actions accelerator keys
action(VISU_IMPORT_FROM_FILE)->setShortcuts(QKeySequence::UnknownKey); // Import: CTRL + Key_I
action(VISU_DELETE_OBJS)->setEnabled(false); // Delete: Key_Delete
- action(VISU_RENAME )->setEnabled(false); // Rename: Key_F2
bool aResult = SalomeApp_Module::deactivateModule( theStudy );
-
+
emit moduleDeactivated();
return aResult;
return new VisuGUI_Selection( (SalomeApp_Module*)this );
}
+void
+VisuGUI
+::processPresentationCreated( VISU::Prs3d_i* thePrs )
+{
+ if( thePrs )
+ {
+ QString anEntry = thePrs->GetEntry().c_str();
+ if( anEntry.isEmpty() )
+ if( VISU::ColoredPrs3d_i* aColoredPrs = dynamic_cast<VISU::ColoredPrs3d_i*>( thePrs ) )
+ anEntry = aColoredPrs->GetHolderEntry().c_str();
+
+ QStringList anEntryList( anEntry );
+ if( getApp() )
+ getApp()->browseObjects( anEntryList );
+
+ emit presentationCreated( thePrs );
+ }
+}
+
//******************************************************************
void VisuGUI::studyActivated()
{
GetVisuGen(this)->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(this))));
-
+
}
/*
void VisuGUI::createPreferences()
{
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+
+ // TAB: General
+ int genTab = addPreference( tr( "VISU_PREF_GENERAL" ) );
+ // Quantities with individual precision settings
+ int precGroup = addPreference( tr( "VISU_PREF_GROUP_PRECISION" ), genTab );
+ setPreferenceProperty( precGroup, "columns", 2 );
+
+ // Default precision used by some input fieklds and data visualization code
+ // Moved here from "Representation" tab to have all precisions in the same place
+ int point_precision = addPreference( tr( "VISU_PREF_visual_data_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "VISU", "visual_data_precision" );
+ setPreferenceProperty( point_precision, "min", -16 );
+ setPreferenceProperty( point_precision, "max", 16 );
+ setPreferenceProperty( point_precision, "step", 1 );
+
+ const int nbQuantities = 5;
+ int precs[nbQuantities], ii = 0;
+ precs[ii++] = addPreference( tr( "VISU_PREF_length_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "VISU", "length_precision" );
+ precs[ii++] = addPreference( tr( "VISU_PREF_angle_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "VISU", "angle_precision" );
+ precs[ii++] = addPreference( tr( "VISU_PREF_len_tol_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "VISU", "len_tol_precision" );
+ precs[ii++] = addPreference( tr( "VISU_PREF_parametric_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "VISU", "parametric_precision" );
+ precs[ii ] = addPreference( tr( "VISU_PREF_memory_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "VISU", "memory_precision" );
+
+ // Set property for precision value for spinboxes
+ for ( ii = 0; ii < nbQuantities; ii++ ){
+ setPreferenceProperty( precs[ii], "min", ii == 2 ? 0 : -14 );
+ setPreferenceProperty( precs[ii], "max", ii == 2 ? 3 : 14 );
+ setPreferenceProperty( precs[ii], "precision", 2 );
+ }
+
+
// TAB: "MED import"
int importTab = addPreference( tr( "MED import" ) );
//printf( "++++++++++++++++++ Tab index %d\n", importTab );
setPreferenceProperty( mode, "strings", modes );
setPreferenceProperty( mode, "indexes", indices );
+ addPreference( tr( "VISU_LOGARITHMIC_SCALING" ), rangeGr, LightApp_Preferences::Bool, "VISU", "scalar_bar_logarithmic" );
+
int rangetype = addPreference( tr( "VISU_RANGE_TO_USE" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_range_type" );
QStringList types;
types.append( tr( "VISU_FIELD_RANGE" ) );
setPreferenceProperty( rangetype, "strings", types );
setPreferenceProperty( rangetype, "indexes", indices );
- addPreference( tr( "VISU_LOGARITHMIC_SCALING" ), rangeGr, LightApp_Preferences::Bool, "VISU", "scalar_bar_logarithmic" );
+ int gaussMetric = addPreference( tr( "VISU_GAUSS_METRIC" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_gauss_metric" );
+ QStringList metrics;
+ metrics.append( tr( "VISU_GAUSS_METRIC_AVERAGE" ) );
+ metrics.append( tr( "VISU_GAUSS_METRIC_MINIMUM" ) );
+ metrics.append( tr( "VISU_GAUSS_METRIC_MAXIMUM" ) );
+ indices.clear();
+ indices.append( 0 );
+ indices.append( 1 );
+ indices.append( 2 );
+ setPreferenceProperty( gaussMetric, "strings", metrics );
+ setPreferenceProperty( gaussMetric, "indexes", indices );
int imposedGr = addPreference( tr( "VISU_MINMAX_IMPOSED_RANGE" ), sbarTab );
setPreferenceProperty( imposedGr, "columns", 4 );
- int min = addPreference( tr( "VISU_MIN" ), imposedGr, LightApp_Preferences::DblSpin, "VISU", "scalar_range_min" );
- int max = addPreference( tr( "VISU_MAX" ), imposedGr, LightApp_Preferences::DblSpin, "VISU", "scalar_range_max" );
- setPreferenceProperty( min, "step", 0.1 );
- setPreferenceProperty( max, "step", 0.1 );
+ int min = addPreference( tr( "VISU_MIN" ), imposedGr, LightApp_Preferences::Double, "VISU", "scalar_range_min" );
+ int max = addPreference( tr( "VISU_MAX" ), imposedGr, LightApp_Preferences::Double, "VISU", "scalar_range_max" );
+ setPreferenceProperty( min, "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
+ setPreferenceProperty( max, "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
// group: "Font"
int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab );
setPreferenceProperty( numcol, "max", 256 );
addPreference( tr( "VISU_IS_UNITS" ), colorsLabelsGr,
- LightApp_Preferences::Bool, "VISU", "scalar_bar_display_units" );
+ LightApp_Preferences::Bool, "VISU", "scalar_bar_display_units" );
int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" );
setPreferenceProperty( lPrec, "min", 1 );
setPreferenceProperty( lPrec, "max", 100 );
-
+
int frame = addPreference( "", sbarTab, LightApp_Preferences::Frame, "", "" );
- setPreferenceProperty( frame, "orientation", "horizontal" );
+ //setPreferenceProperty( frame, "orientation", "vertical" );
+ setPreferenceProperty( frame, "columns", "2" );
// group: "Orientation"
int orientGr = addPreference( tr( "VISU_ORIENTATION" ), frame, LightApp_Preferences::GroupBox );
// group: "Origin & Size Vertical"
- int psSzFrame = addPreference( "", sbarTab, LightApp_Preferences::Frame, "", "" );
- setPreferenceProperty( psSzFrame, "orientation", "horizontal" );
+ //int psSzFrame = addPreference( "", sbarTab, LightApp_Preferences::Frame, "", "" );
+ //setPreferenceProperty( psSzFrame, "orientation", "horizontal" );
+ //setPreferenceProperty( psSzFrame, "columns", "2" );
int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ),
- psSzFrame, LightApp_Preferences::GroupBox );
+ frame, LightApp_Preferences::GroupBox );
setPreferenceProperty( posVSizeGr, "columns", 2 );
int xv = addPreference( tr( "VISU_X" ), posVSizeGr,
LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
int twv = addPreference( tr( "VISU_TITLE_SIZE" ), posVSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_title_size" );
-
+
int lwv = addPreference( tr( "VISU_LABEL_SIZE" ), posVSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_label_size" );
-
+
int bwv = addPreference( tr( "VISU_BAR_WIDTH" ), posVSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_bar_width" );
int bhv = addPreference( tr( "VISU_BAR_HEIGHT" ), posVSizeGr,
// group: "Origin & Size Horizontal"
int posHSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_HORIZONTAL" ),
- psSzFrame, LightApp_Preferences::GroupBox );
+ frame, LightApp_Preferences::GroupBox );
setPreferenceProperty( posHSizeGr, "columns", 2 );
int xh = addPreference( tr( "VISU_X" ), posHSizeGr,
int twh = addPreference( tr( "VISU_TITLE_SIZE" ), posHSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_title_size" );
-
+
int lwh = addPreference( tr( "VISU_LABEL_SIZE" ), posHSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_label_size" );
-
+
int bwh = addPreference( tr( "VISU_BAR_WIDTH" ), posHSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_bar_width" );
int bhh = addPreference( tr( "VISU_BAR_HEIGHT" ), posHSizeGr,
setPreferenceProperty( bhh, "max", 100 );
// TAB: "CutLines"
- int cutLineTab = addPreference( tr( "CutLines" ) );
+ int cutLineTab = addPreference( tr( "VISU_CUT_LINES_SEGMENT" ) );
// group: "CutLines preferences"
- int cutLineGr = addPreference( tr( "VISU_CUTLINE_PREF" ), cutLineTab );
+ int cutLineGr = addPreference( tr( "VISU_CUT_LINES_SEGMENT_PREF" ), cutLineTab );
setPreferenceProperty( cutLineGr, "columns", 1 );
addPreference( tr( "Show preview" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "show_preview" );
addPreference( tr( "Invert all curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "invert_all_curves" );
addPreference( tr( "Generate data table" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_data_table" );
addPreference( tr( "Generate curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_curves" );
+ // TAB: "StreamLines"
+ int streamLinesTab = addPreference( tr( "VISU_STREAM_LINES" ) );
+
+ // group: "StreamLines preferences"
+ int streamLinesGr = addPreference( tr( "VISU_STREAM_LINES_PREF" ), streamLinesTab );
+ setPreferenceProperty( cutLineGr, "columns", 1 );
+ int usedPoints = addPreference( tr( "VISU_STREAM_LINES_USED_POINTS" ), streamLinesGr,
+ LightApp_Preferences::DblSpin, "VISU", "stream_lines_used_points" );
+ setPreferenceProperty( usedPoints, "min", 0 );
+ setPreferenceProperty( usedPoints, "max", 1 );
+ setPreferenceProperty( usedPoints, "step", 0.1 );
+
// TAB: "Sweep, Animation, 3D Cache"
int animationTab = addPreference( tr( "Sweep, Animation" ) );
{
{
int cacheGroup = addPreference( tr( "VISU_3DCACHE_PREFERENCES" ), animationTab );
setPreferenceProperty( cacheGroup, "columns", 2 );
-
+
int memory_mode = addPreference( tr( "VISU_MEMORY_MODE" ), cacheGroup,
- LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
-
+ LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
+
modes.clear();
modes.append( tr( "VISU_MINIMAL" ) );
modes.append( tr( "VISU_LIMITED" ) );
setPreferenceProperty( memory_mode, "strings", modes );
-
+
indices.clear();
indices.append( 0 );
indices.append( 1 );
setPreferenceProperty( memory_mode, "indexes", indices );
-
+
int memory_limit = addPreference( tr( "VISU_MEMORY_LIMIT" ), cacheGroup,
- LightApp_Preferences::IntSpin, "VISU", "cache_memory_limit" );
+ LightApp_Preferences::IntSpin, "VISU", "cache_memory_limit" );
setPreferenceProperty( memory_limit, "min", 1 );
setPreferenceProperty( memory_limit, "max", 5000 );
setPreferenceProperty( memory_limit, "step", 10 );
// group: "Animation preferences"
{
int animationGroup = addPreference( tr( "VISU_ANIMATION_PREFERENCES" ), animationTab );
- setPreferenceProperty( animationGroup, "columns", 3 );
-
- int speed = addPreference( tr( "Speed" ), animationGroup, LightApp_Preferences::IntSpin, "VISU", "speed" );
- addPreference( tr( "Cycled animation" ), animationGroup, LightApp_Preferences::Bool, "VISU", "cycled_animation" );
- addPreference( tr( "Use proportional timing" ), animationGroup, LightApp_Preferences::Bool, "VISU", "use_proportional_timing" );
- addPreference( tr( "Clean memory at each frame" ), animationGroup, LightApp_Preferences::Bool, "VISU", "clean_memory_at_each_frame" );
-
+ setPreferenceProperty( animationGroup, "columns", 1 );
+
+ int speed = addPreference( tr( "Speed" ), animationGroup,
+ LightApp_Preferences::IntSpin, "VISU", "speed" );
+ addPreference( tr( "Cycled animation" ), animationGroup,
+ LightApp_Preferences::Bool, "VISU", "cycled_animation" );
+ addPreference( tr( "Use proportional timing" ), animationGroup,
+ LightApp_Preferences::Bool, "VISU", "use_proportional_timing" );
+ addPreference( tr( "Clean memory at each frame" ), animationGroup,
+ LightApp_Preferences::Bool, "VISU", "clean_memory_at_each_frame" );
+
setPreferenceProperty( speed, "min", 1 );
setPreferenceProperty( speed, "max", 99 );
+
+ int dump_mode = addPreference( tr( "VISU_DUMP_MODE" ), animationGroup,
+ LightApp_Preferences::Selector, "VISU", "dump_mode" );
+
+ modes.clear();
+ modes.append( tr( "VISU_NO_DUMP" ) );
+ modes.append( tr( "VISU_DUMP_PICTURES" ) );
+ modes.append( tr( "VISU_DUMP_VIDEO" ) );
+ setPreferenceProperty( dump_mode, "strings", modes );
+
+ indices.clear();
+ indices.append( 0 );
+ indices.append( 1 );
+ indices.append( 2 );
+ setPreferenceProperty( dump_mode, "indexes", indices );
+
+ int time_stamp_frequency = addPreference( tr( "VISU_TIME_STAMP_FREQUENCY" ), animationGroup,
+ LightApp_Preferences::IntSpin, "VISU", "time_stamp_frequency" );
+ setPreferenceProperty( time_stamp_frequency, "min", 1 );
+ setPreferenceProperty( time_stamp_frequency, "max", 100 );
}
// group: "Sweeping preferences"
{
int sweepGroup = addPreference( tr( "VISU_SWEEPING_PREF" ), animationTab );
setPreferenceProperty( sweepGroup, "columns", 2 );
-
- int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGroup, LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
+
+ int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGroup,
+ LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
QStringList sweep_modes;
sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) );
sweep_modes.append( tr( "VISU_COS_SWEEP" ) );
indices.append( 2 );
setPreferenceProperty( modeSw, "strings", sweep_modes );
setPreferenceProperty( modeSw, "indexes", indices );
-
+
int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGroup,
- LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
+ LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
/* int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGroup,
- LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );*/
+ LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );*/
int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGroup,
- LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
+ LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
int rangeSw = addPreference( tr( "VISU_IS2PI" ), sweepGroup, LightApp_Preferences::Selector, "VISU", "sweeping_is2PI" );
QStringList ranges;
ranges.append( tr( "PERIOD_PI" ) );
indices.append( 1 );
setPreferenceProperty( rangeSw, "strings", ranges );
setPreferenceProperty( rangeSw, "indexes", indices );
-
+
setPreferenceProperty( timestep, "min", 0.1 );
setPreferenceProperty( timestep, "step", 0.1 );
setPreferenceProperty( timestep, "max", 1000 );
setPreferenceProperty( representGr, "columns", 2 );
QStringList mesh_modes;
- mesh_modes.append( "Points" );
- mesh_modes.append( "Wireframe" );
- mesh_modes.append( "Insideframe" );
- mesh_modes.append( "Surfaceframe" );
- mesh_modes.append( "Surface" );
- mesh_modes.append( "Feature edges" );
+ mesh_modes.append( tr("MEN_POINTS") );
+ mesh_modes.append( tr("MEN_WIREFRAME") );
+ mesh_modes.append( tr("MEN_INSIDEFRAME") );
+ mesh_modes.append( tr("MEN_SURFACEFRAME") );
+ mesh_modes.append( tr("MEN_SURFACE") );
+ mesh_modes.append( tr("VISU_FEATURE_EDGES") );
QList<QVariant> mesh_indices;
mesh_indices.append( 0 );
mesh_indices.append( 1 );
addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_map_shrink" );
int iso_surfaces_represent = addPreference( tr( "VISU_ISO_SURFACES" ), representGr, LightApp_Preferences::Selector, "VISU", "iso_surfaces_represent" );
- setPreferenceProperty( iso_surfaces_represent, "strings", modes2 );
- setPreferenceProperty( iso_surfaces_represent, "indexes", indices2 );
+ setPreferenceProperty( iso_surfaces_represent, "strings", modes1 );
+ setPreferenceProperty( iso_surfaces_represent, "indexes", indices1 );
int sp = addPreference( "", representGr, LightApp_Preferences::Space );
setPreferenceProperty( sp, "hstretch", 0 );
setPreferenceProperty( sp, "vstretch", 0 );
int cut_planes_represent = addPreference( tr( "VISU_CUT_PLANES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_planes_represent" );
- setPreferenceProperty( cut_planes_represent, "strings", modes2 );
- setPreferenceProperty( cut_planes_represent, "indexes", indices2 );
+ setPreferenceProperty( cut_planes_represent, "strings", modes1 );
+ setPreferenceProperty( cut_planes_represent, "indexes", indices1 );
addPreference( "", representGr, LightApp_Preferences::Space );
int cut_lines_represent = addPreference( tr( "VISU_CUT_LINES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_lines_represent" );
setPreferenceProperty( sp, "hstretch", 0 );
setPreferenceProperty( sp, "vstretch", 0 );
+ int cut_segment_represent = addPreference( tr( "VISU_CUT_SEGMENT" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_segment_represent" );
+ setPreferenceProperty( cut_segment_represent, "strings", modes3 );
+ setPreferenceProperty( cut_segment_represent, "indexes", indices3 );
+ sp = addPreference( "", representGr, LightApp_Preferences::Space );
+ setPreferenceProperty( sp, "hstretch", 0 );
+ setPreferenceProperty( sp, "vstretch", 0 );
+
int deformed_shape_represent = addPreference( tr( "VISU_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "deformed_shape_represent" );
setPreferenceProperty( deformed_shape_represent, "strings", modes0 );
setPreferenceProperty( deformed_shape_represent, "indexes", indices0 );
setPreferenceProperty( sp, "vstretch", 0 );
int plot3d_represent = addPreference( tr( "VISU_PLOT3D" ), representGr, LightApp_Preferences::Selector, "VISU", "plot3d_represent" );
- setPreferenceProperty( plot3d_represent, "strings", modes2 );
- setPreferenceProperty( plot3d_represent, "indexes", indices2 );
+ setPreferenceProperty( plot3d_represent, "strings", modes1 );
+ setPreferenceProperty( plot3d_represent, "indexes", indices1 );
sp = addPreference( "", representGr, LightApp_Preferences::Space );
setPreferenceProperty( sp, "hstretch", 0 );
setPreferenceProperty( sp, "vstretch", 0 );
setPreferenceProperty( scalar_def_represent, "indexes", indices1 );
addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" );
- int point_precision = addPreference( tr( "VISU_FLOATING_POINT_PRECISION" ), representGr,
- LightApp_Preferences::IntSpin, "VISU", "floating_point_precision" );
- setPreferenceProperty( point_precision, "min", 1 );
- setPreferenceProperty( point_precision, "max", 16 );
- setPreferenceProperty( point_precision, "step", 1 );
+ int quadraticmode = addPreference( tr( "QUADRATIC_REPRESENT_MODE" ), representGr, LightApp_Preferences::Selector, "VISU", "quadratic_mode" );
+ QStringList quadraticModes;
+ quadraticModes.append("Lines");
+ quadraticModes.append("Arcs");
+ indices.clear();
+ indices.append( 0 );
+ indices.append( 1 );
+ setPreferenceProperty( quadraticmode, "strings", quadraticModes );
+ setPreferenceProperty( quadraticmode, "indexes", indices );
+
+ int maxAngle = addPreference( tr( "MAX_ARC_ANGLE" ), representGr, LightApp_Preferences::IntSpin,
+ "VISU", "max_angle" );
+ setPreferenceProperty( maxAngle, "min", 1 );
+ setPreferenceProperty( maxAngle, "max", 90 );
+
+ int elem0DSize = addPreference( tr( "VISU_ELEM0D_SIZE" ), representGr, LightApp_Preferences::IntSpin, "VISU", "elem0d_size" );
+ setPreferenceProperty( elem0DSize, "min", 1 );
+ setPreferenceProperty( elem0DSize, "max", 10 );
+ addPreference( "", representGr, LightApp_Preferences::Space );
+
+ int shrFac = addPreference( tr( "VISU_SHRINK_FACTOR" ), representGr, LightApp_Preferences::IntSpin, "VISU", "shrink_factor" );
+ setPreferenceProperty( shrFac, "min", 20 );
+ setPreferenceProperty( shrFac, "max", 100 );
+ sp = addPreference( "", representGr, LightApp_Preferences::Space );
+ setPreferenceProperty( sp, "hstretch", 0 );
+ setPreferenceProperty( sp, "vstretch", 0 );
+
+ addPreference( tr( "VISU_EDGE_COLOR" ), representGr, LightApp_Preferences::Color, "VISU", "edge_color" );
addPreference( "", representGr, LightApp_Preferences::Space );
+ int typeOfMarker = addPreference( tr( "VISU_TYPE_OF_MARKER" ), representGr, LightApp_Preferences::Selector, "VISU", "type_of_marker" );
+
+ QList<QVariant> aMarkerTypeIndicesList;
+ QList<QVariant> aMarkerTypeIconsList;
+ for ( int i = VTK::MT_POINT; i <= VTK::MT_O_X; i++ ) {
+ QString icoFile = QString( "ICON_VERTEX_MARKER_%1" ).arg( i );
+ QPixmap pixmap = aResourceMgr->loadPixmap( "VTKViewer", tr( qPrintable( icoFile ) ) );
+ aMarkerTypeIndicesList << i;
+ aMarkerTypeIconsList << pixmap;
+ }
+ aMarkerTypeIndicesList << VTK::MT_POINT_SPRITE;
+ aMarkerTypeIconsList << aResourceMgr->loadPixmap( "VISU", tr( "ICON_POINT_SPRITE" ) );
+ setPreferenceProperty( typeOfMarker, "indexes", aMarkerTypeIndicesList );
+ setPreferenceProperty( typeOfMarker, "icons", aMarkerTypeIconsList );
+
+ int markerScale = addPreference( tr( "VISU_MARKER_SCALE" ), representGr, LightApp_Preferences::Selector, "VISU", "marker_scale" );
+
+ QList<QVariant> aMarkerScaleIndicesList;
+ QStringList aMarkerScaleValuesList;
+ for ( int i = VISU::MS_10; i <= VISU::MS_70; i++ ) {
+ aMarkerScaleIndicesList << i;
+ aMarkerScaleValuesList << QString::number( (i-(int)VISU::MS_10)*0.5 + 1.0 );
+ }
+ setPreferenceProperty( markerScale, "strings", aMarkerScaleValuesList );
+ setPreferenceProperty( markerScale, "indexes", aMarkerScaleIndicesList );
+
addPreference( tr( "VISU_USE_SHADING" ), representGr, LightApp_Preferences::Bool, "VISU", "represent_shading" );
sp = addPreference( "", representGr, LightApp_Preferences::Space );
setPreferenceProperty( sp, "hstretch", 0 );
addPreference( tr( "VISU_AUTOMATIC_FIT_ALL" ), representGr,
LightApp_Preferences::Bool, "VISU", "automatic_fit_all" );
+ // TAB: Tables ; group: "Tables editing properties"
+ int tablesTab = addPreference( tr( "VISU_TABLES" ) );
+
+ int tablesGr = addPreference( tr( "VISU_TABLES_EDITING_PROPS" ), tablesTab );
+ setPreferenceProperty( tablesGr, "columns", 1 );
+
+ addPreference( tr( "VISU_TABLES_ENABLE_EDITING" ), tablesGr, LightApp_Preferences::Bool, "VISU", "tables_enable_editing" );
+
+ int sortPolicyPref = addPreference( tr( "VISU_TABLES_SORT_POLICY" ), tablesGr, LightApp_Preferences::Selector, "VISU", "tables_sort_policy" );
+ QStringList policies;
+ policies.append( tr( "VISU_TABLES_EMPTY_LOWEST" ) );
+ policies.append( tr( "VISU_TABLES_EMPTY_HIGHEST" ) );
+ policies.append( tr( "VISU_TABLES_EMPTY_FIRST" ) );
+ policies.append( tr( "VISU_TABLES_EMPTY_LAST" ) );
+ policies.append( tr( "VISU_TABLES_EMPTY_IGNORE" ) );
+ indices.clear();
+ indices.append( 0 );
+ indices.append( 1 );
+ indices.append( 2 );
+ indices.append( 3 );
+ indices.append( 4 );
+ setPreferenceProperty( sortPolicyPref, "strings", policies );
+ setPreferenceProperty( sortPolicyPref, "indexes", indices );
+
// TAB: Feature edges ; group: "Feature edges properties"
int featureEdgesTab = addPreference( tr( "VISU_FEATURE_EDGES" ) );
setPreferenceProperty( featureEdgesGr, "columns", 2 );
int featureEdgesAnglePref = addPreference( tr( "VISU_FEATURE_EDGES_ANGLE" ), featureEdgesGr,
- LightApp_Preferences::DblSpin, "VISU", "feature_edges_angle" );
+ LightApp_Preferences::DblSpin, "VISU", "feature_edges_angle" );
setPreferenceProperty( featureEdgesAnglePref, "step", 10.0 );
setPreferenceProperty( featureEdgesAnglePref, "min", 0.0 );
setPreferenceProperty( featureEdgesAnglePref, "max", 90.0 );
addPreference( tr( "VISU_SHOW_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_manifold_edges" );
addPreference( tr( "VISU_SHOW_NON_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_non_manifold_edges" );
//addPreference( tr( "VISU_FEATURE_EDGES_COLORING" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "feature_edges_coloring" );
-
+
// TAB: "Values labels"
-
+
int valLblTab = addPreference( tr( "VALUES_LABELING" ) );
// "Font" group
addVtkFontPref( tr( "LABELS" ), valLblFontGr, "values_labeling_font", true );
// color
- addPreference( tr( "COLOR" ), valLblFontGr,
+ addPreference( tr( "COLOR" ), valLblFontGr,
LightApp_Preferences::Color, "VISU", "values_labeling_color" );
}
aResourceMgr->setValue("VISU", "scalar_bar_horizontal_y", sbY1);
aResourceMgr->setValue("VISU", "scalar_bar_horizontal_height",sbH);
}
- }
-
+ }
+ else if(b == "visual_data_precision") {
+ LightApp_Preferences* pref = preferences();
+ QtxPreferenceItem* min = pref->findItem( tr( "VISU_MIN" ), true );
+ QtxPreferenceItem* max = pref->findItem( tr( "VISU_MAX" ), true );
+ if ( min )
+ setPreferenceProperty( min->id(), "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
+ if ( max )
+ setPreferenceProperty( max->id(), "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
+ }
+
if ( !aWarning.isEmpty() ){
aWarning += "The default values are applied instead.";
SUIT_MessageBox::warning(GetDesktop(this),
SUIT_ViewManager*
VisuGUI
::getViewManager(const QString& theType,
- const bool theIsCreate)
+ const bool theIsCreate)
{
return getApp()->getViewManager(theType,theIsCreate);
}
if (!anIO.IsNull() && anIO->hasEntry()) {
aSObject = aCStudy->FindObjectID(anIO->getEntry());
if ( !aSObject )
- continue;
+ continue;
VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
if (aPrsObject->GetType() == VISU::TCUTPLANES) {
- aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
- if (aCutPrs)
- break;
+ aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
+ if (aCutPrs)
+ break;
}
}
}
Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aTimeStampSObj);
VISU::VISUType aType = VISU::Storable::RestoringMap2Type( aRestoringMap );
if (aType != TTIMESTAMP )
- return;
+ return;
QString aMeshName = aRestoringMap["myMeshName"];
QString anEntity = aRestoringMap["myEntityId"];
int aPos;
SUIT_ViewWindow* aViewWindow = 0;
// if (anIsVVTK) {
-// aViewWindow = GetViewWindow<VVTK_Viewer>(this);
-// aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<VVTK_ViewWindow*>(aViewWindow));
+// aViewWindow = GetViewWindow<VVTK_Viewer>(this);
+// aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<VVTK_ViewWindow*>(aViewWindow));
// } else {
- aViewWindow = GetViewWindow<SVTK_Viewer>(this);
- aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<SVTK_ViewWindow*>(GetViewWindow<SVTK_Viewer>(this)));
- // }
+ aViewWindow = GetViewWindow<SVTK_Viewer>(this);
+ aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<SVTK_ViewWindow*>(GetViewWindow<SVTK_Viewer>(this)));
+ // }
GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos);
VISU::Plot3D_i* aPrs3d =
CreatePrs3dFromFactory<VISU::Plot3D_i>(this,
- aTimeStampSObj,
- (const char*)aMeshName.toLatin1(),
- (Entity)anEntity.toInt(),
- (const char*)aFieldName.toLatin1(),
- aTimeStampId.toInt(),
- ColoredPrs3d_i::EPublishUnderTimeStamp);
+ aTimeStampSObj,
+ (const char*)aMeshName.toLatin1(),
+ (Entity)anEntity.toInt(),
+ (const char*)aFieldName.toLatin1(),
+ aTimeStampId.toInt(),
+ ColoredPrs3d_i::EPublishUnderTimeStamp);
if (aPrs3d) {
- SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
- int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
- if (!aValue) {
- VisuGUI_Plot3DDlg* aDlg = new VisuGUI_Plot3DDlg(this);
- aDlg->initFromPrsObject(aPrs3d, true);
- int aOrient = aCutPrs->GetOrientationType(); // Plot3d has the same orientation type
- double aRotX = aCutPrs->GetRotateX();
- double aRotY = aCutPrs->GetRotateY();
- double aPlanePos = aCutPrs->GetPlanePosition(0);
- aDlg->setPlane(aOrient, aRotX, aRotY, aPlanePos);
-
- if (!(runAndWait(aDlg, 0) && (aDlg->storeToPrsObject(aPrs3d)))) {
- DeletePrs3d(this, aPrs3d);
- delete aDlg;
- return;
- }
- delete aDlg;
- UpdateObjBrowser(this, true, aTimeStampSObj);
- }
- SVTK_ViewWindow* aSVtkWindow = dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
- if ( aSVtkWindow ) {
- PublishInView(this, aPrs3d, aSVtkWindow, /*highlight = */true);
- aSVtkWindow->onFitAll();
+ SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
+ int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
+ if (!aValue) {
+ VisuGUI_Plot3DDlg* aDlg = new VisuGUI_Plot3DDlg(this);
+ aDlg->initFromPrsObject(aPrs3d, true);
+ int aOrient = aCutPrs->GetOrientationType(); // Plot3d has the same orientation type
+ double aRotX = aCutPrs->GetRotateX();
+ double aRotY = aCutPrs->GetRotateY();
+ double aPlanePos = aCutPrs->GetPlanePosition(0);
+ aDlg->setPlane(aOrient, aRotX, aRotY, aPlanePos);
+
+ if (!(runAndWait(aDlg, 0) && (aDlg->storeToPrsObject(aPrs3d)))) {
+ DeletePrs3d(this, aPrs3d);
+ delete aDlg;
+ return;
+ }
+ delete aDlg;
+ UpdateObjBrowser(this, true, aTimeStampSObj);
+ }
+ SVTK_ViewWindow* aSVtkWindow = dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
+ if ( aSVtkWindow ) {
+ PublishInView(this, aPrs3d, aSVtkWindow, /*highlight = */true);
+ aSVtkWindow->onFitAll();
- AddScalarBarPosition(this, aSVtkWindow, aPrs3d, aPos);
- }
- if (aPrs3d)
- emit presentationCreated(aPrs3d);
+ AddScalarBarPosition(this, aSVtkWindow, aPrs3d, aPos);
+ }
+ processPresentationCreated(aPrs3d);
}
}
application()->putInfo(QObject::tr("INF_DONE"));
QFileInfo aFileInfo =
SUIT_FileDlg::getFileName(GetDesktop(this),
- aPath,
- aFilter,
- tr("MEN_EXPORT_MED"), // "Export To Med File"
- false);
+ aPath,
+ aFilter,
+ tr("VISU_MEN_EXPORT_MED"), // "Export To Med File"
+ false);
QString aFile = aFileInfo.filePath();
if ( aFile.length() > 0 ) {
}
/*!
- \brief SLOT called when "Labeling" popup menu item of presentation is clicked
- activates/deactivates labeling of results of the screen. This functionality works
- to numbering in SMESH module but is intended for showing results on the screen
+ \brief SLOT called when "Labeling" popup menu item of presentation is clicked
+ activates/deactivates labeling of results of the screen. This functionality works
+ to numbering in SMESH module but is intended for showing results on the screen
instead of elements numbers
\sa OnValuesLabelingParams()
*/
TSelectionItem aSelectionItem = GetSelectedObjects(this).front();
VISU::Prs3d_i* aPrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
- if(!aPrs3d)
+ if (!aPrs3d)
return;
SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this);
- if(!aViewWindow)
+ if (!aViewWindow)
return;
VISU_Actor* anActor = FindActor(aViewWindow, aPrs3d);
- if(!anActor)
+ if (!anActor)
return;
- if( VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor) )
+ if ( VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor) )
{
aScalarMapActor->SetValuesLabeled( !aScalarMapActor->GetValuesLabeled() );
aViewWindow->Repaint();
}
- else if( VISU_GaussPtsAct* aGaussPtsAct = dynamic_cast<VISU_GaussPtsAct*>(anActor) )
+ else if ( VISU_GaussPtsAct* aGaussPtsAct = dynamic_cast<VISU_GaussPtsAct*>(anActor) )
{
aGaussPtsAct->SetValuesLabeled( !aGaussPtsAct->GetValuesLabeled() );
aViewWindow->Repaint();
}
/*!
- \brief SLOT called when "Labeling parameters" popup menu item of presentation
+ \brief SLOT called when "Labeling parameters" popup menu item of presentation
is clicked launch dialog box for changing parameters of labeling
\sa OnValuesLabeling()
*/
{
Handle(SALOME_InteractiveObject) anIO;
if ( VISU::Prs3d_i* aPrs3d = GetPrsToModify( this, anIO ) )
- EditPrs3d<VISU::ColoredPrs3d_i, VisuGUI_ValuesLabelingDlg, 1>(this, anIO, aPrs3d);
+ EditPrs3d<VISU::ColoredPrs3d_i, VisuGUI_ValuesLabelingDlg, 1>(this, anIO, aPrs3d);
}
/*!
\brief Adds preferences for dfont of VTK viewer
\param param parameter
\return identifier of preferences
*/
-int VisuGUI::addVtkFontPref(
- const QString& label,
- const int pId,
- const QString& param,
+int VisuGUI::addVtkFontPref(
+ const QString& label,
+ const int pId,
+ const QString& param,
const bool useSize )
{
int tfont = addPreference( label, pId, LightApp_Preferences::Font, "VISU", param );
-
+
setPreferenceProperty( tfont, "mode", QtxFontEdit::Custom );
QStringList fam;
return tfont;
}
+
+/*!
+ \brief SLOT called when "2D Quadratic -> Arcs" popup menu item
+ \ of presentation is cliked
+ */
+void VisuGUI::OnArcQuadMode(){
+ ChangeQuadratic2DRepresentation(this,VISU::ARCS);
+}
+
+/*!
+ \brief SLOT called when "2D Quadratic -> Lines" popup menu item
+ \ of presentation is cliked
+ */
+void VisuGUI::OnLineQuadMode(){
+ ChangeQuadratic2DRepresentation(this,VISU::LINES);
+}
+
+/*!
+ \brief Return \c true if object can be renamed
+*/
+bool VisuGUI::renameAllowed( const QString& entry) const {
+
+ SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ SalomeApp_Study* appStudy = app ? dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) : 0;
+ SalomeApp_DataObject* obj = appStudy ? dynamic_cast<SalomeApp_DataObject*>(appStudy->findObjectByEntry(entry)) : 0;
+
+ if(!app || !appStudy || !obj)
+ return false;
+
+ if(appStudy->isComponent(entry) || obj->isReference())
+ return false;
+
+
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry( GetAppStudy(this), qPrintable(entry) );
+ VISU::Base_i* aBase = anObjectInfo.myBase;
+ if(aBase){
+ VISU::VISUType aType = aBase->GetType();
+ if( aType == VISU::TCOLOREDPRS3DHOLDER ) {
+ CORBA::Object_var anObject = ClientSObjectToObject(anObjectInfo.mySObject);
+ VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
+ aType = aHolder->GetPrsType();
+ }
+ if (aType == VISU::TSCALARMAP || aType == VISU::TISOSURFACES ||
+ aType == VISU::TDEFORMEDSHAPE || aType == VISU::TCUTPLANES ||
+ aType == VISU::TCUTLINES || aType == VISU::TCUTSEGMENT || aType == VISU::TVECTORS ||
+ aType == VISU::TSTREAMLINES || aType == VISU::TPLOT3D ||
+ aType == VISU::TSCALARMAPONDEFORMEDSHAPE || aType == VISU::TCOLOREDPRS3DHOLDER ||
+ aType == VISU::TTABLE || aType == VISU::TCURVE || aType == VISU::TCONTAINER ||
+ aType == VISU::TPOINTMAP3D || aType == VISU::TVIEW3D ||
+ aType == VISU::TPOINTMAP3D || aType == VISU::TGAUSSPOINTS)
+ return true;
+ } else {
+ VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
+ bool anIsExist;
+ QString aVal = VISU::Storable::FindValue(aMap, "myComment", &anIsExist);
+ return anIsExist && "VIEW3D" == aVal;
+ }
+ return false;
+}
+
+void VisuGUI::OnShowDeviation() {
+
+ if(IsStudyLocked(GetCStudy(GetAppStudy(this))))
+ return;
+
+ QAction* anAction = action(VISU_SHOW_DEVIATION);
+ if(!anAction)
+ return;
+
+ bool anIsShow = anAction->isChecked();
+
+ VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
+ if(aSelectionInfo.empty())
+ return;
+
+ TSelectionInfo::iterator anIter = aSelectionInfo.begin();
+ for( ; anIter != aSelectionInfo.end(); anIter++ )
+ {
+ VISU::TSelectionItem aSelectionItem = *anIter;
+ Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
+ VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
+ if(aBase && aBase->GetType() == VISU::TCURVE) {
+ // Curve object
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBase)) {
+ aCurve->ShowDeviation(anIsShow);
+ if( displayer()->IsDisplayed( anIO->getEntry() ) )
+ PlotCurve(this, aCurve, VISU::eDisplay);
+ }
+ }
+ }
+}
+
+/*!
+ Rename object by entry.
+ \param entry entry of the object
+ \param name new name of the object
+ \brief Return \c true if rename operation finished successfully, \c false otherwise.
+*/
+bool VisuGUI::renameObject( const QString& entry, const QString& name) {
+
+ SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication());
+ SalomeApp_Study* appStudy = app ? dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) : 0;
+
+ if(!appStudy)
+ return false;
+
+ _PTR(Study) aStudy = appStudy->studyDS();
+
+ if(!aStudy)
+ return false;
+
+ bool aLocked = (_PTR(AttributeStudyProperties)(appStudy->studyDS()->GetProperties()))->IsLocked();
+ if ( aLocked ) {
+ SUIT_MessageBox::warning ( app->desktop(), QObject::tr("WRN_WARNING"), QObject::tr("WRN_STUDY_LOCKED") );
+ return false;
+ }
+
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this) , qPrintable(entry) );
+
+ _PTR(SObject) aSObject = anObjectInfo.mySObject;
+ if (aSObject) {
+ VISU::Base_i* aBase = anObjectInfo.myBase;
+ VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
+ if(aBase){
+ VISU::VISUType aType = aBase->GetType();
+ if( aType == VISU::TCOLOREDPRS3DHOLDER ) {
+ CORBA::Object_var anObject = ClientSObjectToObject(anObjectInfo.mySObject);
+ VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
+ aType = aHolder->GetPrsType();
+ }
+ if (aType == VISU::TSCALARMAP || aType == VISU::TISOSURFACES ||
+ aType == VISU::TDEFORMEDSHAPE || aType == VISU::TCUTPLANES ||
+ aType == VISU::TCUTLINES || aType == VISU::TCUTSEGMENT || aType == VISU::TVECTORS ||
+ aType == VISU::TSTREAMLINES || aType == VISU::TPLOT3D ||
+ aType == VISU::TSCALARMAPONDEFORMEDSHAPE || aType == VISU::TCOLOREDPRS3DHOLDER ||
+ aType == VISU::TTABLE || aType == VISU::TCURVE || aType == VISU::TCONTAINER ||
+ aType == VISU::TPOINTMAP3D || aType == VISU::TVIEW3D ||
+ aType == VISU::TPOINTMAP3D || aType == VISU::TGAUSSPOINTS) {
+ _PTR(GenericAttribute) anAttr;
+ if (aSObject->FindAttribute(anAttr, "AttributeName")) {
+ _PTR(AttributeName) aName (anAttr);
+ if (!name.isEmpty()) {
+ QApplication::setOverrideCursor(Qt::WaitCursor);
+ // rename specific objects
+ if (VISU::Base_i* aBase = anObjectInfo.myBase) {
+ switch (aBase->GetType()) {
+ case VISU::TCURVE: { // Curve object
+ if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBase))
+ aCurve->SetName(qPrintable(name), true);
+ break;
+ }
+ case VISU::TTABLE: { // Table object
+ if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase))
+ aTable->SetName(qPrintable(name), true);
+ break;
+ }
+ case VISU::TPOINTMAP3D: { // Table object
+ if (VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(aBase)) {
+ aTable3d->SetTitle(qPrintable(name));
+ aTable3d->UpdateActors();
+ }
+ break;
+ }
+ case VISU::TCONTAINER: { // Container object
+ if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase))
+ aContainer->SetName(qPrintable(name), true);
+ break;
+ }
+ default: {
+ }}
+ }
+
+ // rename the study object
+ aName->SetValue( qPrintable(name) ); // rename the SObject
+
+ ViewManagerList aViewManagerList;
+ getApp()->viewManagers(SPlot2d_Viewer::Type(), aViewManagerList);
+ SUIT_ViewManager* aViewManager;
+ Handle(SALOME_InteractiveObject) anIO =
+ new SALOME_InteractiveObject ( qPrintable(entry), "VISU", qPrintable(name) );
+ foreach( aViewManager, aViewManagerList ) {
+ if (Plot2d_ViewManager* aManager = dynamic_cast<Plot2d_ViewManager*>(aViewManager)) {
+ if (SPlot2d_Viewer* aViewer = dynamic_cast<SPlot2d_Viewer*>(aManager->getViewModel()))
+ aViewer->renameAll( anIO, qPrintable(name) );
+ }
+ }
+ QApplication::restoreOverrideCursor();
+ return true;
+ }
+ }
+ //Rename visual params
+ }
+ } else {
+ bool anIsExist;
+ QString aVal = VISU::Storable::FindValue(aMap, "myComment", &anIsExist);
+ if(anIsExist && "VIEW3D" == aVal) {
+ _PTR(GenericAttribute) anAttr;
+ if (aSObject->FindAttribute(anAttr, "AttributeName")) {
+ _PTR(AttributeName) aName (anAttr);
+ if (!name.isEmpty()) {
+ aName->SetValue(qPrintable(name));
+ }
+ }
+ }
+ }
+ }
+ return false;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI.h
// Author : Laurent CORNABE & Hubert ROLLAND
// Module : VISU
-
+//
#ifndef VisuGUI_HeaderFile
#define VisuGUI_HeaderFile
public:
enum PanelId { SelectionPanelId = 0,
- FeatureEdgesPanelId,
+ FeatureEdgesPanelId,
ClippingPlanesPanelId };
public:
virtual
SUIT_ViewManager*
getViewManager(const QString& theType,
- const bool theIsCreate);
+ const bool theIsCreate);
VISU::TViewToPrs3d&
getScalarBarsMap();
+ virtual bool renameAllowed( const QString& ) const;
+ virtual bool renameObject( const QString&, const QString& );
+
+
signals:
void moduleDeactivated();
void moduleActivated();
protected slots:
void OnImportFromFile();
+ void OnImportFromSauvFile();
void OnImportTableFromFile();
void OnExportTableToFile();
void OnImportMedField();
void OnCreateIsoSurfaces();
void OnCreateCutPlanes();
void OnCreateCutLines();
+ void OnCreateCutSegment();
void OnCreateStreamLines();
void OnCreatePlot3D();
void OnCreateManyMesh();
void OnEditDeformedShape();
void OnEditCutPlanes();
void OnEditCutLines();
+ void OnEditCutSegment();
void OnEditIsoSurfaces();
void OnEditVectors();
void OnEditStreamLines();
void OnChangeWireframeColor();
void OnChangeOpacity();
void OnChangeLines();
+ void OnChangePointMarker();
+ void OnChangeShrinkFactor();
void OnShowTable();
void OnShowTablePlot();
void OnDeleteObjects();
void OnPlotData();
void OnCurveProperties();
+ void OnCurveScale();
void OnClearContainer();
void OnEditContainer();
virtual void OnSaveViewParams();
virtual void OnRestoreViewParams();
- void OnRename();
void OnClippingPlanes();
void OnSweep();
void OnParallelTimeAnimation();
void OnSucccessiveTimeAnimation();
void OnShowAnimation();
+ void OnPointEvolution();
+ void OnShowEvolution();
+
void OnCopyPresentation();
void OnTranslatePrs();
void OnValuesLabeling();
void OnValuesLabelingParams();
+ void OnArcQuadMode();
+ void OnLineQuadMode();
+
+ void OnShowDeviation();
+
// MULTIPR
void OnMultiprViewFullRes();
void OnMultiprViewMediumRes();
protected:
virtual LightApp_Selection* createSelection() const;
+ virtual void processPresentationCreated( VISU::Prs3d_i* thePrs );
+
void OnTimeAnimation(VISU::Animation::AnimationMode theMode);
private:
int addVtkFontPref( const QString& label, const int pId, const QString& param, const bool useSize );
private:
- QMap< PanelId, VisuGUI_Panel* > myPanels;
- VisuGUI_Slider* mySlider;
- VisuGUI_Sweep* mySweep;
+ QMap<int,VisuGUI_Panel*> myPanels;
+ VisuGUI_Slider* mySlider;
+ VisuGUI_Sweep* mySweep;
- LightApp_Displayer* myDisplayer;
- VISU::TViewToPrs3d myScalarBarsMap;
+ LightApp_Displayer* myDisplayer;
+ VISU::TViewToPrs3d myScalarBarsMap;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VISUGUI_ACTIONSDEF
#define VISUGUI_ACTIONSDEF
#define VISU_IMPORT_MED_TIMESTAMP 4005
#define VISU_IMPORT_MED_FIELD 4006
#define VISU_LOAD_COMPONENT_DATA 4007
+#define VISU_IMPORT_SAUV 4008
#define VISU_SCALAR_MAP 4011
#define VISU_DEFORMED_SHAPE 4012
#define VISU_CUT_PLANES 4015
#define VISU_STREAM_LINES 4016
#define VISU_CUT_LINES 4017
+#define VISU_CUT_SEGMENT 40181 // like in VISU_en.xml
#define VISU_PLOT2D 4018
#define VISU_PLOT_3D 4019
#define VISU_DEFORMED_SHAPE_AND_SCALAR_MAP 40110
#define VISU_COPY_PRS 4037
#define VISU_CURVE_PROPS 4040
-#define VISU_RENAME 4041
+#define VISU_CURVE_SCALE 4041
#define VISU_EDIT_CONTAINER 4042
#define VISU_CLEAR_CONTAINER 4043
#define VISU_EDGE_COLOR 4059
#define VISU_OPACITY 4060
#define VISU_LINE_WIDTH 4061
+#define VISU_POINT_MARKER 40611
+#define VISU_SHRINK_FACTOR 40629
#define VISU_EDIT_SCALARMAP 40620
#define VISU_EDIT_DEFORMEDSHAPE 40621
#define VISU_EDIT_CUTPLANES 40622
#define VISU_EDIT_CUTLINES 40623
+#define VISU_EDIT_CUTSEGMENT 406231
#define VISU_EDIT_ISOSURFACES 40624
#define VISU_EDIT_VECTORS 40625
#define VISU_EDIT_STREAMLINES 40626
#define VISU_SELECTION_INFO 4065
#define VISU_PARALLELANIMATION 4066
#define VISU_SUCCCESSIVEANIMATION 4067
+#define VISU_POINT_EVOLUTION 4068
#define VISU_ERASE_ALL 4070
#define VISU_GLOBAL_SELECTION 4071
#define VISU_MERGE_SCALAR_BARS 4080
#define VISU_FREE_SCALAR_BARS 4081
#define VISU_SHOW_ANIMATION 4082
+#define VISU_SHOW_EVOLUTION 4086
#define VISU_PLOT3D_FROM_CUTPLANE 4085
#define VISU_VALUES_LABELING 4302
#define VISU_VALUES_LABELING_PARAMS 4303
+#define VISU_ARCQUAD_MODE 4401
+#define VISU_LINEQUAD_MODE 4402
+
+#define VISU_SHOW_DEVIATION 4501
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_BasePanel.cxx
// Author : Oleg Uvarov
\param theParent parent widget
*/
VisuGUI_BasePanel::VisuGUI_BasePanel( const QString& theName,
- QWidget* theParent,
+ QWidget* theParent,
const int theBtns )
: QGroupBox( theName, theParent ),
myOK( 0 ),
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_BasePanel.cxx
// Author : Oleg Uvarov
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_BuildProgressDlg.cxx
// Author : Oleg UVAROV
myBuildFieldsButton->setEnabled( false );
myBuildFieldsButton->setFixedSize( 30, 30 );
aPal = myBuildFieldsButton->palette();
- aPal.setColor( myBuildFieldsButton->backgroundRole(), Qt::red );
+ aPal.setColor( myBuildFieldsButton->backgroundRole(), myBuildFieldsCheckBox->isChecked() ? Qt::red : Qt::gray );
myBuildFieldsButton->setPalette( aPal );
connect( myBuildFieldsCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
myBuildMinMaxButton->setEnabled( false );
myBuildMinMaxButton->setFixedSize( 30, 30 );
aPal = myBuildMinMaxButton->palette();
- aPal.setColor( myBuildMinMaxButton->backgroundRole(), Qt::red );
+ aPal.setColor( myBuildMinMaxButton->backgroundRole(), myBuildMinMaxCheckBox->isChecked() ? Qt::red : Qt::gray );
myBuildMinMaxButton->setPalette( aPal );
connect( myBuildMinMaxCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
myBuildGroupsButton->setEnabled( false );
myBuildGroupsButton->setFixedSize( 30, 30 );
aPal = myBuildGroupsButton->palette();
- aPal.setColor( myBuildGroupsButton->backgroundRole(), Qt::red );
+ aPal.setColor( myBuildGroupsButton->backgroundRole(), myBuildGroupsCheckBox->isChecked() ? Qt::red : Qt::gray );
myBuildGroupsButton->setPalette( aPal );
connect( myBuildGroupsCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
if( aBuildAtOnce )
{
QApplication::setOverrideCursor( Qt::WaitCursor );
- myCurrentTime = vtkTimerLog::GetCurrentTime();
+ myCurrentTime = vtkTimerLog::GetUniversalTime();
}
myTime.setHMS( 0, 0, 0 );
app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
}
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(0, ("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
{
myTime = myTime.addMSecs( 100 );
if( myTime.minute() > 9 && myTimeLCDNumber->numDigits() < 9 )
- myTimeLCDNumber->setNumDigits( 9 );
+ myTimeLCDNumber->setNumDigits( 9 );
myTimeLCDNumber->display( myTime.toString( "m:ss.zzz" ) );
bool isEntitiesDone = myResult->IsEntitiesDone();
if( aBuildAtOnce )
{
- updateButton( myBuildEntitiesButton, true );
- updateButton( myBuildFieldsButton, true );
- updateButton( myBuildMinMaxButton, true );
- updateButton( myBuildGroupsButton, true );
-
- QApplication::restoreOverrideCursor();
-
- QTime aTime;
- int mSecs = ( int )( 1000 * ( vtkTimerLog::GetCurrentTime() - myCurrentTime ) );
- aTime = aTime.addMSecs( mSecs );
- if( aTime.minute() > 9 )
- myTimeLCDNumber->setNumDigits( 9 );
- myTimeLCDNumber->display( aTime.toString( "m:ss.zzz" ) );
+ updateButton( myBuildEntitiesButton, true );
+ updateButton( myBuildFieldsButton, true );
+ updateButton( myBuildMinMaxButton, true );
+ updateButton( myBuildGroupsButton, true );
+
+ QApplication::restoreOverrideCursor();
+
+ QTime aTime;
+ int mSecs = ( int )( 1000 * ( vtkTimerLog::GetUniversalTime() - myCurrentTime ) );
+ aTime = aTime.addMSecs( mSecs );
+ if( aTime.minute() > 9 )
+ myTimeLCDNumber->setNumDigits( 9 );
+ myTimeLCDNumber->display( aTime.toString( "m:ss.zzz" ) );
}
if( myCloseCheckBox->isChecked() )
- done( 0 );
+ done( 0 );
else
- SUIT_MessageBox::warning( this,
+ SUIT_MessageBox::warning( this,
tr( "INF_VISU" ),
tr( "IMPORT_DONE" ),
tr( "BUT_OK" ) );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_BuildProgressDlg.h
// Author : Oleg UVAROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_CacheDlg.cxx
// Author : Oleg UVAROV
#include "SUIT_ResourceMgr.h"
#include "SalomeApp_Module.h"
+#include <SalomeApp_DoubleSpinBox.h>
#include "LightApp_Application.h"
-#include "QtxDoubleSpinBox.h"
-
#include <QButtonGroup>
#include <QGroupBox>
#include <QLabel>
using namespace std;
VisuGUI_CacheDlg::VisuGUI_CacheDlg( VISU::ColoredPrs3dCache_var theCache,
- SalomeApp_Module* theModule )
+ SalomeApp_Module* theModule )
: QDialog( VISU::GetDesktop( theModule ), Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
myCache( theCache )
{
double anUsedMemory = myCache->GetMemorySize();
double aLimitedMemoryMax =
#ifdef WNT
- max
+ max
#else
- std::max
+ std::max
#endif
- (anUsedMemory + aFreeMemory, aLimitedMemory);
+ (anUsedMemory + aFreeMemory, aLimitedMemory);
// Settings
QButtonGroup* aMemoryGroup = new QButtonGroup( this );
myMimimalMemoryButton->setChecked( !isLimitedMemory );
aGridLay->addWidget( myMimimalMemoryButton, 1, 0 );
- myLimitedMemory = new QtxDoubleSpinBox( 1.0, aLimitedMemoryMax, 10.0, aGB );
+ myLimitedMemory = new SalomeApp_DoubleSpinBox( aGB );
+ VISU::initSpinBox( myLimitedMemory, 1.0, aLimitedMemoryMax, 10.0, "memory_precision" );
myLimitedMemory->setSuffix( " Mb" );
myLimitedMemory->setValue( aLimitedMemory );
myLimitedMemory->setEnabled( isLimitedMemory );
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
if (app)
app->onHelpContextModule(app->activeModule() ?
- app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
+ app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
else {
SUIT_MessageBox::warning(0, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_CacheDlg.h
// Author : Oleg UVAROV
class QLineEdit;
class QRadioButton;
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class SalomeApp_Module;
public:
VisuGUI_CacheDlg( VISU::ColoredPrs3dCache_var aCache,
- SalomeApp_Module* theModule );
+ SalomeApp_Module* theModule );
virtual ~VisuGUI_CacheDlg();
public:
QRadioButton* myMimimalMemoryButton;
QRadioButton* myLimitedMemoryButton;
- QtxDoubleSpinBox* myLimitedMemory;
+ SalomeApp_DoubleSpinBox* myLimitedMemory;
QLineEdit* myUsedMemory;
QLineEdit* myFreeMemory;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VisuGUI_ClippingDlg.h"
#include "VisuGUI.h"
#include "VISU_ColoredPrs3dHolder_i.hh"
#include "VISU_PipeLine.hxx"
+#include "VISU_PipeLineUtils.hxx"
#include "VISU_DataSetActor.h"
+#include <SalomeApp_IntSpinBox.h>
+#include <SalomeApp_DoubleSpinBox.h>
+
#include "LightApp_SelectionMgr.h"
#include "LightApp_Application.h"
#include <QValidator>
#include <QTabWidget>
#include <QRadioButton>
-#include <QSpinBox>
#include <QKeyEvent>
#include <QPushButton>
#include <QListWidget>
vw->Repaint();
}
}
-
- void RangeStepAndValidator (QtxDoubleSpinBox* theSpinBox, double min, double max,
- double step, unsigned short decimals)
- {
- theSpinBox->setRange(min, max);
- theSpinBox->setSingleStep(step);
- theSpinBox->setRange(min, max );
- theSpinBox->setDecimals( decimals);
- }
};
//=================================================================================
myViewWindow(vw)
{
Init();
- myViewWindow->AddActor(myActor);
+ myViewWindow->AddActor(myActor, false, false); // don't adjust actors
}
OrientedPlane::OrientedPlane():
GroupButtonsLayout->addWidget(buttonOk, 0, 0);
// Initial state
- VISU::RangeStepAndValidator(SpinBoxDistance, 0.0, 1.0, 0.01, 3);
- VISU::RangeStepAndValidator(SpinBoxRot1, -180.0, 180.0, 1, 3);
- VISU::RangeStepAndValidator(SpinBoxRot2, -180.0, 180.0, 1, 3);
+ VISU::initSpinBox( SpinBoxDistance, 0., 1., .01, "length_precision" );
+ VISU::initSpinBox( SpinBoxRot1, -180., 180., 1., "angle_precision" );
+ VISU::initSpinBox( SpinBoxRot2, -180., 180., 1., "angle_precision" );
ComboBoxOrientation->addItem(tr("PARALLEL_XOY_COMBO_ITEM"));
ComboBoxOrientation->addItem(tr("PARALLEL_YOZ_COMBO_ITEM"));
TextLabelDistance->setText(tr("LBL_DISTANCE"));
GroupParametersLayout->addWidget(TextLabelDistance, 1, 0);
- SpinBoxDistance = new QtxDoubleSpinBox(GroupParameters);
+ SpinBoxDistance = new SalomeApp_DoubleSpinBox(GroupParameters);
GroupParametersLayout->addWidget(SpinBoxDistance, 1, 1);
TextLabelRot1 = new QLabel(GroupParameters);
TextLabelRot1->setText(tr("LBL_ROTATION_YZ"));
GroupParametersLayout->addWidget(TextLabelRot1, 2, 0);
- SpinBoxRot1 = new QtxDoubleSpinBox(GroupParameters);
+ SpinBoxRot1 = new SalomeApp_DoubleSpinBox(GroupParameters);
GroupParametersLayout->addWidget(SpinBoxRot1, 2, 1);
TextLabelRot2 = new QLabel(GroupParameters);
TextLabelRot2->setText(tr("LBL_ROTATION_XZ"));
GroupParametersLayout->addWidget(TextLabelRot2, 3, 0);
- SpinBoxRot2 = new QtxDoubleSpinBox(GroupParameters);
+ SpinBoxRot2 = new SalomeApp_DoubleSpinBox(GroupParameters);
GroupParametersLayout->addWidget(SpinBoxRot2, 3, 1);
return GroupParameters;
// Index
TextLabelIJKIndex = new QLabel(WidgetIJKTab);
TextLabelIJKIndex->setText(tr("LBL_IJK_INDEX"));
- SpinBoxIJKIndex = new QSpinBox(WidgetIJKTab);
+ SpinBoxIJKIndex = new SalomeApp_IntSpinBox(WidgetIJKTab);
+ SpinBoxIJKIndex->setAcceptNames( false );
// Orientation
CheckBoxIJKPlaneReverse = new QCheckBox (tr("REVERSE_NORMAL_CHK"), WidgetIJKTab);
myPrs3d->SetPlaneParam(aNormal, 1. - getDistance(), aPlane);
- vtkDataSet* aDataSet = myPrs3d->GetInput();
- vtkFloatingPointType *aPnt = aDataSet->GetCenter();
+ //Get bounds of the visible part of the dataset
+ vtkFloatingPointType aBounds[6];
+ myPrs3d->GetPipeLine()->GetVisibleBounds(aBounds);
- vtkFloatingPointType* anOrigin = aPlane->GetOrigin();
- vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
+ //Get center
+ vtkFloatingPointType aPnt[3];
+ VISU::ComputeBoxCenter(aBounds,aPnt);
+ vtkFloatingPointType* anOrigin = aPlane->GetOrigin();
+
+ //Get Length of the diagonal
+ vtkFloatingPointType aDel = VISU::ComputeBoxDiagonal(aBounds)/2.0;
+
vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel},
- {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
+ {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3];
-
+
vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
- aPnt[1] - aDelta[0][1] - aDelta[1][1],
- aPnt[2] - aDelta[0][2] - aDelta[1][2]};
+ aPnt[1] - aDelta[0][1] - aDelta[1][1],
+ aPnt[2] - aDelta[0][2] - aDelta[1][2]};
vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0],
- aPnt01[1] + aNormal[1],
- aPnt01[2] + aNormal[2]};
+ aPnt01[1] + aNormal[1],
+ aPnt01[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0);
vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
- aPnt[1] - aDelta[0][1] + aDelta[1][1],
- aPnt[2] - aDelta[0][2] + aDelta[1][2]};
+ aPnt[1] - aDelta[0][1] + aDelta[1][1],
+ aPnt[2] - aDelta[0][2] + aDelta[1][2]};
vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0],
- aPnt11[1] + aNormal[1],
- aPnt11[2] + aNormal[2]};
+ aPnt11[1] + aNormal[1],
+ aPnt11[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1);
vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
- aPnt[1] + aDelta[0][1] - aDelta[1][1],
- aPnt[2] + aDelta[0][2] - aDelta[1][2]};
+ aPnt[1] + aDelta[0][1] - aDelta[1][1],
+ aPnt[2] + aDelta[0][2] - aDelta[1][2]};
vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0],
- aPnt21[1] + aNormal[1],
- aPnt21[2] + aNormal[2]};
+ aPnt21[1] + aNormal[1],
+ aPnt21[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2);
vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource;
// purpose : set non structured parameters by IJK parameters
//=================================================================================
void VisuGUI_ClippingDlg::SetCurrentPlaneIJKParam()
-{
+{
if (myPlanes.empty() || myIsSelectPlane || !WidgetIJKTab->isEnabled())
return;
double dot = normal * dir;
//ENK: 23.11.2006 - PAL13176
if(i==0){
- maxDot = dot;
+ maxDot = dot;
gridDir = dir;
values = curValues;
gridAxId = i;
// find index value
double v = SpinBoxDistance->value();
// reverse value?
-// bool reverse = (normal * axDir < 0); // normal and axis are opposite
-// if (gridDir * axDir < 0) // grid dir and axis are opposite
-// reverse = !reverse;
-// if (reverse)
-// v = 1. - v;
+ bool reverse = (normal * axDir < 0); // normal and axis are opposite
+ if (gridDir * axDir < 0) // grid dir and axis are opposite
+ reverse = !reverse;
+ if (reverse)
+ v = 1. - v;
for (i = 0; i < values->size(); ++i)
if ((*values)[ i ] > v)
break;
--i;
// set control values
+ onIJKAxisChanged(gridAxId); // first of all update label and range of index
myIsSelectPlane = true;
CheckBoxIJKPlaneReverse->setChecked(normal * axDir < 0);
SpinBoxIJKIndex->setValue(i);
ButtonGroupIJKAxis->button(gridAxId)->setChecked( true );
- onIJKAxisChanged(gridAxId); // update label and range of index
myIsSelectPlane = false;
SetCurrentPlaneIJKParam();
gp_Dir dir;
CORBA::String_var aMeshName = myPrs3d->GetMeshName();
const vector<vtkFloatingPointType> * indices = result->GetAxisInfo(aMeshName.in(),
- axis, dir);
+ axis, dir);
if (indices)
maxIndex = indices->size() - 1;
}
{
if(thePrs != myPrs3d){
if(myPrs3d)
- myPrs3d->Destroy();
+ myPrs3d->UnRegister();
if(thePrs)
thePrs->Register();
myPrs3d = thePrs;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DIALOGBOX_CLIPPING_H
#define DIALOGBOX_CLIPPING_H
#include "SALOME_InteractiveObject.hxx"
-#include "QtxDoubleSpinBox.h"
+#include "SalomeApp_DoubleSpinBox.h"
// QT Includes
#include <QDialog>
class QGroupBox;
class QComboBox;
class QButtonGroup;
-class QSpinBox;
class QTabWidget;
class QListWidget;
class SALOME_Actor;
-class QtxDoubleSpinBox;
-
class SVTK_ViewWindow;
class LightApp_SelectionMgr;
+class SalomeApp_IntSpinBox;
+
class VisuGUI;
class vtkPlaneSource;
class vtkDataSetMapper;
public:
VisuGUI_ClippingDlg( VisuGUI* theModule,
- bool modal = false );
+ bool modal = false );
float getDistance() { return (float)SpinBoxDistance->value(); }
void setDistance(const float theDistance) { SpinBoxDistance->setValue(theDistance); }
QTabWidget* TabPane;
QComboBox* ComboBoxOrientation;
- QtxDoubleSpinBox* SpinBoxDistance;
- QtxDoubleSpinBox* SpinBoxRot1;
- QtxDoubleSpinBox* SpinBoxRot2;
+ SalomeApp_DoubleSpinBox* SpinBoxDistance;
+ SalomeApp_DoubleSpinBox* SpinBoxRot1;
+ SalomeApp_DoubleSpinBox* SpinBoxRot2;
QWidget* WidgetIJKTab;
QButtonGroup* ButtonGroupIJKAxis;
QGroupBox* GroupBoxIJKAxis;
QLabel* TextLabelIJKIndex;
- QSpinBox* SpinBoxIJKIndex;
+ SalomeApp_IntSpinBox* SpinBoxIJKIndex;
QCheckBox* CheckBoxIJKPlaneReverse;
QCheckBox* PreviewCheckBox;
void ClickOnHelp();
};
-#endif // DIALOGBOX_TRANSPARENCYDLG_H
+#endif // DIALOGBOX_CLIPPING_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VisuGUI_ClippingPanel.h"
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
#include <QCheckBox>
#include <vtkImageData.h>
-#include <vtkCutter.h>
+#include <vtkEDFCutter.h>
#include <vtkPolyDataMapper.h>
#include <SALOMEDSClient_AttributeSequenceOfReal.hxx>
//****************************************************************
//PreviewPlane::PreviewPlane(SVTK_ViewWindow* theWindow, const PlaneDef& thePlane, const double* theBounds):
PreviewPlane::PreviewPlane(SVTK_ViewWindow* theWindow,
- VISU_CutPlaneFunction* thePlane,
- const double* theBounds):
+ VISU_CutPlaneFunction* thePlane,
+ const double* theBounds):
myWindow(theWindow),
myBounds(theBounds)
{
myBox->SetDimensions(2, 2, 2);
myBox->SetOrigin(aBound[0],aBound[2],aBound[4]);
myBox->SetSpacing((aBound[1]-aBound[0]),
- (aBound[3]-aBound[2]),
- (aBound[5]-aBound[4]));
+ (aBound[3]-aBound[2]),
+ (aBound[5]-aBound[4]));
- myCutter = vtkCutter::New();
+ myCutter = vtkEDFCutter::New();
myCutter->SetInput(myBox);
myCutter->SetCutFunction(myPlane);
//****************************************************************
//****************************************************************
//****************************************************************
-VisuGUI_ClippingPanel::VisuGUI_ClippingPanel(VisuGUI* theModule)
- : VisuGUI_Panel(tr("TITLE"), theModule, VISU::GetDesktop(theModule), ApplyBtn | HelpBtn ),
- myModule(theModule),
+VisuGUI_ClippingPanel::VisuGUI_ClippingPanel( VisuGUI* theModule, QWidget* theParent )
+ : VisuGUI_Panel( tr( "TITLE" ), theModule, theParent, ApplyBtn | HelpBtn ),
myPlaneDlg(0),
myViewWindow(0),
myIsApplied(true)
{
+ setWindowTitle( tr( "TITLE" ) );
+ setObjectName( tr( "TITLE" ) );
+
QVBoxLayout* aMainLayout = new QVBoxLayout(mainFrame());
// List of presentations
// fillPlanesList();
connect(myModule, SIGNAL(presentationCreated(VISU::Prs3d_i*)),
- this, SLOT(onPresentationCreate(VISU::Prs3d_i*)));
+ this, SLOT(onPresentationCreate(VISU::Prs3d_i*)));
connect(myModule, SIGNAL(beforeObjectDelete(QString)),
- this, SLOT(onObjectDelete(QString)));
+ this, SLOT(onObjectDelete(QString)));
SUIT_Desktop* aDesktop = VISU::GetDesktop(myModule);
connect(aDesktop, SIGNAL(windowActivated(SUIT_ViewWindow*)),
- this, SLOT(onWindowActivated(SUIT_ViewWindow*)));
+ this, SLOT(onWindowActivated(SUIT_ViewWindow*)));
}
while (!aFather->_is_nil()) {
QString aFName = aFather->GetName();
aPath.append(aFName);
- if (aFName == "Post-Pro") break;
+ if (aFName == "Post-Pro") break;
aFather = aFather->GetFather();
}
aObjName = aSObject->GetName();
_PTR(Study) aStudy = VISU::GetCStudy(VISU::GetAppStudy(myModule));
_PTR(SObject) aSObjPtr = aStudy->FindObjectID(aColPrs->GetHolderEntry().c_str());
if (aSObjPtr) {
- _PTR(SObject) aFather = aSObjPtr->GetFather();
- while (aFather) {
- QString aFName(aFather->GetName().c_str());
- aPath.append(aFName);
- if (aFName == "Post-Pro") break;
- aFather = aFather->GetFather();
- }
+ _PTR(SObject) aFather = aSObjPtr->GetFather();
+ while (aFather) {
+ QString aFName(aFather->GetName().c_str());
+ aPath.append(aFName);
+ if (aFName == "Post-Pro") break;
+ aFather = aFather->GetFather();
+ }
}
aObjName = aSObjPtr->GetName().c_str();
}
//*************************************************************************
QStringList VisuGUI_ClippingPanel::getPrsList(_PTR(Study) theStudy,
- _PTR(SObject) theObject)
+ _PTR(SObject) theObject)
{
//QList<VISU::Prs3d_i*> aList;
QStringList aList;
_PTR(ChildIterator) aIter = theStudy->NewChildIterator(theObject);
for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
_PTR(SObject) aSObject = aIter->Value();
- std::vector<VISU::Prs3d_i*> aSTLList = VISU::GetPrs3dList(myModule, aSObject);
+ std::vector<VISU::Prs3d_i*> aSTLList = VISU::GetPrs3dList(myModule, aSObject, true /* enable GaussPoints */);
for (int i = 0; i < aSTLList.size(); i++) {
VISU::Prs3d_i* aPrs = aSTLList[i];
if (!aList.contains(aPrs->GetEntry().c_str()))
- aList.append(aPrs->GetEntry().c_str());
+ aList.append(aPrs->GetEntry().c_str());
}
if (aList.size() == 0) {
//QList<VISU::Prs3d_i*> aSubList = getPrsList(theStudy, aSObject);
QStringList aSubList = getPrsList(theStudy, aSObject);
for (int i = 0; i < aSubList.size(); i++) {
- //VISU::Prs3d_i* aPrs = aSubList[i];
- QString aPrsEntry = aSubList[i];
- if (!aList.contains(aPrsEntry))
- aList.append(aPrsEntry);
+ //VISU::Prs3d_i* aPrs = aSubList[i];
+ QString aPrsEntry = aSubList[i];
+ if (!aList.contains(aPrsEntry))
+ aList.append(aPrsEntry);
}
}
}
QTableWidgetItem* aItem = new QTableWidgetItem(aPlane->getName().c_str());
QTableWidgetItem* aCheckItem = new QTableWidgetItem();
aCheckItem->setCheckState((myNonActivePlanes->checkState() == Qt::Checked)?
- Qt::Unchecked : Qt::Checked);
+ Qt::Unchecked : Qt::Checked);
if (aPlane->isAuto()) { // If this is Auto plane
aItem->setFlags(0);
aItem->setCheckState(Qt::Checked);
// Check current presentation
int aPrsNum = myPrsList->currentRow();
if (aPrsNum >= 0) {
- if (VISU_ClippingPlaneMgr::ContainsPlane(getPrs(myPresentations.at(aPrsNum)), aPlane))
- aItem->setCheckState(Qt::Checked);
+ if (VISU_ClippingPlaneMgr::ContainsPlane(getPrs(myPresentations.at(aPrsNum)), aPlane))
+ aItem->setCheckState(Qt::Checked);
}
}
myPlanesList->setItem(i, 0, aItem);
aCheckItem->setCheckState((myNonActivePlanes->checkState() == Qt::Checked)? Qt::Unchecked : Qt::Checked);
if (aNewPlane.isAuto) { // If this is Auto plane
- aItem->setFlags(0);
- // apply to all presentations
- aItem->setCheckState(Qt::Checked);
- foreach(QString aPrsEntry, myPresentations) {
- getPrs(aPrsEntry)->AddClippingPlane(aNewPlane.plane);
- }
+ aItem->setFlags(0);
+ // apply to all presentations
+ aItem->setCheckState(Qt::Checked);
+ foreach(QString aPrsEntry, myPresentations) {
+ getPrs(aPrsEntry)->AddClippingPlane(aNewPlane.plane);
+ }
} else { // if it is not auto
- foreach(QString aPrsEntry, myPresentations) {
- _PTR(ChildIterator) aRefIter = aStudy->NewChildIterator(aSObject);
- for (; aRefIter->More(); aRefIter->Next()) {
- _PTR(SObject) aObj = aRefIter->Value();
- _PTR(SObject) aRefPrsObject;
- if (aObj->ReferencedObject(aRefPrsObject)) { // If it is referenced on current plane
- if (QString(aRefPrsObject->GetID().c_str()) == aPrsEntry) {
- getPrs(aPrsEntry)->AddClippingPlane(aNewPlane.plane);
- }
- }
- }
- }
- aItem->setCheckState(Qt::Unchecked);
- // Check current presentation
- int aPrsNum = myPrsList->currentRow();
- if (aPrsNum >= 0) {
- if (containsPlane(getPrs(myPresentations.at(aPrsNum)), aNewPlane))
- aItem->setCheckState(Qt::Checked);
- }
+ foreach(QString aPrsEntry, myPresentations) {
+ _PTR(ChildIterator) aRefIter = aStudy->NewChildIterator(aSObject);
+ for (; aRefIter->More(); aRefIter->Next()) {
+ _PTR(SObject) aObj = aRefIter->Value();
+ _PTR(SObject) aRefPrsObject;
+ if (aObj->ReferencedObject(aRefPrsObject)) { // If it is referenced on current plane
+ if (QString(aRefPrsObject->GetID().c_str()) == aPrsEntry) {
+ getPrs(aPrsEntry)->AddClippingPlane(aNewPlane.plane);
+ }
+ }
+ }
+ }
+ aItem->setCheckState(Qt::Unchecked);
+ // Check current presentation
+ int aPrsNum = myPrsList->currentRow();
+ if (aPrsNum >= 0) {
+ if (containsPlane(getPrs(myPresentations.at(aPrsNum)), aNewPlane))
+ aItem->setCheckState(Qt::Checked);
+ }
}
myPlanesList->setItem(i, 0, aItem);
myPlanesList->setItem(i, 1, aCheckItem);
QTableWidgetItem* aItem = new QTableWidgetItem(aPlane->getName().c_str());
QTableWidgetItem* aCheckItem = new QTableWidgetItem();
aCheckItem->setCheckState((myNonActivePlanes->checkState() == Qt::Checked)?
- Qt::Unchecked : Qt::Checked);
+ Qt::Unchecked : Qt::Checked);
//aNewPlane.plane->setActive(myNonActivePlanes->checkState() != Qt::Checked);
aPlane->setActive(myNonActivePlanes->checkState() != Qt::Checked);
//if (aNewPlane.isAuto) {
int aPrsNum = myPrsList->currentRow();
if (aPrsNum >= 0) {
if (VISU_ClippingPlaneMgr::ContainsPlane(getPrs(myPresentations.at(aPrsNum)), aPlane))
- aItem->setCheckState(Qt::Checked);
+ aItem->setCheckState(Qt::Checked);
}
}
VISU_CutPlaneFunction* aPlane = aMgr.GetClippingPlane(aRow);
QMessageBox::StandardButton aRes =
QMessageBox::warning(VISU::GetDesktop(myModule),
- tr("TIT_DELETE_PLANE"),
- tr("MSG_DELETE_PLANE").arg(aPlane->getName().c_str()),
- QMessageBox::Yes | QMessageBox::No,
- QMessageBox::No);
+ tr("TIT_DELETE_PLANE"),
+ tr("MSG_DELETE_PLANE").arg(aPlane->getName().c_str()),
+ QMessageBox::Yes | QMessageBox::No,
+ QMessageBox::No);
if (aRes == QMessageBox::Yes) {
aMgr.DeleteClippingPlane(aRow);
/* short aTag1 = aPlane.plane->getPlaneObject()->Tag();
for (int i = 0; i < myPresentations.size(); i++) {
VISU::Prs3d_i* aPrs = getPrs(myPresentations.at(i));
for (int j = aPrs->GetNumberOfClippingPlanes()-1; j > -1; j--) {
- CutPlaneFunction* aPln = dynamic_cast<CutPlaneFunction*>(aPrs->GetClippingPlane(j));
- if (aPln) {
- short aTag2 = aPln->getPlaneObject()->Tag();
- if (aTag1 == aTag2) {
- aPrs->RemoveClippingPlane(j);
- }
- }
+ CutPlaneFunction* aPln = dynamic_cast<CutPlaneFunction*>(aPrs->GetClippingPlane(j));
+ if (aPln) {
+ short aTag2 = aPln->getPlaneObject()->Tag();
+ if (aTag1 == aTag2) {
+ aPrs->RemoveClippingPlane(j);
+ }
+ }
}
}
aPrs->AddClippingPlane(aPlane.plane);
if(!aStudy->GetProperties()->IsLocked()) {
- _PTR(SObject) aNewObj = aBuilder->NewObject(aSObject);
- aBuilder->Addreference(aNewObj, aPrsSObj);
+ _PTR(SObject) aNewObj = aBuilder->NewObject(aSObject);
+ aBuilder->Addreference(aNewObj, aPrsSObj);
}
}
} else {
for (int i = 0; i < aPrs->GetNumberOfClippingPlanes(); i++) {
if (aPrs->GetClippingPlane(i) == aPlane.plane.GetPointer()) {
- aPrs->RemoveClippingPlane(i);
- break;
+ aPrs->RemoveClippingPlane(i);
+ break;
}
}
if(!aStudy->GetProperties()->IsLocked()) {
_PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject);
for (; aIter->More(); aIter->Next()) {
- _PTR(SObject) aRefObj = aIter->Value();
- if(aRefObj) {
- _PTR(SObject) aRefPrsObject;
- if (aRefObj->ReferencedObject(aRefPrsObject)) {
- if (QString(aRefPrsObject->GetID().c_str()) == QString(aPrs->GetEntry().c_str())) {
- VISU::DeleteSObject(myModule, aStudy, aRefObj);
- break;
- }
- }
- }
+ _PTR(SObject) aRefObj = aIter->Value();
+ if(aRefObj) {
+ _PTR(SObject) aRefPrsObject;
+ if (aRefObj->ReferencedObject(aRefPrsObject)) {
+ if (QString(aRefPrsObject->GetID().c_str()) == QString(aPrs->GetEntry().c_str())) {
+ VISU::DeleteSObject(myModule, aStudy, aRefObj);
+ break;
+ }
+ }
+ }
}
}
}*/
if (aPrs) {
QString aID(aPrs->GetEntry().c_str());
if (aID == theEntry) {
- myPresentations.removeAt(i);
- myPrsList->takeItem(i);
- break;
+ myPresentations.removeAt(i);
+ myPrsList->takeItem(i);
+ break;
}
i++;
}
VISU_CutPlaneFunction* aPlane = aMgr.GetClippingPlane(i);
if (!aPlane->isAuto())
aItem->setCheckState(VISU_ClippingPlaneMgr::ContainsPlane(aPrs, aPlane)?
- Qt::Checked : Qt::Unchecked);
+ Qt::Checked : Qt::Unchecked);
}
/* for (aIt = myPlanes.begin(), i = 0; aIt != myPlanes.end(); ++aIt, i++) {
QTableWidgetItem* aItem = myPlanesList->item(i, 0);
VISU::Prs3d_i* VisuGUI_ClippingPanel::getPrs(QString theEntry)
{
VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(VISU::GetAppStudy(myModule),
- qPrintable(theEntry));
+ qPrintable(theEntry));
return VISU::GetPrs3dFromBase(anObjectInfo.myBase);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DIALOGBOX_CLIPPINGPANEL_H
#define DIALOGBOX_CLIPPINGPANEL_H
class SUIT_ViewWindow;
class vtkPolyDataMapper;
class vtkImageData;
-class vtkCutter;
+class vtkEDFCutter;
#include "VISU_Prs3d_i.hh"
#include "VisuGUI_Panel.h"
const double* myBounds;
vtkPlane* myPlane;
vtkImageData* myBox;
- vtkCutter* myCutter;
+ vtkEDFCutter* myCutter;
};
{
Q_OBJECT
public:
- VisuGUI_ClippingPanel(VisuGUI* theModule);
+ VisuGUI_ClippingPanel(VisuGUI* theModule, QWidget* theParent = 0);
~VisuGUI_ClippingPanel();
void init();
QStringList getPrsList(_PTR(Study) theStudy, _PTR(SObject) theObject);
VISU::Prs3d_i* getPrs(QString theEntry);
- VisuGUI* myModule;
-
QListWidget* myPrsList;
QTableWidget* myPlanesList;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VisuGUI_ClippingPlaneDlg.h"
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
#include <SUIT_ViewManager.h>
#include <SUIT_MessageBox.h>
#include <SUIT_ResourceMgr.h>
-#include <QtxDoubleSpinBox.h>
#include <SVTK_ViewWindow.h>
#include <VTKViewer_Utilities.h>
+#include <SalomeApp_DoubleSpinBox.h>
#include <QVBoxLayout>
#include <QHBoxLayout>
QHBoxLayout* aOriginLayout = new QHBoxLayout(aOriginGroup);
aOriginLayout->addWidget( new QLabel("X", aOriginGroup) );
- myXOrigin = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, aOriginGroup );
+ myXOrigin = new SalomeApp_DoubleSpinBox( aOriginGroup );
+ VISU::initSpinBox( myXOrigin, -1000.0, 1000.0, 0.1, "length_precision" );
myXOrigin->setValue( 0.0 );
connect(myXOrigin, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
aOriginLayout->addWidget( myXOrigin );
aOriginLayout->addWidget( new QLabel("Y", aOriginGroup) );
- myYOrigin = new QtxDoubleSpinBox( -1000.0, 1000, 0.1, aOriginGroup );
+ myYOrigin = new SalomeApp_DoubleSpinBox( aOriginGroup );
+ VISU::initSpinBox( myYOrigin, -1000.0, 1000.0, 0.1, "length_precision" );
myYOrigin->setValue( 0.0 );
connect(myYOrigin, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
aOriginLayout->addWidget( myYOrigin );
aOriginLayout->addWidget( new QLabel("Z", aOriginGroup) );
- myZOrigin = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, aOriginGroup );
+ myZOrigin = new SalomeApp_DoubleSpinBox( aOriginGroup );
+ VISU::initSpinBox( myZOrigin, -1000.0, 1000.0, 0.1, "length_precision" );
myZOrigin->setValue( 0.0 );
connect(myZOrigin, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
aOriginLayout->addWidget( myZOrigin );
QHBoxLayout* aDirLayout = new QHBoxLayout(aDirGroup);
aDirLayout->addWidget( new QLabel("dX", aDirGroup) );
- myXDir = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, aDirGroup );
+ myXDir = new SalomeApp_DoubleSpinBox( aDirGroup );
+ VISU::initSpinBox( myXDir, -1000.0, 1000.0, 0.1, "length_precision" );
myXDir->setValue( 0.0 );
connect(myXDir, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
aDirLayout->addWidget( myXDir );
aDirLayout->addWidget( new QLabel("dY", aDirGroup) );
- myYDir = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, aDirGroup );
+ myYDir = new SalomeApp_DoubleSpinBox( aDirGroup );
+ VISU::initSpinBox( myYDir, -1000.0, 1000.0, 0.1, "length_precision" );
myYDir->setValue( 0.0 );
connect(myYDir, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
aDirLayout->addWidget( myYDir );
aDirLayout->addWidget( new QLabel("dZ", aDirGroup) );
- myZDir = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, aDirGroup );
+ myZDir = new SalomeApp_DoubleSpinBox( aDirGroup );
+ VISU::initSpinBox( myZDir, -1000.0, 1000.0, 0.1, "length_precision" );
myZDir->setValue( 1.0 );
connect(myZDir, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
aDirLayout->addWidget( myZDir );
//****************************************************************
void VisuGUI_ClippingPlaneDlg::ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
vtkImplicitPlaneWidget* aWidget = vtkImplicitPlaneWidget::SafeDownCast(theObject);
if (aWidget == NULL) return;
//aPlaneWgt->OutlineTranslationOff();
//aPlaneWgt->ScaleEnabledOn();
aPlaneWgt->AddObserver(vtkCommand::InteractionEvent,
- myCallback.GetPointer(),
- 0.);
+ myCallback.GetPointer(),
+ 0.);
return aPlaneWgt;
}
VISU_ClippingPlaneMgr& aMgr = VISU::GetVisuGen(myModule)->GetClippingPlaneMgr();
if (myPlaneId == -1) { // Create a New plane
myPlaneId = aMgr.CreateClippingPlane(myXOrigin->value(), myYOrigin->value(), myZOrigin->value(),
- myXDir->value(), myYDir->value(), myZDir->value(),
- myAutoApply->checkState() == Qt::Checked,
- qPrintable(myNameEdt->text()));
+ myXDir->value(), myYDir->value(), myZDir->value(),
+ myAutoApply->checkState() == Qt::Checked,
+ qPrintable(myNameEdt->text()));
} else { // Edit Plane
aMgr.EditClippingPlane(myPlaneId,
- myXOrigin->value(), myYOrigin->value(), myZOrigin->value(),
- myXDir->value(), myYDir->value(), myZDir->value(),
- myAutoApply->checkState() == Qt::Checked,
- qPrintable(myNameEdt->text()));
+ myXOrigin->value(), myYOrigin->value(), myZOrigin->value(),
+ myXDir->value(), myYDir->value(), myZDir->value(),
+ myAutoApply->checkState() == Qt::Checked,
+ qPrintable(myNameEdt->text()));
}
VISU::UpdateObjBrowser(myModule);
}
if (VISU::getClippingPlanesFolder(aStudy, aFolder)) {
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
if (myPlaneObj == 0) { // Create a New plane
- myPlaneObj = aBuilder->NewObject(aFolder);
+ myPlaneObj = aBuilder->NewObject(aFolder);
}
// Save Name
_PTR(GenericAttribute) anAttr;
anAttr = aBuilder->FindOrCreateAttribute(myPlaneObj,"AttributeSequenceOfReal");
_PTR(AttributeSequenceOfReal) aArray(anAttr);
if (aArray->Length() == 6) {
- for (int i = 0; i < 6; i++)
- aArray->ChangeValue(i+1, aParams[i]);
+ for (int i = 0; i < 6; i++)
+ aArray->ChangeValue(i+1, aParams[i]);
} else {
- for (int i = 0; i < 6; i++)
- aArray->Add(aParams[i]);
+ for (int i = 0; i < 6; i++)
+ aArray->Add(aParams[i]);
}
// Save Bool Flag
anAttr = aBuilder->FindOrCreateAttribute(myPlaneObj,"AttributeInteger");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DIALOGBOX_CLIPPINGPLANEDLG_H
#define DIALOGBOX_CLIPPINGPLANEDLG_H
class QLineEdit;
class QCheckBox;
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class vtkImplicitPlaneWidget;
class vtkCallbackCommand;
class vtkObject;
static void ProcessEvents(vtkObject* theObject, unsigned long theEvent,
- void* theClientData, void* theCallData);
+ void* theClientData, void* theCallData);
VisuGUI* myModule;
SVTK_ViewWindow* myViewWindow;
QLineEdit* myNameEdt;
- QtxDoubleSpinBox* myXOrigin;
- QtxDoubleSpinBox* myYOrigin;
- QtxDoubleSpinBox* myZOrigin;
+ SalomeApp_DoubleSpinBox* myXOrigin;
+ SalomeApp_DoubleSpinBox* myYOrigin;
+ SalomeApp_DoubleSpinBox* myZOrigin;
- QtxDoubleSpinBox* myXDir;
- QtxDoubleSpinBox* myYDir;
- QtxDoubleSpinBox* myZDir;
+ SalomeApp_DoubleSpinBox* myXDir;
+ SalomeApp_DoubleSpinBox* myYDir;
+ SalomeApp_DoubleSpinBox* myZDir;
QCheckBox* myAutoApply;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_CursorDlg.cxx
// Author : Laurent CORNABE & Hubert ROLLAND
#include "LightApp_Application.h"
+#include <SalomeApp_IntSpinBox.h>
+
#include <QLayout>
#include <QLabel>
#include <QPushButton>
-#include <QSpinBox>
#include <QGroupBox>
#include <QKeyEvent>
Comment2->setAlignment( Qt::AlignCenter );
TopGroupBoxLayout->addWidget( Comment2, 1, 0 );
- SpinBox1 = new QSpinBox( TopGroupBox );
+ SpinBox1 = new SalomeApp_IntSpinBox( TopGroupBox );
+ SpinBox1->setAcceptNames( false );
SpinBox1->setMinimum( 0 );
SpinBox1->setMaximum(100 );
SpinBox1->setSingleStep( 1 );
#endif
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).
- arg(helpFileName) );
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).
+ arg(helpFileName) );
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_CursorDlg.h
// Author : Laurent CORNABE & Hubert ROLLAND
#include <QDialog>
class QLabel;
class QPushButton;
-class QSpinBox;
+class SalomeApp_IntSpinBox;
class QGroupBox;
class VisuGUI_CursorDlg : public QDialog
QGroupBox* TopGroupBox;
QLabel* Comment1;
QLabel* Comment2;
- QSpinBox* SpinBox1;
+ SalomeApp_IntSpinBox* SpinBox1;
QGroupBox* GroupButtons;
QPushButton* buttonOk;
QPushButton* buttonCancel;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_CutLinesDlg.cxx
// Author : VSV
// Module : VISU
-//
+
#include "VisuGUI_CutLinesDlg.h"
#include "VISU_ColoredPrs3dFactory.hh"
#include "LightApp_Application.h"
#include "SalomeApp_Study.h"
+#include <SalomeApp_DoubleSpinBox.h>
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
//TO DO
//#include "OB_Browser.h"
-#include "VisuGUI_TableDlg.h"
+#include "VISU_TableDlg.h"
#include <QLayout>
#include <QTabWidget>
myRotXLbl = new QLabel( tr( "LBL_ROT_X" ), aRotBox);
aGridLay->addWidget( myRotXLbl, 0, 0 );
- myRotXSpn = new QtxDoubleSpinBox( -45, 45, 5, aRotBox );
+ myRotXSpn = new SalomeApp_DoubleSpinBox( aRotBox );
+ VISU::initSpinBox( myRotXSpn, -45., 45., 5., "angle_precision" );
aGridLay->addWidget( myRotXSpn, 0, 1 );
myRotXSpn->setValue( 0 );
myRotYLbl = new QLabel( tr( "LBL_ROT_Y" ), aRotBox );
aGridLay->addWidget( myRotYLbl, 1, 0 );
- myRotYSpn = new QtxDoubleSpinBox( -45, 45, 5, aRotBox );
+ myRotYSpn = new SalomeApp_DoubleSpinBox( aRotBox );
+ VISU::initSpinBox( myRotYSpn, -45., 45., 5., "angle_precision" );
aGridLay->addWidget( myRotYSpn, 1, 1 );
myRotYSpn->setValue( 0 );
aHBLay->setSpacing(5);
aHBLay->addWidget( new QLabel (tr("LBL_POS"), aPosBox) );
- myPosSpn = new QtxDoubleSpinBox (0, 1, 0.1, aPosBox);
+ myPosSpn = new SalomeApp_DoubleSpinBox (aPosBox);
+ VISU::initSpinBox( myPosSpn, 0., 1., .1, "parametric_precision" );
myPosSpn->setValue(0.5);
aHBLay->addWidget( myPosSpn );
aPlaneLayout->addWidget(aPosBox);
myRotXLbl2 = new QLabel( tr( "LBL_ROT_X" ), aRotBox2);
aGridLay->addWidget( myRotXLbl2, 0, 0 );
- myRotXSpn2 = new QtxDoubleSpinBox( -45, 45, 5, aRotBox2 );
+ myRotXSpn2 = new SalomeApp_DoubleSpinBox( aRotBox2 );
+ VISU::initSpinBox( myRotXSpn2, -45., 45., 5., "angle_precision" );
aGridLay->addWidget( myRotXSpn2, 0, 1 );
myRotXSpn2->setValue( 0 );
myRotYLbl2 = new QLabel( tr( "LBL_ROT_Y" ), aRotBox2 );
aGridLay->addWidget( myRotYLbl2, 1, 0 );
- myRotYSpn2 = new QtxDoubleSpinBox( -45, 45, 5, aRotBox2 );
+ myRotYSpn2 = new SalomeApp_DoubleSpinBox( aRotBox2 );
+ VISU::initSpinBox( myRotYSpn2, -45., 45., 5., "angle_precision" );
aGridLay->addWidget( myRotYSpn2, 1, 1 );
myRotYSpn2->setValue( 0 );
aLinesLayout->addWidget( aRotBox2 );
aHBLay = new QHBoxLayout( aNbBox );
aHBLay->setSpacing(5);
aHBLay->addWidget( new QLabel( tr( "LBL_NB_PLANS" ), aNbBox ) );
- myNbSpn = new QtxDoubleSpinBox( 1, 100, 1, aNbBox );
+ myNbSpn = new SalomeApp_DoubleSpinBox( aNbBox );
+ VISU::initSpinBox( myNbSpn, 1., 100., 1., "parametric_precision" );
myNbSpn->setValue( 10 );
aHBLay->addWidget( myNbSpn );
myPosTable->setEditTriggers( (QAbstractItemView::EditTriggers)(QAbstractItemView::AllEditTriggers &(~QAbstractItemView::CurrentChanged)));
QStringList aLabels;
- aLabels.append( "Position" );
- aLabels.append( "Set default" );
+ aLabels.append( tr("Position" ));
+ aLabels.append( tr("Set default" ));
myPosTable->setHorizontalHeaderLabels( aLabels );
aLinesLayout->addWidget( myPosTable );
aHBLay = new QHBoxLayout( aPosBox2 );
aHBLay->setSpacing(5);
aHBLay->addWidget( new QLabel( tr( "LBL_POS" ), aPosBox2 ) );
- myPosSpn2 = new QtxDoubleSpinBox( 0, 1, 0.1, aPosBox2 );
+ myPosSpn2 = new SalomeApp_DoubleSpinBox( aPosBox2 );
+ VISU::initSpinBox( myPosSpn2, 0., 1., .1, "parametric_precision" );
myPosSpn2->setValue( 0.5 );
aHBLay->addWidget( myPosSpn2 );
myTabBox->addTab( aLinesPane, tr("LBL_LINES_CUT") );
myInputPane = new VisuGUI_InputPane(VISU::TCUTLINES, theModule, this);
- myTabBox->addTab(GetScalarPane(), "Scalar Bar");
- myTabBox->addTab(myInputPane, "Input");
+ myTabBox->addTab(GetScalarPane(), tr("Scalar Bar"));
+ myTabBox->addTab(myInputPane, tr("Input"));
aMainLayout->addWidget(myTabBox);
//------------------------------------------------------------------------------
void VisuGUI_CutLinesDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TCUTLINES>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
- myRotXSpn->setValue(myPrsCopy->GetRotateX()*180./PI);
- myRotYSpn->setValue(myPrsCopy->GetRotateY()*180./PI);
+ myRotXSpn->setValue(myPrsCopy->GetRotateX()*180./M_PI);
+ myRotYSpn->setValue(myPrsCopy->GetRotateY()*180./M_PI);
myPosSpn->setValue(myPrsCopy->GetDisplacement());
setOrientation(myPrsCopy->GetOrientationType());
myNbSpn->setValue( (int)myPrsCopy->GetNbLines() );
- myRotXSpn2->setValue(myPrsCopy->GetRotateX2()*180./PI);
- myRotYSpn2->setValue(myPrsCopy->GetRotateY2()*180./PI);
+ myRotXSpn2->setValue(myPrsCopy->GetRotateX2()*180./M_PI);
+ myRotYSpn2->setValue(myPrsCopy->GetRotateY2()*180./M_PI);
myPosSpn2->setValue(myPrsCopy->GetDisplacement2());
setOrientation2(myPrsCopy->GetOrientationType2());
anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
myPrsCopy->SetOrientation(getOrientaion(),
- myRotXSpn->value()*PI/180.,
- myRotYSpn->value()*PI/180.);
+ myRotXSpn->value()*M_PI/180.,
+ myRotYSpn->value()*M_PI/180.);
myPrsCopy->SetDisplacement(myPosSpn->value());
myPrsCopy->SetNbLines((int)myNbSpn->value());
myPrsCopy->SetOrientation2(getOrientaion(false),
- myRotXSpn2->value()*PI/180.,
- myRotYSpn2->value()*PI/180.);
+ myRotXSpn2->value()*M_PI/180.,
+ myRotYSpn2->value()*M_PI/180.);
myPrsCopy->SetDisplacement2(myPosSpn2->value());
if (!myCBSetDef->isChecked())
myPrsCopy->SetLinePosition( i, aVar.toDouble() );
}
else
- myPrsCopy->SetDefaultPosition(i);
+ myPrsCopy->SetDefaultPosition(i);
}
}
return;
myCutLines->SetOrientation(getOrientaion(),
- myRotXSpn->value()*PI/180.,
- myRotYSpn->value()*PI/180.);
+ myRotXSpn->value()*M_PI/180.,
+ myRotYSpn->value()*M_PI/180.);
myCutLines->SetNbLines(aNbPlanes);
myCutLines->SetDisplacement2(myPosSpn2->value());
myCutLines->SetOrientation2(getOrientaion(false),
- myRotXSpn2->value()*PI/180.,
- myRotYSpn2->value()*PI/180.);
+ myRotXSpn2->value()*M_PI/180.,
+ myRotYSpn2->value()*M_PI/180.);
if (aNbRows>0)
for (int i = 0; i < aNbRows; ++i)
if (aItem->checkState() != Qt::Checked )
{
QVariant aVar = aModel->index( i, 0 ).data();
- myCutLines->SetLinePosition(i, aVar.toDouble());
+ myCutLines->SetLinePosition(i, aVar.toDouble());
}
}
else if (aNbPlanes < aNbRows)
myPosTable->setRowCount(aNbPlanes);
- QString str("Plane# %1");
+ QString str(tr("PLANE_NUMBER"));
QStringList aLabels;
int aMin = (aNbRows < aNbPlanes)? aNbRows : aNbPlanes;
for (int i = 0; i<aMin; i++)
{
if (myPreviewCheck->isChecked())
{
- deletePlanes();
- createPlanes();
+ deletePlanes();
+ createPlanes();
}
}
}
SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView)
{
- if (myPreviewCheck->isChecked())
+ if (myPreviewCheck->isChecked())
{
- deletePlanes();
- createPlanes();
- }
+ deletePlanes();
+ createPlanes();
+ }
}
aModel->setData( anIndex, myCutLines->GetLinePosition(theRow), Qt::DisplayRole );
myPosTable->item( theRow, 0 )->setFlags( myPosTable->item( theRow, 0 )->flags() | Qt::ItemIsEnabled );
//Update Preview
if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
{
- //myCutLines->GetPipeLine()->Update();
- deletePlanes();
- createPlanes();
- //vf->Repaint();
+ //myCutLines->GetPipeLine()->Update();
+ deletePlanes();
+ createPlanes();
+ //vf->Repaint();
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_CutLinesDlg.h
// Author : VSV
// Module : VISU
class SUIT_ViewManager;
class SalomeApp_Module;
class VisuGUI_InputPane;
+class SalomeApp_DoubleSpinBox;
namespace VISU
{
~VisuGUI_CutLinesDlg();
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
void updateGlyphs(bool update);
QButtonGroup* mySelPlane;
- QtxDoubleSpinBox* myRotXSpn;
- QtxDoubleSpinBox* myRotYSpn;
+ SalomeApp_DoubleSpinBox* myRotXSpn;
+ SalomeApp_DoubleSpinBox* myRotYSpn;
QLabel* myRotXLbl;
QLabel* myRotYLbl;
- QtxDoubleSpinBox* myPosSpn;
+ SalomeApp_DoubleSpinBox* myPosSpn;
QLineEdit* myBasePlanePos;
QCheckBox* myCBSetDef;
QCheckBox* myCreateTable;
QCheckBox* myCurvesCheck;
QButtonGroup* mySelPlane2;
- QtxDoubleSpinBox* myNbSpn;
- QtxDoubleSpinBox* myRotXSpn2;
- QtxDoubleSpinBox* myRotYSpn2;
+ SalomeApp_DoubleSpinBox* myNbSpn;
+ SalomeApp_DoubleSpinBox* myRotXSpn2;
+ SalomeApp_DoubleSpinBox* myRotYSpn2;
QLabel* myRotXLbl2;
QLabel* myRotYLbl2;
- QtxDoubleSpinBox* myPosSpn2;
+ SalomeApp_DoubleSpinBox* myPosSpn2;
QTableWidget* myPosTable;
bool hasInit;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_CutPlanesDlg.cxx
// Author : Laurent CORNABE & Hubert ROLLAND
// Module : VISU
-// $Header$
-//
+
#include "VisuGUI_CutPlanesDlg.h"
#include "VISU_ColoredPrs3dFactory.hh"
//#include "OB_Browser.h"
-#include "VisuGUI_TableDlg.h"
+#include "VISU_TableDlg.h"
#include "SVTK_ViewWindow.h"
#include "LightApp_Application.h"
+#include <SalomeApp_IntSpinBox.h>
+#include <SalomeApp_DoubleSpinBox.h>
+
#include "SUIT_Application.h"
#include "SUIT_Desktop.h"
#include "SUIT_ViewWindow.h"
#include <QLineEdit>
#include <QTabWidget>
#include <QKeyEvent>
-#include <QSpinBox>
#include <QRadioButton>
#include <QTableWidget>
#include <QGroupBox>
QLabel* LabelPosi_3 = new QLabel (tr("LBL_NB_PLANS"), this);
- nbPlan = new QSpinBox( this );
+ nbPlan = new SalomeApp_IntSpinBox( this );
+ nbPlan->setAcceptNames( false );
nbPlan->setMinimum( 1 );
nbPlan->setMaximum(100);
nbPlan->setSingleStep( 1 );
(QAbstractItemView::EditTriggers)(QAbstractItemView::AllEditTriggers &(~QAbstractItemView::CurrentChanged)));
QStringList aLabels;
- aLabels.append( "Position" );
- aLabels.append( "Set default" );
+ aLabels.append( tr("Position") );
+ aLabels.append( tr("Set default") );
myPosTable->setHorizontalHeaderLabels( aLabels );
LabelRot1 = new QLabel (tr("LBL_ROT_X"), GBrot );
GBrotLayout->addWidget( LabelRot1, 0, 0 );
- Rot1 = new QtxDoubleSpinBox( -180, 180, 10, GBrot );
+ Rot1 = new SalomeApp_DoubleSpinBox( GBrot );
+ VISU::initSpinBox( Rot1, -180., 180., 10., "angle_precision" );
Rot1->setValue( 0 );
Rot1->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
connect( Rot1, SIGNAL( valueChanged( double )), this, SLOT( onRotation( double ) ) );
LabelRot2 = new QLabel (tr("LBL_ROT_Y"), GBrot );
GBrotLayout->addWidget( LabelRot2, 1, 0 );
- Rot2 = new QtxDoubleSpinBox( -180, 180, 10, GBrot );
+ Rot2 = new SalomeApp_DoubleSpinBox( GBrot );
+ VISU::initSpinBox( Rot2, -180., 180., 10., "angle_precision" );
Rot2->setValue( 0 );
Rot2->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
connect( Rot2, SIGNAL( valueChanged( double )), this, SLOT( onRotation( double ) ) );
GBrotLayout->addWidget( Rot2, 1, 1 );
QLabel* aPosLbl = new QLabel(tr( "LBL_POS" ), this);
- myPosSpn = new QtxDoubleSpinBox( 0, 1, 0.1, this );
+ myPosSpn = new SalomeApp_DoubleSpinBox( this );
+ VISU::initSpinBox( myPosSpn, 0., 1., .1, "parametric_precision" );
GDeformation = new QGroupBox(tr("LBL_DEFORMATION"), this);
GDeformation->setCheckable(true);
myVectorialFieldCombo = new QComboBox (GDeformation);
GDeformationLayout->addWidget( myVectorialFieldCombo, 0, 1 );
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
-
QLabel* LabelDeformation2 = new QLabel (tr("LBL_DEFROMATION_SCALE"), GDeformation);
GDeformationLayout->addWidget( LabelDeformation2, 1, 0 );
- myScaleSpn = new QtxDoubleSpinBox (0, 1.0E+38, 0.1, aPrecision*(-1), 38, GDeformation);
+ myScaleSpn = new SalomeApp_DoubleSpinBox (GDeformation);
+ VISU::initSpinBox( myScaleSpn, 0., 1.0E+38, 0.1, "visual_data_precision" );
myScaleSpn->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
GDeformationLayout->addWidget( myScaleSpn, 1, 1 );
connect(myVectorialFieldCombo, SIGNAL(activated(int)), this, SLOT(onVectorialFieldChanged(int)));
void VisuGUI_CutPlanesPane::initFromPrsObject (VISU::CutPlanes_i* thePrs)
{
setNbPlanes(thePrs->GetNbPlanes());
- setRotation(thePrs->GetRotateX()*180./PI, thePrs->GetRotateY()*180./PI);
+ setRotation(thePrs->GetRotateX()*180./M_PI, thePrs->GetRotateY()*180./M_PI);
setPlanePos(thePrs->GetOrientationType());
myPosSpn->setValue(thePrs->GetDisplacement());
InitEntity2VectorialFieldsMap(thePrs);
GDeformation->setChecked(true);
int idx = myVectorialFieldCombo->findText(thePrs->GetVectorialFieldName());
if (idx >= 0)
- myVectorialFieldCombo->setCurrentIndex(idx);
+ myVectorialFieldCombo->setCurrentIndex(idx);
else {
- myVectorialFieldCombo->addItem(thePrs->GetVectorialFieldName());
- myVectorialFieldCombo->setCurrentIndex(myVectorialFieldCombo->count()-1);
+ myVectorialFieldCombo->addItem(thePrs->GetVectorialFieldName());
+ myVectorialFieldCombo->setCurrentIndex(myVectorialFieldCombo->count()-1);
}
}
}
int VisuGUI_CutPlanesPane::storeToPrsObject (VISU::CutPlanes_i* thePrs)
{
- thePrs->SetOrientation(getOrientaion(), getRotation1()*PI/180., getRotation2()*PI/180.);
+ thePrs->SetOrientation(getOrientaion(), getRotation1()*M_PI/180., getRotation2()*M_PI/180.);
thePrs->SetNbPlanes(getNbPlanes());
thePrs->SetDisplacement(myPosSpn->value());
for (int i = 0; i < getNbPlanes(); ++i) {
int aNbRows = myPosTable->rowCount();
int aNbPlanes = getNbPlanes();
- myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.);
+ myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*M_PI/180.,getRotation2()*M_PI/180.);
myCutPlanes->SetNbPlanes(aNbPlanes);
myCutPlanes->SetDisplacement(myPosSpn->value());
myCutPlanes->SetScale(getScaleFactor());
QTableWidgetItem* aItem = myPosTable->item( i, 1 );
if (aItem == 0) break;
if (aItem->checkState() != Qt::Checked )
- myCutPlanes->SetPlanePosition(i, myPosTable->item(i, 0)->text().toDouble());
+ myCutPlanes->SetPlanePosition(i, myPosTable->item(i, 0)->text().toDouble());
}
if (aNbPlanes > aNbRows)
myPosTable->setRowCount(aNbPlanes);
QStringList aLabels;
- QString str("Plane# %1");
+ QString str(tr("PLANE_NUMBER"));
int aMin = (aNbRows < aNbPlanes)? aNbRows : aNbPlanes;
for (int i = 0; i<aMin; i++) {
myPosTable->item( i, 0 )->setText( QString::number(myCutPlanes->GetPlanePosition(i)));
//Update Preview
if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
{
- myCutPlanes->GetPipeLine()->Update();
- deletePlanes();
- createPlanes();
- vf->Repaint();
+ myCutPlanes->GetPipeLine()->Update();
+ deletePlanes();
+ createPlanes();
+ vf->Repaint();
}
}
}
if (myPreviewCheck->isChecked()) {
//Update Preview
if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
- myCutPlanes->SetPlanePosition( theRow, anIndex.data().toDouble());
- myCutPlanes->GetPipeLine()->Update();
- deletePlanes();
- createPlanes();
- vf->Repaint();
+ myCutPlanes->SetPlanePosition( theRow, anIndex.data().toDouble());
+ myCutPlanes->GetPipeLine()->Update();
+ deletePlanes();
+ createPlanes();
+ vf->Repaint();
}
}
} else {
aModel->setData( anIndex, myCutPlanes->GetPlanePosition(theRow), Qt::DisplayRole );
anItem->setFlags( anItem->flags() | Qt::ItemIsEnabled );
if (myPreviewCheck->isChecked()) {
- if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
- //Update Preview
- myCutPlanes->GetPipeLine()->Update();
- deletePlanes();
- createPlanes();
- vf->Repaint();
- }
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
+ //Update Preview
+ myCutPlanes->GetPipeLine()->Update();
+ deletePlanes();
+ createPlanes();
+ vf->Repaint();
+ }
}
}
//myPosTable->item(theRow, 0)->setEnabled(!isDefault);
if (!(bool)myCutPlanes) return;
if (myPreviewCheck->isChecked()) {
if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
- myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.);
+ myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*M_PI/180.,getRotation2()*M_PI/180.);
myCutPlanes->GetPipeLine()->Update();
deletePlanes();
createPlanes();
storeToPrsObject(myCutPlanes);
myCutPlanes->GetPipeLine()->Update();
createPlanes();
- if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) {
- vf->onFitAll();
- }
+ if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false))
+ vf->onFitAll(); // Repaint() is called inside
+ else
+ vf->Repaint();
} else {
deletePlanes();
vf->Repaint();
VisuGUI_CutPlanesDlg::VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule)
: VisuGUI_ScalarBarBaseDlg(theModule)
{
- setWindowTitle("Cut Planes Definition");
+ setWindowTitle(tr("Cut Planes Definition"));
setSizeGripEnabled(true);
QVBoxLayout* TopLayout = new QVBoxLayout (this);
// Tab pane
myTabBox = new QTabWidget(this);
myCutPane = new VisuGUI_CutPlanesPane(this/*, myMgr*/);
- myTabBox->addTab(myCutPane, "Cut Planes");
+ myTabBox->addTab(myCutPane, tr("Cut Planes"));
myInputPane = new VisuGUI_InputPane(VISU::TCUTPLANES, theModule, this);
- myTabBox->addTab(GetScalarPane(), "Scalar Bar");
- myTabBox->addTab(myInputPane, "Input");
+ myTabBox->addTab(GetScalarPane(), tr("Scalar Bar"));
+ myTabBox->addTab(myInputPane, tr("Input"));
TopLayout->addWidget(myTabBox);
{}
void VisuGUI_CutPlanesDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TCUTPLANES>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_CutPlanesDlg.h
// Author : Laurent CORNABE & Hubert ROLLAND
#include "VisuGUI_Prs3dDlg.h"
#include <SALOME_Actor.h>
-
-#include <QtxDoubleSpinBox.h>
+#include <SalomeApp_IntSpinBox.h>
+#include <SalomeApp_DoubleSpinBox.h>
#include <QFrame>
-class QSpinBox;
class QRadioButton;
class QTabWidget;
class QTableWidget;
QLabel* LabelRot1;
QLabel* LabelRot2;
QGroupBox* GDeformation;
- QSpinBox* nbPlan;
- QtxDoubleSpinBox* Rot1;
- QtxDoubleSpinBox* Rot2;
+ SalomeApp_IntSpinBox* nbPlan;
+ SalomeApp_DoubleSpinBox* Rot1;
+ SalomeApp_DoubleSpinBox* Rot2;
QRadioButton* RBzx;
QRadioButton* RByz;
QRadioButton* RBxy;
- QtxDoubleSpinBox* myPosSpn;
+ SalomeApp_DoubleSpinBox* myPosSpn;
QTableWidget* myPosTable;
SALOME::GenericObjPtr<VISU::CutPlanes_i> myCutPlanes;
QCheckBox* myPreviewCheck;
QComboBox* myVectorialFieldCombo;
- QtxDoubleSpinBox* myScaleSpn;
+ SalomeApp_DoubleSpinBox* myScaleSpn;
double X1, X2;
double Y1, Y2;
double Z1, Z2;
~VisuGUI_CutPlanesDlg();
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VisuGUI_CutSegmentDlg.cxx
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#include "VisuGUI_CutSegmentDlg.h"
+
+#include "VisuGUI.h"
+#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
+#include "VisuGUI_InputPane.h"
+
+#include "VISU_Gen_i.hh"
+#include "VISU_CutSegment_i.hh"
+#include "VISU_ColoredPrs3dFactory.hh"
+
+#include "VISU_PipeLine.hxx"
+#include "VISU_CutSegmentPL.hxx"
+
+#include "SVTK_ViewWindow.h"
+
+#include "LightApp_Application.h"
+#include "SalomeApp_Study.h"
+#include <SalomeApp_DoubleSpinBox.h>
+
+#include "SUIT_ResourceMgr.h"
+
+#include <QLayout>
+#include <QTabWidget>
+#include <QLabel>
+#include <QPushButton>
+
+#include <vtkAppendPolyData.h>
+#include <vtkCellArray.h>
+#include <vtkDataSetMapper.h>
+#include <vtkFloatArray.h>
+#include <vtkGlyph3D.h>
+#include <vtkGlyphSource2D.h>
+#include <vtkPointData.h>
+#include <vtkPolyData.h>
+#include <vtkPolyDataMapper.h>
+#include <vtkRenderer.h>
+
+using namespace std;
+
+VisuGUI_CutSegmentDlg::VisuGUI_CutSegmentDlg (SalomeApp_Module* theModule)
+ : VisuGUI_ScalarBarBaseDlg(theModule),
+ myPreviewActor(0),
+ myPreviewActorGlyphs(0),
+ myPreviewActorPoints(0)
+{
+ setWindowTitle(tr("Cut Segment Definition"));
+ setSizeGripEnabled(true);
+
+ QVBoxLayout* aMainLayout = new QVBoxLayout (this);
+ aMainLayout->setMargin( 7 );
+ aMainLayout->setSpacing(5);
+
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ hasInit = false;
+
+ // Tab pane
+ myTabBox = new QTabWidget(this);
+
+ // Cut Segment
+ QFrame* aCutSegmentPane = new QFrame( this );
+
+ QGroupBox* aSegmentBox = new QGroupBox( tr( "LBL_SEGMENT" ), aCutSegmentPane );
+
+ QLabel* aPoint1Label = new QLabel( tr( "LBL_POINT_1" ), aSegmentBox );
+ QLabel* aPoint1XLabel = new QLabel( tr( "LBL_X" ), aSegmentBox );
+ QLabel* aPoint1YLabel = new QLabel( tr( "LBL_Y" ), aSegmentBox );
+ QLabel* aPoint1ZLabel = new QLabel( tr( "LBL_Z" ), aSegmentBox );
+ QLabel* aPoint2Label = new QLabel( tr( "LBL_POINT_2" ), aSegmentBox );
+ QLabel* aPoint2XLabel = new QLabel( tr( "LBL_X" ), aSegmentBox );
+ QLabel* aPoint2YLabel = new QLabel( tr( "LBL_Y" ), aSegmentBox );
+ QLabel* aPoint2ZLabel = new QLabel( tr( "LBL_Z" ), aSegmentBox );
+ for( int i = 0; i < 3; i++ ) {
+ myPoint1.append( new SalomeApp_DoubleSpinBox( aSegmentBox ) );
+ myPoint2.append( new SalomeApp_DoubleSpinBox( aSegmentBox ) );
+ }
+
+ QListIterator<SalomeApp_DoubleSpinBox*> anIter( myPoint1 + myPoint2 );
+ while( anIter.hasNext() ) {
+ SalomeApp_DoubleSpinBox* aSpinBox = anIter.next();
+ // Use default range - see QDoubleSpinBox minimum/maximum properties
+ VISU::initSpinBox( aSpinBox, 0., 99.99, 1., "length_precision" );
+ aSpinBox->setMinimumWidth( 100 );
+ }
+
+ QGridLayout* aSegmentBoxLayout = new QGridLayout( aSegmentBox );
+ aSegmentBoxLayout->addWidget( aPoint1Label, 0, 0 );
+ aSegmentBoxLayout->addWidget( aPoint1XLabel, 0, 1 );
+ aSegmentBoxLayout->addWidget( myPoint1[0], 0, 2 );
+ aSegmentBoxLayout->addWidget( aPoint1YLabel, 0, 3 );
+ aSegmentBoxLayout->addWidget( myPoint1[1], 0, 4 );
+ aSegmentBoxLayout->addWidget( aPoint1ZLabel, 0, 5 );
+ aSegmentBoxLayout->addWidget( myPoint1[2], 0, 6 );
+ aSegmentBoxLayout->addWidget( aPoint2Label, 1, 0 );
+ aSegmentBoxLayout->addWidget( aPoint2XLabel, 1, 1 );
+ aSegmentBoxLayout->addWidget( myPoint2[0], 1, 2 );
+ aSegmentBoxLayout->addWidget( aPoint2YLabel, 1, 3 );
+ aSegmentBoxLayout->addWidget( myPoint2[1], 1, 4 );
+ aSegmentBoxLayout->addWidget( aPoint2ZLabel, 1, 5 );
+ aSegmentBoxLayout->addWidget( myPoint2[2], 1, 6 );
+
+ myPreviewCheck = new QCheckBox( tr( "LBL_SHOW_PREVIEW" ), aCutSegmentPane );
+ myPreviewCheck->setChecked( aResourceMgr->booleanValue( "VISU", "show_preview", false ) );
+
+ myAllCurvesInvertedCheck = new QCheckBox( tr( "LBL_INVERT_CURVES" ), aCutSegmentPane );
+ myAllCurvesInvertedCheck->setChecked( false );
+
+ myUseAbsoluteLengthCheck = new QCheckBox( tr( "LBL_ABSOLUTE_LENGTH" ), aCutSegmentPane );
+ myUseAbsoluteLengthCheck->setChecked( false );
+
+ myCreateTable = new QCheckBox( tr("LBL_GENERATE_TABLE"), aCutSegmentPane );
+ myCreateTable->setChecked( aResourceMgr->booleanValue( "VISU", "generate_data_table", true ) );
+
+ QWidget* aCheckPane = new QWidget( aCutSegmentPane );
+ myCurvesCheck = new QCheckBox( tr( "LBL_GENERATE_CURVES" ), aCheckPane );
+ myCurvesCheck->setChecked( aResourceMgr->booleanValue( "VISU", "generate_curves", true ) );
+ myCurvesCheck->setEnabled( aResourceMgr->booleanValue( "VISU", "generate_data_table", true ) );
+
+ QHBoxLayout* aCheckLayout = new QHBoxLayout( aCheckPane );
+ aCheckLayout->setMargin( 0 );
+ aCheckLayout->setSpacing( 0 );
+ aCheckLayout->insertSpacing( 0, 20 );
+ aCheckLayout->addWidget( myCurvesCheck );
+
+ QVBoxLayout* aCutSegmentLayout = new QVBoxLayout( aCutSegmentPane );
+ aCutSegmentLayout->setMargin( 5 );
+ aCutSegmentLayout->setSpacing( 6 );
+ aCutSegmentLayout->addWidget( aSegmentBox );
+ aCutSegmentLayout->addWidget( myPreviewCheck );
+ aCutSegmentLayout->addWidget( myAllCurvesInvertedCheck );
+ aCutSegmentLayout->addWidget( myUseAbsoluteLengthCheck );
+ aCutSegmentLayout->addWidget( myCreateTable );
+ aCutSegmentLayout->addWidget( aCheckPane );
+ aCutSegmentLayout->addStretch();
+
+ myTabBox->addTab( aCutSegmentPane, tr("LBL_CUT_SEGMENT") );
+
+ myInputPane = new VisuGUI_InputPane(VISU::TCUTSEGMENT, theModule, this);
+ myTabBox->addTab(GetScalarPane(), tr("Scalar Bar"));
+ myTabBox->addTab(myInputPane, tr("Input"));
+
+ aMainLayout->addWidget(myTabBox);
+
+ // Dialog buttons
+ QFrame* aBtnBox = new QFrame(this);
+ QHBoxLayout* aHBLay = new QHBoxLayout( aBtnBox );
+ aBtnBox->setFrameStyle(QFrame::Box | QFrame::Sunken);
+ aBtnBox->setLineWidth( 1 );
+ aHBLay->setSpacing( 5 );
+ aHBLay->setMargin( 11 );
+
+ QPushButton* aOkBtn = new QPushButton (tr("BUT_OK"), aBtnBox);
+ aOkBtn->setAutoDefault( TRUE );
+ aOkBtn->setDefault( true );
+ aHBLay->addWidget(aOkBtn);
+
+ aHBLay->addStretch();
+
+ QPushButton* aCloseBtn = new QPushButton(tr("BUT_CANCEL"), aBtnBox);
+ aHBLay->addWidget(aCloseBtn);
+
+ QPushButton* aHelpBtn = new QPushButton(tr("BUT_HELP"), aBtnBox);
+ aHBLay->addWidget(aHelpBtn);
+
+ aMainLayout->addWidget(aBtnBox);
+
+ // signals and slots connections
+ connect(myPreviewCheck, SIGNAL(toggled(bool)) , this, SLOT(onPreviewCheck(bool)));
+ connect(myAllCurvesInvertedCheck, SIGNAL(toggled(bool)),this, SLOT(onAllCurvesInvertedCheck(bool)));
+ for( int i = 0; i < 3; i++ ) {
+ connect(myPoint1[ i ], SIGNAL(valueChanged(double)), this, SLOT(onPointModified()));
+ connect(myPoint2[ i ], SIGNAL(valueChanged(double)), this, SLOT(onPointModified()));
+ }
+ connect(myCreateTable , SIGNAL(toggled(bool)), myCurvesCheck, SLOT(setEnabled(bool)));
+
+ connect(aOkBtn, SIGNAL(clicked()), this, SLOT(accept()));
+ connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
+}
+
+/*!
+ Destructor
+*/
+VisuGUI_CutSegmentDlg::~VisuGUI_CutSegmentDlg()
+{
+ deletePlanes();
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
+ vf->Repaint();
+}
+
+//------------------------------------------------------------------------------
+void VisuGUI_CutSegmentDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit )
+{
+ if( theInit )
+ myPrsCopy = VISU::TSameAsFactory<VISU::TCUTSEGMENT>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
+
+ VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
+
+ hasInit = true;
+ myCutSegment = VISU::TSameAsFactory<VISU::TCUTSEGMENT>().Create(myPrsCopy, VISU::ColoredPrs3d_i::EDoNotPublish);
+ myCutSegment->CopyCurvesInverted(myPrsCopy->GetCurvesInverted());
+ myAllCurvesInvertedCheck->setChecked( myCutSegment->IsAllCurvesInverted() );
+ myUseAbsoluteLengthCheck->setChecked( myCutSegment->IsUseAbsoluteLength() );
+
+ vtkDataSet* anInput = myCutSegment->GetPipeLine()->GetInput();
+ anInput->Update();
+
+ vtkFloatingPointType bounds[6];
+ anInput->GetBounds( bounds );
+
+ for( int i = 0; i < 3; i++ ) {
+ double min = bounds[ 2*i ], max = bounds[ 2*i+1 ];
+ myPoint1[ i ]->setRange( min, max );
+ myPoint2[ i ]->setRange( min, max );
+
+ myPoint1[ i ]->setSingleStep( ( max - min ) / 10 );
+ myPoint2[ i ]->setSingleStep( ( max - min ) / 10 );
+ }
+
+ double p1[3], p2[3];
+ myPrsCopy->GetPoint1( p1[0], p1[1], p1[2] );
+ myPrsCopy->GetPoint2( p2[0], p2[1], p2[2] );
+
+ for( int i = 0; i < 3; i++ ) {
+ myPoint1[i]->setValue( p1[i] );
+ myPoint2[i]->setValue( p2[i] );
+ }
+
+ // Draw Preview
+ if (myPreviewCheck->isChecked()) {
+ createPlanes();
+ }
+
+ if( !theInit )
+ return;
+
+ myInputPane->initFromPrsObject( myPrsCopy );
+ myTabBox->setCurrentIndex( 0 );
+}
+
+//------------------------------------------------------------------------------
+int VisuGUI_CutSegmentDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs)
+{
+ if(!myInputPane->check() || !GetScalarPane()->check())
+ return 0;
+
+ int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
+ anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
+
+ myPrsCopy->SetAllCurvesInverted( myAllCurvesInvertedCheck->isChecked() );
+ myPrsCopy->SetUseAbsoluteLength( myUseAbsoluteLengthCheck->isChecked() );
+
+ double p1[3], p2[3];
+ for( int i = 0; i < 3; i++ ) {
+ p1[i] = myPoint1[i]->value();
+ p2[i] = myPoint2[i]->value();
+ }
+ myPrsCopy->SetPoint1( p1[0], p1[1], p1[2] );
+ myPrsCopy->SetPoint2( p2[0], p2[1], p2[2] );
+
+ VISU::TSameAsFactory<VISU::TCUTSEGMENT>().Copy(myPrsCopy, thePrs);
+
+ return anIsOk;
+}
+
+//------------------------------------------------------------------------------
+void VisuGUI_CutSegmentDlg::createPlanes()
+{
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
+ if (aView == NULL) return;
+ if (!(bool)myCutSegment) return;
+ if (myPreviewActor != 0) return;
+
+ storeToPrsObject(myCutSegment);
+ myCutSegment->GetPipeLine()->Update();
+ vtkAppendPolyData* aPolyData = myCutSegment->GetSpecificPL()->GetAppendPolyData();
+ vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
+ aPlaneMapper->SetInput(aPolyData->GetOutput());
+ aPlaneMapper->ScalarVisibilityOff();
+
+ myPreviewActorGlyphs = SALOME_Actor::New();
+ myPreviewActorGlyphs->PickableOff();
+ updateGlyphs(false);
+
+ myPreviewActorPoints = SALOME_Actor::New();
+ myPreviewActorPoints->PickableOff();
+ updatePoints(false);
+
+ myPreviewActor = SALOME_Actor::New();
+ myPreviewActor->PickableOff();
+ myPreviewActor->SetMapper(aPlaneMapper);
+ aPlaneMapper->Delete();
+ aView->AddActor(myPreviewActor);
+ aView->AddActor(myPreviewActorGlyphs);
+ aView->AddActor(myPreviewActorPoints);
+ aView->getRenderer()->Render();
+ aView->onFitAll();
+}
+
+//------------------------------------------------------------------------------
+void VisuGUI_CutSegmentDlg::deletePlanes()
+{
+ if (myPreviewActor == 0) return;
+ vtkRenderer* aRend = myPreviewActor->GetRenderer();
+ vtkRenderer* aRendGlyphs = myPreviewActorGlyphs->GetRenderer();
+ vtkRenderer* aRendPoints = myPreviewActorPoints->GetRenderer();
+
+ vtkRenderWindow* aWnd1 = aRend->GetRenderWindow();
+ vtkRenderWindow* aWnd2 = aRendGlyphs->GetRenderWindow();
+ vtkRenderWindow* aWnd3 = aRendPoints->GetRenderWindow();
+ if(aRend && aWnd1)
+ myPreviewActor->RemoveFromRender(aRend);
+ if(aRendGlyphs && aWnd2)
+ myPreviewActorGlyphs->RemoveFromRender(aRendGlyphs);
+ if(aRendPoints && aWnd3)
+ myPreviewActorPoints->RemoveFromRender(aRendPoints);
+
+ myPreviewActor->Delete();
+ myPreviewActorGlyphs->Delete();
+ myPreviewActorPoints->Delete();
+ myPreviewActor = 0;
+ myPreviewActorGlyphs = 0;
+ myPreviewActorPoints = 0;
+}
+
+//------------------------------------------------------------------------------
+void VisuGUI_CutSegmentDlg::updateGlyphs(bool update){
+ if (myPreviewActorGlyphs == 0 ) return;
+ const vtkFloatingPointType *aDirLn = myCutSegment->GetSpecificPL()->GetRealDirLn();
+ vtkFloatingPointType aSecondPnt[3];
+ vtkFloatingPointType aBoundCenter[3];
+
+ vtkAppendPolyData* aPolyData = myCutSegment->GetSpecificPL()->GetAppendPolyData();
+ vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
+ aPlaneMapper->SetInput(aPolyData->GetOutput());
+ vtkFloatingPointType bounds[6];
+ aPlaneMapper->GetBounds(bounds);
+
+ for(int i=0; i<3; i++) aBoundCenter[i] = (bounds[i*2] + bounds[i*2+1])/2.0;
+ for(int i=0; i<3; i++){
+ if (!myAllCurvesInvertedCheck->isChecked())
+ aSecondPnt[i] = aDirLn[i];
+ else
+ aSecondPnt[i] = - aDirLn[i];
+ }
+
+ vtkFloatingPointType max_bound = 0;
+ max_bound < bounds[1]-bounds[0] ? max_bound = bounds[1] - bounds[0] : max_bound = max_bound;
+ max_bound < bounds[3]-bounds[2] ? max_bound = bounds[3] - bounds[2] : max_bound = max_bound;
+ max_bound < bounds[5]-bounds[4] ? max_bound = bounds[5] - bounds[4] : max_bound = max_bound;
+
+ vtkPolyData* profile = vtkPolyData::New();
+ vtkPoints* aPoints = vtkPoints::New();
+ vtkGlyph3D* glyphs = vtkGlyph3D::New();
+ vtkFloatArray *aFloatArray = vtkFloatArray::New();
+ vtkGlyphSource2D* source = vtkGlyphSource2D::New();
+
+ source->FilledOn();
+ source->SetGlyphTypeToArrow();
+
+ aPoints->InsertNextPoint(aBoundCenter);
+ profile->SetPoints(aPoints);
+
+ aFloatArray->SetNumberOfComponents(3);
+ for(int i=0; i<3 ;i++)
+ aFloatArray->InsertNextValue(aSecondPnt[i]);
+
+ vtkDataSetAttributes* aDataSetAttributes;
+ aDataSetAttributes = profile->GetPointData();
+ aDataSetAttributes->SetVectors(aFloatArray);
+
+ glyphs->SetScaleFactor(0.25*max_bound);
+ glyphs->SetVectorModeToUseVector();
+ glyphs->SetScaleModeToScaleByVector();
+ glyphs->SetInput(profile);
+ glyphs->SetSource(source->GetOutput());
+
+ vtkPolyDataMapper* aGlyphsMapper = vtkPolyDataMapper::New();
+ aGlyphsMapper->ScalarVisibilityOff();
+ aGlyphsMapper->SetInput(glyphs->GetOutput());
+
+ myPreviewActorGlyphs->SetMapper(aGlyphsMapper);
+
+ profile->Delete();
+ glyphs->Delete();
+ aPoints->Delete();
+ aGlyphsMapper->Delete();
+ aFloatArray->Delete();
+ source->Delete();
+ aPlaneMapper->Delete();
+
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
+ if (update)
+ vf->Repaint();
+}
+
+//------------------------------------------------------------------------------
+void VisuGUI_CutSegmentDlg::updatePoints( bool update )
+{
+ if( !myPreviewActorPoints )
+ return;
+
+ vtkFloatingPointType aPoint1[3], aPoint2[3];
+ myCutSegment->GetSpecificPL()->GetPoint1( aPoint1[0], aPoint1[1], aPoint1[2] );
+ myCutSegment->GetSpecificPL()->GetPoint2( aPoint2[0], aPoint2[1], aPoint2[2] );
+
+ vtkPoints* aPoints = vtkPoints::New();
+ aPoints->InsertNextPoint( aPoint1 );
+ aPoints->InsertNextPoint( aPoint2 );
+
+ vtkCellArray* aVerts = vtkCellArray::New();
+ for( vtkIdType i = 0, n = aPoints->GetNumberOfPoints(); i < n; i++ )
+ aVerts->InsertNextCell( 1, &i );
+
+ vtkPolyData* aProfile = vtkPolyData::New();
+ aProfile->SetPoints( aPoints );
+ aProfile->SetVerts( aVerts );
+
+ vtkPolyDataMapper* aPointsMapper = vtkPolyDataMapper::New();
+ aPointsMapper->ScalarVisibilityOff();
+ aPointsMapper->SetInput( aProfile );
+
+ myPreviewActorPoints->SetMapper( aPointsMapper );
+ myPreviewActorPoints->GetProperty()->SetRepresentationToPoints();
+ myPreviewActorPoints->GetProperty()->SetPointSize( 5 );
+
+ aProfile->Delete();
+ aPoints->Delete();
+ aVerts->Delete();
+
+ if( SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>() )
+ if( update )
+ vf->Repaint();
+}
+
+//------------------------------------------------------------------------------
+void VisuGUI_CutSegmentDlg::accept()
+{
+ VisuGUI_ScalarBarBaseDlg::accept();
+}
+
+//------------------------------------------------------------------------------
+void VisuGUI_CutSegmentDlg::reject()
+{
+ VisuGUI_ScalarBarBaseDlg::reject();
+}
+
+//------------------------------------------------------------------------------
+void VisuGUI_CutSegmentDlg::onPreviewCheck (bool thePreview)
+{
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
+ if (thePreview) {
+ createPlanes();
+ } else {
+ deletePlanes();
+ vf->Repaint();
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+void VisuGUI_CutSegmentDlg::onAllCurvesInvertedCheck(bool theInvert)
+{
+ bool anIsAllCurvesInverted = myAllCurvesInvertedCheck->isChecked();
+
+ myCutSegment->SetAllCurvesInverted( anIsAllCurvesInverted );
+ myPrsCopy->SetAllCurvesInverted( anIsAllCurvesInverted );
+
+ updateGlyphs(true);
+ updatePoints(true);
+}
+
+//------------------------------------------------------------------------------
+void VisuGUI_CutSegmentDlg::onPointModified ()
+{
+ if (!(bool)myCutSegment) return;
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
+ if (aView) {
+ if (myPreviewCheck->isChecked()) {
+ deletePlanes();
+ createPlanes();
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+QString VisuGUI_CutSegmentDlg::GetContextHelpFilePath()
+{
+ return "cut_segment_page.html";
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VisuGUI_CutSegmentDlg.h
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#ifndef VISUGUI_CUTSEGMENTDLG_H
+#define VISUGUI_CUTSEGMENTDLG_H
+
+#include "VisuGUI_CutPlanesDlg.h"
+
+#include <QCheckBox>
+#include <QList>
+
+class QTabWidget;
+
+class SalomeApp_Module;
+class VisuGUI_InputPane;
+class SalomeApp_DoubleSpinBox;
+
+namespace VISU
+{
+ class CutSegment_i;
+}
+
+class VisuGUI_CutSegmentDlg: public VisuGUI_ScalarBarBaseDlg
+{
+ Q_OBJECT
+
+public:
+ VisuGUI_CutSegmentDlg (SalomeApp_Module* theModule);
+ ~VisuGUI_CutSegmentDlg();
+
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit );
+
+ virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
+
+ bool isGenerateTable() { return myCreateTable->isChecked(); }
+ bool isGenerateCurves() { return myCreateTable->isChecked() && myCurvesCheck->isChecked(); }
+
+protected:
+ virtual QString GetContextHelpFilePath();
+
+protected slots:
+ void accept();
+ void reject();
+
+private slots:
+ void onPreviewCheck(bool thePreview);
+ void onAllCurvesInvertedCheck(bool theInvert);
+ void onPointModified();
+
+private:
+ void createPlanes();
+ void deletePlanes();
+ void updateGlyphs(bool update);
+ void updatePoints(bool update);
+
+ QCheckBox* myCreateTable;
+ QCheckBox* myCurvesCheck;
+
+ bool hasInit;
+
+ QList<SalomeApp_DoubleSpinBox*> myPoint1;
+ QList<SalomeApp_DoubleSpinBox*> myPoint2;
+
+ SALOME::GenericObjPtr<VISU::CutSegment_i> myCutSegment;
+
+ QTabWidget* myTabBox;
+ VisuGUI_InputPane* myInputPane;
+
+ SALOME_Actor* myPreviewActor;
+ SALOME_Actor* myPreviewActorGlyphs;
+ SALOME_Actor* myPreviewActorPoints;
+ QCheckBox* myPreviewCheck;
+ QCheckBox* myAllCurvesInvertedCheck;
+ QCheckBox* myUseAbsoluteLengthCheck;
+
+ SALOME::GenericObjPtr<VISU::CutSegment_i> myPrsCopy;
+};
+
+#endif // VISUGUI_CUTSEGMENTDLG_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_DeformedShapeAndScalarMapDlg.cxx
// Author : Eugeny Nikolaev
#include "VISU_Convertor.hxx"
-#include <QtxDoubleSpinBox.h>
+#include <SalomeApp_DoubleSpinBox.h>
#include <SalomeApp_Module.h>
#include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h>
#include <SUIT_Desktop.h>
-#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
#include <SUIT_MessageBox.h>
* Constructor
*/
VisuGUI_DeformedShapeAndScalarMapDlg::VisuGUI_DeformedShapeAndScalarMapDlg (SalomeApp_Module* theModule)
- : VisuGUI_ScalarBarBaseDlg(theModule),
+ : VisuGUI_ScalarBarBaseDlg(theModule, true),
myIsAnimation(false),
myUpdateScalars(true),
+ myIsScalarFieldValid(true),
myVisuGUI(theModule)
{
setWindowTitle(tr("DLG_TITLE"));
QLabel* ScaleLabel = new QLabel (tr("SCALE_FACTOR"), TopGroup);
TopGroupLayout->addWidget(ScaleLabel, 0, 0);
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
-
- ScalFact = new QtxDoubleSpinBox (0, 1.0E+38, 0.1, aPrecision*(-1), 32, TopGroup);
+ ScalFact = new SalomeApp_DoubleSpinBox (TopGroup);
+ VISU::initSpinBox( ScalFact, 0., 1.0E+38, .1, "visual_data_precision" );
ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
ScalFact->setValue(0.1);
TopGroupLayout->addWidget(ScalFact, 0, 1);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
- QPushButton* buttonOk = new QPushButton (tr("&OK"), GroupButtons);
- buttonOk->setAutoDefault(true);
- buttonOk->setDefault(true);
+ myButtonOk = new QPushButton (tr("&OK"), GroupButtons);
+ myButtonOk->setAutoDefault(true);
+ myButtonOk->setDefault(true);
QPushButton* buttonCancel = new QPushButton (tr("&Cancel") , GroupButtons);
buttonCancel->setAutoDefault(true);
QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons);
buttonHelp->setAutoDefault(true);
- GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addWidget(myButtonOk);
GroupButtonsLayout->addSpacing(10);
GroupButtonsLayout->addStretch();
GroupButtonsLayout->addWidget(buttonCancel);
TopLayout->addWidget(GroupButtons);
// signals and slots connections
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
+ connect(myButtonOk, SIGNAL(clicked()), this, SLOT(accept()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
connect(myFieldsCombo, SIGNAL(activated(int)), this, SLOT(onFieldChanged(int)));
}
void VisuGUI_DeformedShapeAndScalarMapDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TDEFORMEDSHAPEANDSCALARMAP>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
CORBA::String_var aFieldName(myPrsCopy->GetScalarFieldName());
QString aIteration = GetFloatValueOfTimeStamp(myPrsCopy->GetScalarEntity(),
- aFieldName.in(),
- myPrsCopy->GetScalarTimeStampNumber());
+ aFieldName.in(),
+ myPrsCopy->GetScalarTimeStampNumber());
if (myEntity2Fields.size() == 0)
{
// find all fields and time stamps on it
if (selected.Extent() > 0) {
Handle(SALOME_InteractiveObject) aIO = selected.First();
if (aIO->hasEntry()) {
- _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
- VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
- switch(aType){
- 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();
-
- mySelectionObj = aSObject;
- CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
- if (CORBA::is_nil(anObject)) {
- mySelectionObj = mySelectionObj->GetFather();
- }
+ _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
+ VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
+ switch(aType){
+ 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();
+
+ mySelectionObj = aSObject;
+ CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
+ if (CORBA::is_nil(anObject)) {
+ mySelectionObj = mySelectionObj->GetFather();
+ }
}
}
for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
_PTR(SObject) aChildSObj = aIter->Value();
- VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildSObj);
+ VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildSObj);
if (!aRestoringMap.empty()) {
- VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap);
- if (aType == VISU::TTIMESTAMP) {
- QString aMeshName = aRestoringMap["myMeshName"];
- CORBA::String_var aName = myPrsCopy->GetMeshName();
- if (aMeshName != aName.in())
- continue;
- QString aFieldName = aRestoringMap["myFieldName"];
- QString aTimeIter = aRestoringMap["myTimeStampId"];
- QString aEntity = aRestoringMap["myEntityId"];
- VISU::Entity anEntity;
- switch (aEntity.toInt()) {
- case 0: anEntity = VISU::NODE; break;
- case 1: anEntity = VISU::EDGE; break;
- case 2: anEntity = VISU::FACE; break;
- case 3: anEntity = VISU::CELL; break;
- }
- TFieldName2TimeStamps& aFieldName2TimeStamps = myEntity2Fields[anEntity];
- TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldName2TimeStamps[aFieldName];
- aTimeStampNumber2Time[aTimeIter.toInt()] =
- GetFloatValueOfTimeStamp(anEntity,
- aFieldName.toLatin1().constData(),
- aTimeIter.toInt());
- }
+ VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap);
+ if (aType == VISU::TTIMESTAMP) {
+ QString aMeshName = aRestoringMap["myMeshName"];
+ CORBA::String_var aName = myPrsCopy->GetMeshName();
+ if (aMeshName != aName.in())
+ continue;
+ QString aFieldName = aRestoringMap["myFieldName"];
+ QString aTimeIter = aRestoringMap["myTimeStampId"];
+ QString aEntity = aRestoringMap["myEntityId"];
+ VISU::Entity anEntity;
+ switch (aEntity.toInt()) {
+ case 0: anEntity = VISU::NODE; break;
+ case 1: anEntity = VISU::EDGE; break;
+ case 2: anEntity = VISU::FACE; break;
+ case 3: anEntity = VISU::CELL; break;
+ }
+ TFieldName2TimeStamps& aFieldName2TimeStamps = myEntity2Fields[anEntity];
+ TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldName2TimeStamps[aFieldName];
+ aTimeStampNumber2Time[aTimeIter.toInt()] =
+ GetFloatValueOfTimeStamp(anEntity,
+ aFieldName.toLatin1().constData(),
+ aTimeIter.toInt());
+ }
}
}
}
myPrsCopy->SetScale(getFactor());
myPrsCopy->SetScalarField(myPrsCopy->GetScalarEntity(),
- getCurrentScalarFieldName().toLatin1().constData(),
- myTimeStampID[ myTimeStampsCombo->currentIndex() ]);
+ getCurrentScalarFieldName().toLatin1().constData(),
+ myTimeStampID[ myTimeStampsCombo->currentIndex() ]);
if(myUpdateScalars)
SetScalarField( false );
for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
const QString& aFieldName = aFieldIter->first;
if (aFieldName == myFieldsCombo->currentText()) {
- anEntity = anIter->first;
- break;
+ anEntity = anIter->first;
+ break;
}
}
}
void
VisuGUI_DeformedShapeAndScalarMapDlg
::SetScalarField(int theIter,
- QString theFieldName,
- const bool save_scalar_pane )
+ QString theFieldName,
+ const bool save_scalar_pane )
{
QApplication::setOverrideCursor(Qt::WaitCursor);
- if( save_scalar_pane )
+ if( save_scalar_pane && IsScalarFieldValid() )
GetScalarPane()->storeToPrsObject(myPrsCopy);
QString aFieldName;
VISU::Entity anEntity = getCurrentScalarEntity();
- myPrsCopy->SetScalarField(anEntity,
- aFieldName.toLatin1().constData(),
- theIter);
-
- if( save_scalar_pane )
- UpdateScalarField();
+ try {
+ myPrsCopy->SetScalarField(anEntity,
+ aFieldName.toLatin1().constData(),
+ theIter);
+ if( save_scalar_pane )
+ UpdateScalarField();
+ myIsScalarFieldValid = true;
+ } catch( std::exception& exc ) {
+ INFOS( exc.what() );
+ SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ), tr( "ERR_SCALAR_DATA_INCONSISTENT" ) );
+ myIsScalarFieldValid = false;
+ }
+ updateControls();
QApplication::restoreOverrideCursor();
}
for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
const QString& aFieldName = aFieldIter->first;
if(theFieldName != aFieldName)
- continue;
+ continue;
myTimeStampID.clear();
myTimeStampsCombo->clear();
const TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldIter->second;
TTimeStampNumber2Time::const_iterator aTimeStampIter = aTimeStampNumber2Time.begin();
for(; aTimeStampIter != aTimeStampNumber2Time.end(); aTimeStampIter++){
- int aTimeStampNumber = aTimeStampIter->first;
- myTimeStampID.push_back(aTimeStampNumber);
+ int aTimeStampNumber = aTimeStampIter->first;
+ myTimeStampID.push_back(aTimeStampNumber);
- QString aTimeStampTime = aTimeStampIter->second;
- myTimeStampsCombo->addItem(aTimeStampTime);
+ QString aTimeStampTime = aTimeStampIter->second;
+ myTimeStampsCombo->addItem(aTimeStampTime);
}
if(currentTimeStampId >= myTimeStampID.size())
currentTimeStampId = myTimeStampID.size()-1;
void VisuGUI_DeformedShapeAndScalarMapDlg::onFieldChanged(int){
AddAllTimes(myFieldsCombo->currentText());
SetScalarField();
- UpdateScalarField();
+ //UpdateScalarField(); // it is called from SetScalarField() method
}
void VisuGUI_DeformedShapeAndScalarMapDlg::onTimeStampChanged(int){
SetScalarField();
- UpdateScalarField();
+ //UpdateScalarField(); // it is called from SetScalarField() method
}
void VisuGUI_DeformedShapeAndScalarMapDlg::UpdateScalarField(){
QString
VisuGUI_DeformedShapeAndScalarMapDlg
::GetFloatValueOfTimeStamp(VISU::Entity theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber)
+ const std::string& theFieldName,
+ int theTimeStampNumber)
{
QString aTime("");
VISU::TEntity anEntity = VISU::TEntity(theEntity);
VISU::Result_i* theResult = myPrsCopy->GetCResult();
VISU::Result_i::PInput anInput = theResult->GetInput();
VISU::PField aField = anInput->GetField(myPrsCopy->GetCMeshName(),
- anEntity,
- theFieldName);
+ anEntity,
+ theFieldName);
if(!aField)
return aTime;
}
return aTime;
}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::updateControls()
+{
+ bool isScalarFieldValid = IsScalarFieldValid();
+ myTabBox->setTabEnabled( 1, isScalarFieldValid ); // "Scalar Bar" tab
+ myTabBox->setTabEnabled( 2, isScalarFieldValid ); // "Input" tab
+ myTimeStampsCombo->setEnabled( isScalarFieldValid );
+ myButtonOk->setEnabled( isScalarFieldValid );
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_DeformedShapeAndScalarMapDlg.h
// Author : Eugeny Nikolaev
class SalomeApp_Module;
class VisuGUI_InputPane;
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class QComboBox;
class QTabWidget;
void setFactor(double theFactor);
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
VISU::Entity getCurrentScalarEntity();
void SetScalarField(int theIter,QString theFieldName=QString(""), const bool = true );
+ bool IsScalarFieldValid() const { return myIsScalarFieldValid; }
+
protected:
virtual QString GetContextHelpFilePath();
void onTimeStampChanged(int i=0);
private:
- QtxDoubleSpinBox* ScalFact;
+ SalomeApp_DoubleSpinBox* ScalFact;
QTabWidget* myTabBox;
VisuGUI_ScalarBarPane* myScalarPane;
VisuGUI_InputPane* myInputPane;
QComboBox *myFieldsCombo;
QComboBox *myTimeStampsCombo;
+ QPushButton* myButtonOk;
typedef std::map<int, QString> TTimeStampNumber2Time; // Times map definition (iteration time, real value of time)
typedef std::map<QString, TTimeStampNumber2Time> TFieldName2TimeStamps; // Field name and enity to Times
_PTR(SObject) mySelectionObj;
SALOME::GenericObjPtr<VISU::DeformedShapeAndScalarMap_i> myPrsCopy;
SalomeApp_Module* myVisuGUI;
+
+ bool myIsScalarFieldValid;
protected:
void UpdateScalarField();
void AddAllFieldNames();
void AddAllTimes(const QString& theFieldName);
QString GetFloatValueOfTimeStamp(VISU::Entity theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber);
+ const std::string& theFieldName,
+ int theTimeStampNumber);
+ void updateControls();
};
#endif // VISUGUI_DEFORMEDSHAPEDLS_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_MagnitudeDlg.cxx
// Author : Laurent CORNABE & Hubert ROLLAND
#include "VisuGUI_Tools.h"
#include "VisuGUI_InputPane.h"
#include "VisuGUI.h"
+#include "VisuGUI_Prs3dTools.h"
+
#include "VISU_ColoredPrs3dFactory.hh"
#include "VISU_DeformedShape_i.hh"
#include "VisuGUI_ViewTools.h"
#include "VISU_Gen_i.hh"
#include "VISU_Result_i.hh"
-#include "VisuGUI_Prs3dTools.h"
+
#include "SVTK_ViewWindow.h"
#include "SalomeApp_Module.h"
+#include <SalomeApp_DoubleSpinBox.h>
#include "LightApp_Application.h"
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
QLabel* ScaleLabel = new QLabel (tr("SCALE_FACTOR"), TopGroup );
TopGroupLayout->addWidget(ScaleLabel, 0, 0);
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
-
- ScalFact = new QtxDoubleSpinBox (0, 1.0E+38, 0.1, aPrecision*(-1), 38, TopGroup);
+ ScalFact = new SalomeApp_DoubleSpinBox (TopGroup);
+ VISU::initSpinBox( ScalFact, 0., 1.0E+38, .1, "visual_data_precision" );
ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
ScalFact->setValue(0.1);
TopGroupLayout->addWidget(ScalFact, 0, 1);
return anIsOk;
}
-void VisuGUI_DeformedShapeDlg::updatePrsCopy()
+void VisuGUI_DeformedShapeDlg::updatePrsCopy( VISU::Prs3d_i* thePrs )
{
SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
VisuGUI* aVisuGUI = dynamic_cast <VisuGUI*>(myModule);
if ( myPrsCopy->GetNumberOfActors() == 0 ) {
PublishInView(aVisuGUI, myPrsCopy, aViewWindow);
+
+ // Bug 0020821
+ if( thePrs ) {
+ if( SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>( myModule ) ) {
+ VISU_Actor* anActorSource = VISU::FindActor( aViewWindow, thePrs );
+ VISU_Actor* anActorCopy = VISU::FindActor( aViewWindow, myPrsCopy );
+ if( anActorSource && anActorCopy )
+ anActorCopy->DeepCopy( anActorSource );
+ }
+ }
+
if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false))
aViewWindow->onFitAll();
int aPos = VISU::GetFreePositionOfDefaultScalarBar(aVisuGUI, aViewWindow);
INFOS(exc.what());
SUIT_MessageBox::warning(VISU::GetDesktop(myModule),
- tr("WRN_VISU"),
- tr("ERR_CANT_BUILD_PRESENTATION") + ": " + exc.what());
+ tr("WRN_VISU"),
+ tr("ERR_CANT_BUILD_PRESENTATION") + ": " + exc.what());
}
aViewWindow->Repaint();
}
{
if ( storeToPrsObject( myPrsCopy ) )
{
- updatePrsCopy();
+ updatePrsCopy( myPrsCopy );
isApplyed = true;
return true;
}
VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aTimeStamp);
VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap);
if ( aType == VISU::TTIMESTAMP )
- {
+ {
- QString aMeshName = aRestoringMap["myMeshName"];
- QString anEntity = aRestoringMap["myEntityId"];
- QString aFieldName = aRestoringMap["myFieldName"];
- QString aTimeStampId = aRestoringMap["myTimeStampId"];
-
- //typedef VISU::DeformedShape_i TPrs3d_i;
-
- aPrs3d =
- VISU::CreatePrs3dFromFactory<VISU::DeformedShape_i>(theModule,
- aTimeStamp,
- aMeshName.toLatin1().data(),
- (VISU::Entity)anEntity.toInt(),
- aFieldName.toLatin1().data(),
- aTimeStampId.toInt(),
- aPublishInStudyMode);
-
- if (aPrs3d) {
- VisuGUI_DeformedShapeDlg* aDlg = new VisuGUI_DeformedShapeDlg (theModule);
- aDlg->initFromPrsObject(aPrs3d, true);
- aDlg->UseMagn->setChecked(true);
- VisuGUI_DialogRunner r(aDlg);
- int dlgResult = r.run( false );
-
- if ( dlgResult == 0 )
- DeletePrs3d(theModule,aPrs3d);
- else {
- aDlg->storeToPrsObject( aPrs3d );
- SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
- PublishInView(theModule, aPrs3d, aViewWindow);
- if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false))
- aViewWindow->onFitAll();
- int aPos = VISU::GetFreePositionOfDefaultScalarBar(theModule, aViewWindow);
- VISU::AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos);
- }
-
- VISU::UpdateObjBrowser(theModule, true, aTimeStamp);
- delete aDlg;
- }
- }
+ QString aMeshName = aRestoringMap["myMeshName"];
+ QString anEntity = aRestoringMap["myEntityId"];
+ QString aFieldName = aRestoringMap["myFieldName"];
+ QString aTimeStampId = aRestoringMap["myTimeStampId"];
+
+ //typedef VISU::DeformedShape_i TPrs3d_i;
+
+ aPrs3d =
+ VISU::CreatePrs3dFromFactory<VISU::DeformedShape_i>(theModule,
+ aTimeStamp,
+ aMeshName.toLatin1().data(),
+ (VISU::Entity)anEntity.toInt(),
+ aFieldName.toLatin1().data(),
+ aTimeStampId.toInt(),
+ aPublishInStudyMode);
+
+ if (aPrs3d) {
+ VisuGUI_DeformedShapeDlg* aDlg = new VisuGUI_DeformedShapeDlg (theModule);
+ aDlg->initFromPrsObject(aPrs3d, true);
+ aDlg->UseMagn->setChecked(true);
+ VisuGUI_DialogRunner r(aDlg);
+ int dlgResult = r.run( false );
+
+ if ( dlgResult == 0 )
+ DeletePrs3d(theModule,aPrs3d);
+ else {
+ aDlg->storeToPrsObject( aPrs3d );
+ SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
+ PublishInView(theModule, aPrs3d, aViewWindow);
+ if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false))
+ aViewWindow->onFitAll();
+ int aPos = VISU::GetFreePositionOfDefaultScalarBar(theModule, aViewWindow);
+ VISU::AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos);
+ }
+
+ VISU::UpdateObjBrowser(theModule, true, aTimeStamp);
+ delete aDlg;
+ }
+ }
}
return aPrs3d;
}
if (TPrs3d_i* aPrs3d = dynamic_cast<TPrs3d_i*>(thePrs3d)) {
VisuGUI_DeformedShapeDlg* aDlg = new VisuGUI_DeformedShapeDlg (theModule);
aDlg->initFromPrsObject(aPrs3d, true);
- aDlg->updatePrsCopy();
+ aDlg->updatePrsCopy(thePrs3d);
//Hide thePrs3d from Viewer
SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule);
if (aViewWindow)
if (VISU_Actor* anActor = FindActor(aViewWindow, thePrs3d))
- if (anActor->GetVisibility())
- anActor->VisibilityOff();
+ if (anActor->GetVisibility())
+ anActor->VisibilityOff();
VisuGUI_DialogRunner r(aDlg);
- int dlgResult = r.run( false );
+ int dlgResult = r.run( true );
if ( dlgResult != 0 )
aDlg->storeToPrsObject( aPrs3d );
INFOS(exc.what());
SUIT_MessageBox::warning
- (VISU::GetDesktop(theModule), QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()));
+ (VISU::GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()));
}
if (aViewWindow)
if (VISU_Actor* anActor = FindActor(aViewWindow, thePrs3d))
- if (!anActor->GetVisibility())
- anActor->VisibilityOn();
+ if (!anActor->GetVisibility())
+ anActor->VisibilityOn();
delete aDlg;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_MagnitudeDlg.h
// Author : Laurent CORNABE & Hubert ROLLAND
#include "VisuGUI_Prs3dDlg.h"
-#include "QtxDoubleSpinBox.h"
+#include <SalomeApp_DoubleSpinBox.h>
#include <QCheckBox>
class QTabWidget;
-
-
-class QtxDoubleSpinBox;
class SalomeApp_Module;
class VisuGUI_InputPane;
class VisuGUI;
{ return UseMagn->isChecked(); }
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
static VISU::Prs3d_i* CreatePrs3d(VisuGUI* theModule);
static void EditPrs3d(VisuGUI* theModule, VISU::Prs3d_i* thePrs3d, Handle(SALOME_InteractiveObject)& theIO);
- void updatePrsCopy();
+ void updatePrsCopy( VISU::Prs3d_i* thePrs );
protected:
virtual QString GetContextHelpFilePath();
- int isValid();
+ int isValid();
protected slots:
void accept();
bool onApply();
void reject();
private:
- QtxDoubleSpinBox* ScalFact;
+ SalomeApp_DoubleSpinBox* ScalFact;
QCheckBox* UseMagn;
QTabWidget* myTabBox;
VisuGUI_InputPane* myInputPane;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: VisuGUI_DialogRunner.cxx
-// Created: Thu Oct 6 10:17:39 2005
-// Author: Alexander SOLOVYOV
-// <asl@multiplex.nnov.opencascade.com>
+
+// File: VisuGUI_DialogRunner.cxx
+// Created: Thu Oct 6 10:17:39 2005
+// Author: Alexander SOLOVYOV
+// <asl@multiplex.nnov.opencascade.com>
//
#include "VisuGUI_DialogRunner.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DIALOG_RUNNER_HEADER
#define DIALOG_RUNNER_HEADER
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : Displayer for VISU module
// File : VisuGUI_Displayer.cxx
// Author : Alexander SOLOVYOV
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VISU_Tools.h"
#include "VISU_ViewManager_i.hh"
#include "VISU_Actor.h"
+#include <VISU_Table_i.hh>
+
//#include "VVTK_ViewModel.h"
#include <SVTK_ViewModel.h>
#include <SUIT_MessageBox.h>
#include <SUIT_Desktop.h>
+
+
+void changeVisibility(int theDisplaying, QString entry, SalomeApp_Study* study)
+{
+ _PTR(SObject) obj = study->studyDS()->FindObjectID( (const char*)entry.toLatin1() );
+ CORBA::Object_var anObj = VISU::ClientSObjectToObject( obj );
+ if( CORBA::is_nil( anObj ) )
+ return;
+
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>( VISU::GetServant( anObj ).in()) ) {
+ VISU::CurveVisibilityChanged(aCurve,theDisplaying, false, true, true);
+ }
+
+ if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>( VISU::GetServant( anObj ).in()) ) {
+ int nbCurves = aContainer->GetNbCurves();
+ for( int k=1; k<=nbCurves; k++ ) {
+ VISU::Curve_i* aCurve = aContainer->GetCurve( k );
+ if(aCurve)
+ VISU::CurveVisibilityChanged(aCurve,theDisplaying, true, true, true);
+ }
+ }
+
+ if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>( VISU::GetServant( anObj ).in()) ) {
+ _PTR(SObject) TableSO = study->studyDS()->FindObjectID( aTable->GetEntry() );
+ if ( TableSO ) {
+ _PTR(ChildIterator) Iter = study->studyDS()->NewChildIterator( TableSO );
+
+ for ( ; Iter->More(); Iter->Next() ) {
+ CORBA::Object_var childObject = VISU::ClientSObjectToObject( Iter->Value() );
+ if( !CORBA::is_nil( childObject ) ) {
+ CORBA::Object_ptr aCurve_ptr = VISU::Curve::_narrow( childObject );
+ if( !CORBA::is_nil( aCurve_ptr ) ) {
+ VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve_ptr).in());
+ if(aCurve)
+ VISU::CurveVisibilityChanged(aCurve,theDisplaying, true, false, true);
+ }
+ }
+ }
+ }
+ }
+}
+
+
VisuGUI_Displayer::VisuGUI_Displayer( SalomeApp_Application* app )
: LightApp_Displayer(),
myApp( app )
{
}
+
+bool VisuGUI_Displayer::IsDisplayed( const QString& id, SALOME_View* vf ) const {
+
+ bool displayed = false;
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() );
+ if(!aStudy)
+ return displayed;
+
+ _PTR(SObject) aSObject = aStudy->studyDS()->FindObjectID( (const char*)id.toLatin1() );
+ CORBA::Object_var anObj = VISU::ClientSObjectToObject( aSObject );
+ if( CORBA::is_nil( anObj ) )
+ return LightApp_Displayer::IsDisplayed(id, vf);
+
+ if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>( VISU::GetServant( anObj ).in())) {
+ int nbCurves = aContainer->GetNbCurves();
+ for( int k=1; k<=nbCurves; k++ ) {
+ VISU::Curve_i* aCurve = aContainer->GetCurve( k );
+ if(aCurve && LightApp_Displayer::IsDisplayed(aCurve->GetEntry().c_str(), vf)) {
+ displayed = true;
+ break;
+ }
+ }
+ return displayed;
+ } else if( VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>( VISU::GetServant( anObj ).in()) ) {
+
+ SPlot2d_Viewer* view2D = dynamic_cast<SPlot2d_Viewer*>(vf);
+ if( !view2D )
+ return LightApp_Displayer::IsDisplayed(id, vf);
+
+ _PTR(SObject) TableSO = aStudy->studyDS()->FindObjectID( (const char*)id.toLatin1() );
+ if( TableSO ) {
+ _PTR(ChildIterator) Iter = aStudy->studyDS()->NewChildIterator( TableSO );
+ for( ; Iter->More(); Iter->Next() ) {
+ CORBA::Object_var childObject = VISU::ClientSObjectToObject( Iter->Value() );
+ if( !CORBA::is_nil( childObject ) ) {
+ CORBA::Object_ptr aCurve = VISU::Curve::_narrow( childObject );
+ if( !CORBA::is_nil( aCurve ) ) {
+ VISU::Curve_i* aCurve_i = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
+ if(aCurve && LightApp_Displayer::IsDisplayed(aCurve_i->GetEntry().c_str(), vf)) {
+ displayed = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ return displayed;
+ } else {
+ return LightApp_Displayer::IsDisplayed(id, vf);
+ }
+}
+
SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& theEntry, SALOME_View* theView )
{
SALOME_Prs* aPrs = 0;
//if (!aViewer)
//aViewer = dynamic_cast<SVTK_Viewer*>( aView );
if( aViewer ){
- SUIT_ViewManager* aViewManager = aViewer->getViewManager();
- SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
- if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>( aWindow )){
- VISU::Prs3d_i* aPrs3d = NULL;
- if(aType == VISU::TCOLOREDPRS3DHOLDER){
- VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(aBase);
- VISU::ColoredPrs3d_var aColoredPrs3d = aHolder->GetDevice();
- aPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aColoredPrs3d).in());
- }else if (aType == VISU::TPOINTMAP3D) {
- VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(aBaseServant);
- VISU_ActorBase* anActorBase = VISU::FindActorBase(aViewWindow, aTable3d);
- if (anActorBase) {
- anActorBase->SetVisibility(true);
- aViewWindow->Repaint();
- }
- else {
- VISU_PointMap3dActor* aPointMap3dActor = aTable3d->CreateActor();
- if (aPointMap3dActor) {
- aViewWindow->AddActor(aPointMap3dActor);
- aPointMap3dActor->SetVisibility(true);
- aViewWindow->Repaint();
- }
- }
- }
- else
- aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aBaseServant);
-
- if(aPrs3d){
- buildPrs3d( aViewWindow, aPrs3d );
- Handle(SALOME_InteractiveObject) anIO = aPrs3d->GetIO();
- if(anIO->hasEntry()){
- std::string anEntry = anIO->getEntry();
- aPrs = LightApp_Displayer::buildPresentation( anEntry.c_str(), aView );
- }
- }
- }
+ SUIT_ViewManager* aViewManager = aViewer->getViewManager();
+ SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
+ if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>( aWindow )){
+ VISU::Prs3d_i* aPrs3d = NULL;
+ if(aType == VISU::TCOLOREDPRS3DHOLDER){
+ VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(aBase);
+ VISU::ColoredPrs3d_var aColoredPrs3d = aHolder->GetDevice();
+ aPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aColoredPrs3d).in());
+ }else if (aType == VISU::TPOINTMAP3D) {
+ VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(aBaseServant);
+ VISU_ActorBase* anActorBase = VISU::FindActorBase(aViewWindow, aTable3d);
+ if (anActorBase) {
+ anActorBase->SetVisibility(true);
+ aViewWindow->Repaint();
+ }
+ else {
+ VISU_PointMap3dActor* aPointMap3dActor = aTable3d->CreateActor();
+ if (aPointMap3dActor) {
+ aViewWindow->AddActor(aPointMap3dActor);
+ aPointMap3dActor->SetVisibility(true);
+ aViewWindow->Repaint();
+ }
+ }
+ VISU::SetVisibilityState(qPrintable(theEntry),Qtx::ShownState);
+ }
+ else
+ aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aBaseServant);
+
+ if(aPrs3d){
+ buildPrs3d( aViewWindow, aPrs3d );
+ Handle(SALOME_InteractiveObject) anIO = aPrs3d->GetIO();
+ if(anIO->hasEntry()){
+ std::string anEntry = anIO->getEntry();
+ aPrs = LightApp_Displayer::buildPresentation( anEntry.c_str(), aView );
+ }
+ }
+ }
}
}
if (aView) aViewer = dynamic_cast<SPlot2d_Viewer*>(aView);
if(!aViewer && (aType==VISU::TCURVE || aType==VISU::TCONTAINER))
if(VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>(myApp->activeModule()))
- aViewer = VISU::GetPlot2dViewer( (SalomeApp_Module*)aVisuGUI, true );
+ aViewer = VISU::GetPlot2dViewer( (SalomeApp_Module*)aVisuGUI, true );
if(aViewer){
SUIT_ViewManager* aViewManager = aViewer->getViewManager();
SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
Plot2d_ViewWindow* aViewWindow = dynamic_cast<Plot2d_ViewWindow*>( aWindow );
if( !aViewWindow )
- return 0;
+ return 0;
SPlot2d_Prs* aPlot2dPrs = 0;
switch (aType) {
case VISU::TCURVE: {
- VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBaseServant);
- aPlot2dPrs = buildCurve( aViewWindow, aCurve );
- break;
+ VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBaseServant);
+ aPlot2dPrs = buildCurve( aViewWindow, aCurve );
+ break;
}
case VISU::TCONTAINER: {
- VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBaseServant);
- aPlot2dPrs = buildContainer( aViewWindow, aContainer );
- break;
+ VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBaseServant);
+ aPlot2dPrs = buildContainer( aViewWindow, aContainer );
+ break;
}
case VISU::TPOINTMAP3D: {
- VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBaseServant);
- aPlot2dPrs = buildTable( aViewWindow, aTable );
- break;
+ VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBaseServant);
+ aPlot2dPrs = buildTable( aViewWindow, aTable );
+ break;
}
case VISU::TTABLE: {
- VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBaseServant);
- aPlot2dPrs = buildTable( aViewWindow, aTable );
- break;
+ VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBaseServant);
+ aPlot2dPrs = buildTable( aViewWindow, aTable );
+ break;
}}
if( aPlot2dPrs )
- aPrs = new SPlot2d_Prs( aPlot2dPrs );
+ aPrs = new SPlot2d_Prs( aPlot2dPrs );
if( aPrs )
- UpdatePrs( aPrs );
+ UpdatePrs( aPrs );
}
}
return aPrs;
if( theCurve && theCurve->IsValid() )
addCurve( prs, wnd, theCurve );
}
- if( prs->getCurves().count()==0 )
+ if( prs->getObjects().count()==0 )
{
delete prs;
prs = 0;
CORBA::Object_ptr aCurve = VISU::Curve::_narrow( childObject );
if( !CORBA::is_nil( aCurve ) )
{
- VISU::Curve_i* theCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
- addCurve( prs, wnd, theCurve );
+ VISU::Curve_i* theCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
+ addCurve( prs, wnd, theCurve );
}
}
}
- if( prs->getCurves().count()==0 )
+ if( prs->getObjects().count()==0 )
{
delete prs;
prs = 0;
if( study->isComponent( entry ) )
return true;
- if( dynamic_cast<VISU::Curve_i*>( VISU::GetServant( anObj ).in() )
- ||
- dynamic_cast<VISU::Container_i*>( VISU::GetServant( anObj ).in() ) )
+ if( (dynamic_cast<VISU::Curve_i*>( VISU::GetServant( anObj ).in() )
+ ||
+ dynamic_cast<VISU::Container_i*>( VISU::GetServant( anObj ).in() ))
+ && viewer_type==SPlot2d_Viewer::Type())
return true;
if( viewer_type==SVTK_Viewer::Type() /*|| viewer_type==VVTK_Viewer::Type()*/)
else
return false;
}
+
+void VisuGUI_Displayer::AfterDisplay( SALOME_View* vf, const SALOME_Prs2d* p ) {
+ changeVisibility(VISU::eDisplay, myLastEntry, dynamic_cast<SalomeApp_Study*>( myApp->activeStudy()));
+}
+
+void VisuGUI_Displayer::AfterErase( SALOME_View* vf, const SALOME_Prs2d* p ) {
+ changeVisibility(VISU::eErase, myLastEntry, dynamic_cast<SalomeApp_Study*>( myApp->activeStudy()));
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : Displayer for VISU module
// File : VisuGUI_Displayer.h
// Author : Alexander SOLOVYOV
virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 );
virtual bool canBeDisplayed( const QString& /*entry*/, const QString& /*viewer_type*/ ) const;
+ virtual bool IsDisplayed( const QString&, SALOME_View* = 0 ) const;
+
+ virtual void AfterDisplay ( SALOME_View*, const SALOME_Prs2d* );
+ virtual void AfterErase( SALOME_View*, const SALOME_Prs2d* );
protected:
bool addCurve ( SPlot2d_Prs*, Plot2d_ViewWindow*, VISU::Curve_i* ) const;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_EditContainerDlg.cxx
// Author : VSV
// Module : VISU
/* XPM */
static const char * left_xpm[] = {
"24 24 61 1",
-" c None",
-". c #323232",
-"+ c #010101",
-"@ c #4A4A4A",
-"# c #040404",
-"$ c #979797",
-"% c #7B7B7B",
-"& c #939393",
-"* c #EEEEEE",
-"= c #686868",
-"- c #030303",
-"; c #9C9C9C",
-"> c #FFFFFF",
-", c #B1B1B1",
-"' c #5E5E5E",
-") c #060606",
-"! c #C1C1C1",
-"~ c #626262",
-"{ c #000000",
-"] c #989898",
-"^ c #A1A1A1",
-"/ c #A5A5A5",
-"( c #909090",
-"_ c #868686",
-": c #616161",
-"< c #959595",
-"[ c #919191",
-"} c #848484",
-"| c #606060",
-"1 c #0B0B0B",
-"2 c #545454",
-"3 c #727272",
-"4 c #A2A2A2",
-"5 c #969696",
-"6 c #838383",
-"7 c #5F5F5F",
-"8 c #101010",
-"9 c #434343",
-"0 c #6B6B6B",
-"a c #858585",
-"b c #8E8E8E",
-"c c #373737",
-"d c #696969",
-"e c #8D8D8D",
-"f c #B5B5B5",
-"g c #111111",
-"h c #393939",
-"i c #898989",
-"j c #B0B0B0",
-"k c #191919",
-"l c #3A3A3A",
-"m c #646464",
-"n c #535353",
-"o c #050505",
-"p c #353535",
-"q c #585858",
-"r c #4C4C4C",
-"s c #0D0D0D",
-"t c #3E3E3E",
-"u c #020202",
-"v c #0A0A0A",
+" c None",
+". c #323232",
+"+ c #010101",
+"@ c #4A4A4A",
+"# c #040404",
+"$ c #979797",
+"% c #7B7B7B",
+"& c #939393",
+"* c #EEEEEE",
+"= c #686868",
+"- c #030303",
+"; c #9C9C9C",
+"> c #FFFFFF",
+", c #B1B1B1",
+"' c #5E5E5E",
+") c #060606",
+"! c #C1C1C1",
+"~ c #626262",
+"{ c #000000",
+"] c #989898",
+"^ c #A1A1A1",
+"/ c #A5A5A5",
+"( c #909090",
+"_ c #868686",
+": c #616161",
+"< c #959595",
+"[ c #919191",
+"} c #848484",
+"| c #606060",
+"1 c #0B0B0B",
+"2 c #545454",
+"3 c #727272",
+"4 c #A2A2A2",
+"5 c #969696",
+"6 c #838383",
+"7 c #5F5F5F",
+"8 c #101010",
+"9 c #434343",
+"0 c #6B6B6B",
+"a c #858585",
+"b c #8E8E8E",
+"c c #373737",
+"d c #696969",
+"e c #8D8D8D",
+"f c #B5B5B5",
+"g c #111111",
+"h c #393939",
+"i c #898989",
+"j c #B0B0B0",
+"k c #191919",
+"l c #3A3A3A",
+"m c #646464",
+"n c #535353",
+"o c #050505",
+"p c #353535",
+"q c #585858",
+"r c #4C4C4C",
+"s c #0D0D0D",
+"t c #3E3E3E",
+"u c #020202",
+"v c #0A0A0A",
" ",
" ",
" .+ .+ ",
static const char * right_xpm[] = {
"24 24 43 1",
-" g None",
-". g #323232",
-"+ g #5D5D5D",
-"@ g #000000",
-"# g #C4C4C4",
-"$ g #313131",
-"% g #C5C5C5",
-"& g #E4E4E4",
-"* g #2D2D2D",
-"= g #B7B7B7",
-"- g #EFEFEF",
-"; g #DCDCDC",
-"> g #282828",
-", g #AFAFAF",
-"' g #E0E0E0",
-") g #242424",
-"! g #C7C7C7",
-"~ g #9A9A9A",
-"{ g #8E8E8E",
-"] g #1F1F1F",
-"^ g #A5A5A5",
-"/ g #989898",
-"( g #888888",
-"_ g #1B1B1B",
-": g #ADADAD",
-"< g #858585",
-"[ g #838383",
-"} g #868686",
-"| g #929292",
-"1 g #C1C1C1",
-"2 g #161616",
-"3 g #909090",
-"4 g #747474",
-"5 g #3A3A3A",
-"6 g #121212",
-"7 g #0D0D0D",
-"8 g #7A7A7A",
-"9 g #8A8A8A",
-"0 g #090909",
-"a g #040404",
-"b g #707070",
-"c g #6E6E6E",
-"d g #3F3F3F",
+" g None",
+". g #323232",
+"+ g #5D5D5D",
+"@ g #000000",
+"# g #C4C4C4",
+"$ g #313131",
+"% g #C5C5C5",
+"& g #E4E4E4",
+"* g #2D2D2D",
+"= g #B7B7B7",
+"- g #EFEFEF",
+"; g #DCDCDC",
+"> g #282828",
+", g #AFAFAF",
+"' g #E0E0E0",
+") g #242424",
+"! g #C7C7C7",
+"~ g #9A9A9A",
+"{ g #8E8E8E",
+"] g #1F1F1F",
+"^ g #A5A5A5",
+"/ g #989898",
+"( g #888888",
+"_ g #1B1B1B",
+": g #ADADAD",
+"< g #858585",
+"[ g #838383",
+"} g #868686",
+"| g #929292",
+"1 g #C1C1C1",
+"2 g #161616",
+"3 g #909090",
+"4 g #747474",
+"5 g #3A3A3A",
+"6 g #121212",
+"7 g #0D0D0D",
+"8 g #7A7A7A",
+"9 g #8A8A8A",
+"0 g #090909",
+"a g #040404",
+"b g #707070",
+"c g #6E6E6E",
+"d g #3F3F3F",
" ",
" ",
" .. .. ",
VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
if (!CORBA::is_nil(aVisuObj)) {
if (aVisuObj->GetType() == VISU::TCURVE) {
- _PTR(SObject) aTableSO = aSObject->GetFather();
- CurveStruct aEntry;
- aEntry.TableName = getSObjectName(aTableSO);
- aEntry.CurveName = getSObjectName(aSObject);
- aEntry.CurveEntry = aSObject->GetID().c_str();
- aStudyCurves.append(aEntry);
+ _PTR(SObject) aTableSO = aSObject->GetFather();
+ CurveStruct aEntry;
+ aEntry.TableName = getSObjectName(aTableSO);
+ aEntry.CurveName = getSObjectName(aSObject);
+ aEntry.CurveEntry = aSObject->GetID().c_str();
+ aStudyCurves.append(aEntry);
}
}
}
for (it = aStudyCurves.begin(); it != aStudyCurves.end(); ++it) {
for (it2 = aContainerCurves.begin(); it2 != aContainerCurves.end(); ++it2) {
if (isExist = ((*it).CurveEntry == (*it2).CurveEntry))
- break;
+ break;
}
if (!isExist)
{
if (aCurveSO) {
CORBA::Object_var aObject = VISU::ClientSObjectToObject(aCurveSO);
if (!CORBA::is_nil(aObject)) {
- VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aObject).in());
- if (aCurve) theContainer->AddCurve(aCurve->_this());
+ VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aObject).in());
+ if (aCurve) theContainer->AddCurve(aCurve->_this());
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_EditContainerDlg.h
// Author : VSV
// Module : VISU
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VisuGUI_EvolutionDlg.cxx
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#include "VisuGUI_EvolutionDlg.h"
+
+#include "VisuGUI.h"
+#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
+
+#include <VISU_Evolution.h>
+
+#include <VISU_Gen_i.hh>
+#include <VISU_Result_i.hh>
+
+#include <VISU_Convertor.hxx>
+
+#include <SALOME_InteractiveObject.hxx>
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_Desktop.h>
+
+#include <LightApp_SelectionMgr.h>
+
+#include <SPlot2d_ViewModel.h>
+#include <Plot2d_ViewFrame.h>
+
+#include <QComboBox>
+#include <QGroupBox>
+#include <QIntValidator>
+#include <QKeyEvent>
+#include <QLabel>
+#include <QLayout>
+#include <QLineEdit>
+
+#include <vtkDataSetMapper.h>
+
+VisuGUI_EvolutionDlg::VisuGUI_EvolutionDlg( VisuGUI* theModule, _PTR(Study) theStudy ) :
+ QtxDialog( VISU::GetDesktop( theModule ), false, false, QtxDialog::Standard, Qt::Dialog ),
+ myModule( theModule ),
+ myViewWindow( NULL ),
+ myPreviewActor( NULL )
+{
+ setWindowTitle( tr( "TITLE" ) );
+ setAttribute( Qt::WA_DeleteOnClose, true );
+
+ myEngine = new VISU_Evolution( theStudy );
+
+ QFrame* aMainFrame = mainFrame();
+
+ // Parameters
+ QGroupBox* aParamGrp = new QGroupBox( tr( "PARAMETERS" ), aMainFrame );
+
+ QLabel* aFieldLabel = new QLabel( tr( "FIELD" ), aParamGrp );
+ myFieldLE = new QLineEdit( aParamGrp );
+ myFieldLE->setReadOnly( true );
+
+ QLabel* aPointLabel = new QLabel( tr( "POINT" ) );
+ myPointLE = new QLineEdit( aParamGrp );
+
+ myPointValidator = new QIntValidator( this );
+ myPointLE->setValidator( myPointValidator );
+
+ QLabel* aComponentLabel = new QLabel( tr( "COMPONENT" ) );
+ myComponentCB = new QComboBox( aParamGrp );
+ myComponentCB->setEditable( false );
+
+ QGridLayout* aParamLayout = new QGridLayout( aParamGrp );
+ aParamLayout->setMargin( 11 );
+ aParamLayout->setSpacing( 6 );
+ aParamLayout->addWidget( aFieldLabel, 0, 0 );
+ aParamLayout->addWidget( myFieldLE, 0, 1 );
+ aParamLayout->addWidget( aPointLabel, 1, 0 );
+ aParamLayout->addWidget( myPointLE, 1, 1 );
+ aParamLayout->addWidget( aComponentLabel, 2, 0 );
+ aParamLayout->addWidget( myComponentCB, 2, 1 );
+
+ // Common
+ QBoxLayout* aMainLayout = new QVBoxLayout( aMainFrame );
+ aMainLayout->setMargin( 0 );
+ aMainLayout->setSpacing( 0 );
+ aMainLayout->addWidget( aParamGrp );
+
+ connect( myPointLE, SIGNAL( textEdited( const QString& ) ),
+ this, SLOT( onPointEdited( const QString& ) ) );
+
+ connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+ this, SLOT( onSelectionEvent() ) );
+
+ connect( this, SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) );
+
+ myStoredSelectionMode = ActorSelection;
+
+ myViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>( myModule );
+ if( myViewWindow )
+ {
+ connect( myViewWindow, SIGNAL( destroyed() ), this, SLOT( onViewWindowClosed() ) );
+ connect( myViewWindow, SIGNAL( closing( SUIT_ViewWindow* ) ), this, SLOT( onViewWindowClosed() ) );
+ }
+}
+
+//------------------------------------------------------------------------
+VisuGUI_EvolutionDlg::~VisuGUI_EvolutionDlg()
+{
+ if( myEngine != NULL )
+ {
+ delete myEngine;
+ myEngine = NULL;
+ }
+}
+
+//------------------------------------------------------------------------
+bool VisuGUI_EvolutionDlg::setField( _PTR(SObject) theField )
+{
+ if( myEngine->setField( theField ) )
+ {
+ updateFromEngine();
+ return true;
+ }
+ return false;
+}
+
+//------------------------------------------------------------------------
+void VisuGUI_EvolutionDlg::updateFromEngine()
+{
+ std::string aFieldName = myEngine->getFieldName();
+ myFieldLE->setText( QString( aFieldName.c_str() ) );
+
+ int aNbPoints = myEngine->getNbPoints();
+ myPointValidator->setRange( 0, aNbPoints-1 );
+
+ QStringList aComponentList;
+ VISU::ComponentDataList aComponentDataList = myEngine->getComponentDataList();
+ int aNbComp = aComponentDataList.size();
+
+ bool isModulus;
+ int aComponentId = 0;
+ VISU::ComponentDataListIterator anIter( aComponentDataList );
+ while( anIter.hasNext() )
+ {
+ VISU::ComponentData aComponentData = anIter.next();
+ QString aComponent = aComponentData.first;
+ QString anUnit = aComponentData.second;
+
+ isModulus = aNbComp > 1 && aComponentId == 0;
+ if( !isModulus )
+ {
+ aComponent = "[" + QString::number( aComponentId ) + "] " + aComponent;
+ if( anUnit.isEmpty() )
+ anUnit = "-";
+ aComponent = aComponent + ", " + anUnit;
+ }
+
+ aComponentList << aComponent;
+ aComponentId++;
+ }
+
+ myComponentCB->clear();
+ myComponentCB->addItems( aComponentList );
+
+ bool isScalarMode = ( aNbComp > 1 );
+ myComponentCB->setCurrentIndex( isScalarMode ? 0 : 1 );
+ myComponentCB->setEnabled( isScalarMode );
+}
+
+//------------------------------------------------------------------------
+void VisuGUI_EvolutionDlg::accept()
+{
+ _PTR(Study) aStudy = VISU::GetCStudy( VISU::GetAppStudy( myModule ) );
+ if( VISU::IsStudyLocked( aStudy ) )
+ {
+ SUIT_MessageBox::warning( VISU::GetDesktop( myModule ),
+ tr( "WRN_VISU_WARNING" ),
+ tr( "WRN_STUDY_LOCKED" ) );
+ return;
+ }
+
+ bool ok = false;
+ int aPointId = myPointLE->text().toInt( &ok );
+ if( !ok )
+ {
+ SUIT_MessageBox::warning( VISU::GetDesktop( myModule ),
+ tr( "WRN_VISU_WARNING" ),
+ tr( "ERR_INVALID_SELECTION" ) );
+ return;
+ }
+ myEngine->setPointId( aPointId );
+
+ int aComponentId = myComponentCB->currentIndex();
+ myEngine->setComponentId( aComponentId );
+
+ // create or get a Plot2d view
+ SPlot2d_Viewer* aView = VISU::GetPlot2dViewer( myModule, true );
+ if( aView )
+ {
+ Plot2d_ViewFrame* aPlot = aView->getActiveViewFrame();
+ myEngine->setViewer( aPlot );
+ }
+
+ if( !myEngine->showEvolution() )
+ {
+ SUIT_MessageBox::warning( VISU::GetDesktop( myModule ),
+ tr( "WRN_VISU_WARNING" ),
+ tr( "ERR_EXTRACTION_OF_DATA_FAILED" ) );
+ return;
+ }
+
+ std::string anEvolutionEntry = myEngine->getEvolutionEntry();
+ if( anEvolutionEntry != "" )
+ {
+ _PTR(SObject) anEvolutionObject = aStudy->FindObjectID( anEvolutionEntry.c_str() );
+ VISU::UpdateObjBrowser( myModule, true, anEvolutionObject );
+ }
+
+ QtxDialog::accept();
+}
+
+//------------------------------------------------------------------------
+void VisuGUI_EvolutionDlg::setVisible( bool theIsVisible )
+{
+ QtxDialog::setVisible( theIsVisible );
+
+ if( !myViewWindow )
+ return;
+
+ VISU::Result_i* aResult = myEngine->getResult();
+ if( !aResult )
+ return;
+
+ if( theIsVisible && !myPreviewActor )
+ {
+ // get an id of the pre-selected point
+ // it should be done before changing of selection mode because
+ // that operation forces onSelectionEvent() and clears myPointLE
+ bool hasPreSelection = false;
+ int aPointId = myPointLE->text().toInt( &hasPreSelection );
+
+ // store current selection mode and switch to point selection
+ myStoredSelectionMode = myViewWindow->SelectionMode();
+ myViewWindow->SetSelectionMode( NodeSelection );
+
+ // create preview actor and display it in the view
+ VISU::PNamedIDMapper aMapper = aResult->GetInput()->GetMeshOnEntity( myEngine->getMeshName(), myEngine->getEntity() );
+
+ vtkDataSetMapper* aPreviewMapper = vtkDataSetMapper::New();
+ aPreviewMapper->SetInput( aMapper->GetOutput() );
+
+ vtkProperty* aProperty = vtkProperty::New();
+ aProperty->SetColor( 1, 1, 1 );
+ aProperty->SetPointSize( SALOME_POINT_SIZE );
+ aProperty->SetRepresentationToPoints();
+
+ myPreviewActor = SALOME_Actor::New();
+ myPreviewActor->PickableOn();
+ myPreviewActor->SetMapper( aPreviewMapper );
+ myPreviewActor->SetProperty( aProperty );
+
+ aProperty->Delete();
+ aPreviewMapper->Delete();
+
+ Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject( myEngine->getFieldEntry().c_str(), "", "" );
+ myPreviewActor->setIO( anIO );
+
+ myViewWindow->AddActor(myPreviewActor);
+
+ if( hasPreSelection )
+ {
+ myPointLE->setText( QString::number( aPointId ) );
+
+ SVTK_Selector* aSelector = myViewWindow->GetSelector();
+ aSelector->ClearIObjects();
+ aSelector->AddOrRemoveIndex( anIO, aPointId, false );
+ aSelector->AddIObject( anIO );
+
+ myPreviewActor->Highlight( true );
+ }
+
+ myViewWindow->onFitAll();
+ }
+ else if( !theIsVisible && myPreviewActor )
+ {
+ SVTK_Selector* aSelector = myViewWindow->GetSelector();
+ aSelector->ClearIObjects();
+
+ // restore selection mode
+ myViewWindow->SetSelectionMode( myStoredSelectionMode );
+
+ // remove preview actor from the view and delete it
+ myViewWindow->RemoveActor( myPreviewActor );
+ myPreviewActor->Delete();
+ myPreviewActor = 0;
+ }
+}
+
+//------------------------------------------------------------------------
+void VisuGUI_EvolutionDlg::restoreFromStudy( _PTR(SObject) theEvolution )
+{
+ myEngine->restoreFromStudy( theEvolution );
+
+ updateFromEngine();
+
+ myPointLE->setText( QString::number( myEngine->getPointId() ) );
+ myComponentCB->setCurrentIndex( myEngine->getComponentId() );
+}
+
+//------------------------------------------------------------------------
+void VisuGUI_EvolutionDlg::onPointEdited( const QString& theText )
+{
+ if( !myViewWindow )
+ return;
+
+ if( !myPreviewActor || !myPreviewActor->hasIO() )
+ return;
+
+ bool ok = false;
+ int aPointId = theText.toInt( &ok );
+ if( !ok )
+ return;
+
+ Handle(SALOME_InteractiveObject) anIO = myPreviewActor->getIO();
+
+ SVTK_Selector* aSelector = myViewWindow->GetSelector();
+ aSelector->ClearIObjects();
+ aSelector->AddOrRemoveIndex( anIO, aPointId, false );
+ aSelector->AddIObject( anIO );
+
+ myPreviewActor->Highlight( true );
+
+ myViewWindow->Repaint();
+}
+
+//------------------------------------------------------------------------
+void VisuGUI_EvolutionDlg::onSelectionEvent()
+{
+ myPointLE->clear();
+
+ if( !myViewWindow || myViewWindow->SelectionMode() != NodeSelection )
+ return;
+
+ if( !myPreviewActor || !myPreviewActor->hasIO() )
+ return;
+
+ SVTK_Selector* aSelector = myViewWindow->GetSelector();
+ LightApp_SelectionMgr* aSelectionMgr = VISU::GetSelectionMgr( myModule );
+ SALOME_ListIO aListIO;
+ aSelectionMgr->selectedObjects( aListIO );
+ SALOME_ListIteratorOfListIO anIter( aListIO );
+ while( anIter.More() )
+ {
+ Handle(SALOME_InteractiveObject) anIO = anIter.Value();
+ if( !anIO.IsNull() && strcmp( anIO->getEntry(), myPreviewActor->getIO()->getEntry() ) == 0 )
+ {
+ TColStd_IndexedMapOfInteger aMapIndex;
+ aSelector->GetIndex( anIO, aMapIndex );
+ if( aMapIndex.Extent() == 1 )
+ {
+ int anId = aMapIndex( 1 );
+ myPointLE->setText( QString::number( anId ) );
+ }
+ break;
+ }
+ anIter.Next();
+ }
+}
+
+//------------------------------------------------------------------------
+void VisuGUI_EvolutionDlg::onViewWindowClosed()
+{
+ if( myViewWindow )
+ {
+ if( myPreviewActor )
+ {
+ myPreviewActor->Delete();
+ myPreviewActor = 0;
+ }
+ myViewWindow = 0;
+ }
+}
+
+//------------------------------------------------------------------------
+void VisuGUI_EvolutionDlg::onHelp()
+{
+ QString aHelpFileName = "evolution_page.html";
+ LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
+ if( app )
+ app->onHelpContextModule( myModule ? app->moduleName( myModule->moduleName() ) : QString( "" ), aHelpFileName );
+ else
+ {
+ QString platform;
+#ifdef WIN32
+ platform = "winapplication";
+#else
+ platform = "application";
+#endif
+ SUIT_MessageBox::warning( VISU::GetDesktop( myModule ),
+ tr( "WRN_WARNING" ),
+ tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( aHelpFileName ),
+ tr( "BUT_OK" ) );
+ }
+}
+
+//------------------------------------------------------------------------
+void VisuGUI_EvolutionDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Qt::Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VisuGUI_EvolutionDlg.h
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#ifndef VISUGUI_EVOLUTIONDLG_H
+#define VISUGUI_EVOLUTIONDLG_H
+
+#include <QtxDialog.h>
+
+#include <SALOMEDSClient_Study.hxx>
+
+#include <SVTK_Selection.h>
+
+class QComboBox;
+class QIntValidator;
+class QKeyEvent;
+class QLineEdit;
+
+class SALOME_Actor;
+class SVTK_ViewWindow;
+
+class VisuGUI;
+class VISU_Evolution;
+
+class VisuGUI_EvolutionDlg: public QtxDialog
+{
+ Q_OBJECT
+
+public:
+ VisuGUI_EvolutionDlg( VisuGUI* theModule, _PTR(Study) theStudy );
+ ~VisuGUI_EvolutionDlg();
+
+public:
+ bool setField( _PTR(SObject) theField );
+
+ void restoreFromStudy( _PTR(SObject) theEvolution );
+
+protected:
+ virtual void setVisible( bool theIsVisible );
+ virtual void keyPressEvent( QKeyEvent* theEvent );
+
+protected slots:
+ virtual void accept();
+
+private:
+ void updateFromEngine();
+
+private slots:
+ void onPointEdited( const QString& );
+ void onSelectionEvent();
+ void onViewWindowClosed();
+ void onHelp();
+
+private:
+ VisuGUI* myModule;
+ VISU_Evolution* myEngine;
+
+ QLineEdit* myFieldLE;
+ QLineEdit* myPointLE;
+ QComboBox* myComponentCB;
+
+ QIntValidator* myPointValidator;
+
+ SVTK_ViewWindow* myViewWindow;
+ SALOME_Actor* myPreviewActor;
+ Selection_Mode myStoredSelectionMode;
+};
+
+#endif //VISUGUI_EVOLUTIONDLG_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Factory.cxx
// Author :
#include "CAM_Module.h"
+#include <VISU_version.h>
+
#ifdef WNT
-#ifdef VISU_VISUGUI_EXPORTS
+#if defined VISU_VISUGUI_EXPORTS || defined VISU_EXPORTS
#define VISU_VISUGUI_EXPORT __declspec(dllexport)
#else
#define VISU_VISUGUI_EXPORT __declspec(dllimport)
{
return new VisuGUI_Module();
}
+
+VISU_VISUGUI_EXPORT
+ char* getModuleVersion()
+ {
+ return (char*)VISU_VERSION_STR;
+ }
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_FeatureEdgesPanel.cxx
// Author : Oleg Uvarov
#include <QLayout>
#include <QPushButton>
-#include <QtxDoubleSpinBox.h>
-
#include <SUIT_MessageBox.h>
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Application.h>
+#include <SalomeApp_DoubleSpinBox.h>
#include <LightApp_SelectionMgr.h>
-VisuGUI_FeatureEdgesPanel::VisuGUI_FeatureEdgesPanel( const VisuGUI* theModule, QWidget* theParent ) :
+VisuGUI_FeatureEdgesPanel::VisuGUI_FeatureEdgesPanel( VisuGUI* theModule, QWidget* theParent ) :
VisuGUI_Panel( tr( "WINDOW_TITLE" ), theModule, theParent, ApplyBtn | CloseBtn | HelpBtn ),
myActor( 0 )
{
+ setWindowTitle( tr( "WINDOW_TITLE" ) );
+ setObjectName( tr( "WINDOW_TITLE" ) );
+
QVBoxLayout* aTopLayout = new QVBoxLayout( mainFrame() );
myGrp = new QGroupBox( tr( "FEATURE_EDGES_PROPERTIES" ), mainFrame() );
aLayout->setAlignment( Qt::AlignTop );
QLabel* anAngleLbl = new QLabel( tr( "FEATURE_EDGES_ANGLE" ), myGrp );
- myAngleSpinBox = new QtxDoubleSpinBox( 0.0, 90.0, 10.0, myGrp );
+ myAngleSpinBox = new SalomeApp_DoubleSpinBox( myGrp );
+ VISU::initSpinBox( myAngleSpinBox, 0.0, 90.0, 10.0, "angle_precision" );
myFeatureEdgesCB = new QCheckBox( tr( "SHOW_FEATURE_EDGES" ), myGrp );
myBoundaryEdgesCB = new QCheckBox( tr( "SHOW_BOUNDARY_EDGES" ), myGrp );
aTopLayout->addWidget( myGrp );
- SalomeApp_Application* anApp =
- dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
- LightApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr();
- connect( aSelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionEvent() ) );
+ connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+ this, SLOT( onSelectionEvent() ) );
}
VisuGUI_FeatureEdgesPanel::~VisuGUI_FeatureEdgesPanel()
anIsManifoldEdges = false,
anIsNonManifoldEdges = false;
myActor->GetFeatureEdgesFlags( anIsFeatureEdges,
- anIsBoundaryEdges,
- anIsManifoldEdges,
- anIsNonManifoldEdges );
+ anIsBoundaryEdges,
+ anIsManifoldEdges,
+ anIsNonManifoldEdges );
- float aColoring = myActor->GetFeatureEdgesColoring();
+ //float aColoring = myActor->GetFeatureEdgesColoring();
myAngleSpinBox->setValue( anAngle );
myFeatureEdgesCB->setChecked( anIsFeatureEdges );
{
myActor->SetFeatureEdgesAngle( myAngleSpinBox->value() );
myActor->SetFeatureEdgesFlags( myFeatureEdgesCB->isChecked(),
- myBoundaryEdgesCB->isChecked(),
- myManifoldEdgesCB->isChecked(),
- myNonManifoldEdgesCB->isChecked() );
+ myBoundaryEdgesCB->isChecked(),
+ myManifoldEdgesCB->isChecked(),
+ myNonManifoldEdgesCB->isChecked() );
//myActor->SetFeatureEdgesColoring( myColoringCB->isChecked() );
myActor->Update();
}
void VisuGUI_FeatureEdgesPanel::onClose()
{
- close();
+ // hide();
VisuGUI_Panel::onClose();
}
onHelp();
}
}
+
+void VisuGUI_FeatureEdgesPanel::onModuleActivated()
+{
+ disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+ this, SLOT( onSelectionEvent() ) );
+ connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+ this, SLOT( onSelectionEvent() ) );
+ VisuGUI_Panel::onModuleActivated();
+}
+
+void VisuGUI_FeatureEdgesPanel::onModuleDeactivated()
+{
+ disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+ this, SLOT( onSelectionEvent() ) );
+ VisuGUI_Panel::onModuleDeactivated();
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_FeatureEdgesPanel.h
// Author : Oleg Uvarov
#ifndef VISUGUI_FEATUREEDGESPANEL_H
#define VISUGUI_FEATUREEDGESPANEL_H
-#include <VisuGUI_Panel.h>
+#include "VisuGUI_Panel.h"
class QCheckBox;
class QGroupBox;
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class VISU_Actor;
Q_OBJECT
public:
- VisuGUI_FeatureEdgesPanel( const VisuGUI* theModule, QWidget* theParent = 0 );
+ VisuGUI_FeatureEdgesPanel( VisuGUI* theModule, QWidget* theParent = 0 );
virtual ~VisuGUI_FeatureEdgesPanel ();
protected:
virtual void keyPressEvent( QKeyEvent* theEvent );
virtual void showEvent( QShowEvent* theEvent );
+protected slots:
+ virtual void onModuleActivated();
+ virtual void onModuleDeactivated();
+
private slots:
virtual void onApply();
virtual void onClose();
private:
QGroupBox* myGrp;
- QtxDoubleSpinBox* myAngleSpinBox;
+ SalomeApp_DoubleSpinBox* myAngleSpinBox;
QCheckBox* myFeatureEdgesCB;
QCheckBox* myBoundaryEdgesCB;
QCheckBox* myManifoldEdgesCB;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_FieldFilter.cxx
// Author : Oleg UVAROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_FieldFilter.hxx
// Author : Oleg UVAROV
// Module : VISU
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_FileDlg.cxx
// Author :
// Module : SALOME
Constructor
*/
VisuGUI_FileDlg::VisuGUI_FileDlg (QWidget* parent,
- bool open,
- bool showQuickDir,
- bool modal) :
+ bool open,
+ bool showQuickDir,
+ bool modal) :
SUIT_FileDlg(parent, open, showQuickDir, modal)
{
myCBuildAll = new QCheckBox (tr("FULL_LOAD"), this);
if ( fi.isFile() )
{
setDirectory( fi.absoluteDir().absolutePath() );
- selectFile( fi.fileName() );
+ selectFile( fi.fileName() );
}
else if ( fi.isDir() )
- setDirectory( path );
+ setDirectory( path );
return true;
}
else {
if ( QFileInfo( fi.absoluteDir().absolutePath() ).exists() ) {
- setDirectory( fi.absoluteDir().absolutePath() );
- return true;
+ setDirectory( fi.absoluteDir().absolutePath() );
+ return true;
}
}
}
Returns the file name for Open/Save [ static ]
*/
QString VisuGUI_FileDlg::getFileName( QWidget* parent,
- const QString& initial,
- const QStringList& filters,
- const QString& caption,
- bool open,
+ const QString& initial,
+ const QStringList& filters,
+ const QString& caption,
+ bool open,
bool showQuickDir,
SUIT_FileValidator* validator )
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_FileDlg.h
// Author :
// Module : SALOME
Q_OBJECT;
public:
VisuGUI_FileDlg( QWidget* parent,
- bool open,
- bool showQuickDir = true,
- bool modal = true );
+ bool open,
+ bool showQuickDir = true,
+ bool modal = true );
~VisuGUI_FileDlg();
public:
static bool IsBuild;
static QString getFileName( QWidget* parent,
- const QString& initial,
- const QStringList& filters,
- const QString& caption,
- bool open,
- bool showQuickDir = true,
- SUIT_FileValidator* validator = 0);
+ const QString& initial,
+ const QStringList& filters,
+ const QString& caption,
+ bool open,
+ bool showQuickDir = true,
+ SUIT_FileValidator* validator = 0);
private:
QCheckBox* myCBuildAll;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_FileInfoDlg.cxx
// Author : Alexandre SOLOVYOV, Open CASCADE S.A.S. ( alexander.solovyov@opencascade.com)
// Module : VISU
//
-#include <VisuGUI_FileInfoDlg.h>
+#include "VisuGUI_FileInfoDlg.h"
#include <MED_Common.hxx>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_FileInfoDlg.h
// Author : Alexandre SOLOVYOV, Open CASCADE S.A.S. ( alexander.solovyov@opencascade.com)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VisuGUI_FilterScalarsDlg.h"
#include "VISU_ColoredPrs3d_i.hh"
#include "VISU_ColoredPrs3dHolder_i.hh"
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
if ( VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase ) {
if ( VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast< VISU::ColoredPrs3d_i* >( aBase ) ) {
- myColoredPrs3d = aColoredPrs3d;
+ myColoredPrs3d = aColoredPrs3d;
} else if (VISU::ColoredPrs3dHolder_i* aHolder =
- dynamic_cast< VISU::ColoredPrs3dHolder_i* >( aBase )) {
- myColoredPrs3d = aHolder->GetPrs3dDevice();
+ dynamic_cast< VISU::ColoredPrs3dHolder_i* >( aBase )) {
+ myColoredPrs3d = aHolder->GetPrs3dDevice();
}
if (myColoredPrs3d.get() != NULL) {
- myRangeBox->setChecked( myColoredPrs3d->IsScalarFilterUsed() );
- myMinEdit->setText( QString::number( myColoredPrs3d->GetScalarFilterMin() ) );
- myMaxEdit->setText( QString::number( myColoredPrs3d->GetScalarFilterMax() ) );
- setEnabled( true );
- return;
+ myRangeBox->setChecked( myColoredPrs3d->IsScalarFilterUsed() );
+ myMinEdit->setText( QString::number( myColoredPrs3d->GetScalarFilterMin() ) );
+ myMaxEdit->setText( QString::number( myColoredPrs3d->GetScalarFilterMax() ) );
+ setEnabled( true );
+ return;
}
}
}
{
myColoredPrs3d->SetScalarFilterRange( myMinEdit->text().toDouble(), myMaxEdit->text().toDouble() );
myColoredPrs3d->UseScalarFiltering( myRangeBox->isChecked() );
- myColoredPrs3d->UpdateActors();
+
+ bool isToUpdate = true;
+ if( myColoredPrs3d->IsForcedHidden() )
+ if( SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>( myVisuGUI ) )
+ if( isToUpdate = VISU::PublishInView( myVisuGUI, myColoredPrs3d, aViewWindow, true ) )
+ myColoredPrs3d->SetForcedHidden( false );
+
+ if( isToUpdate )
+ myColoredPrs3d->UpdateActors();
+
QDialog::accept();
}
void VisuGUI_FilterScalarsDlg::onHelp()
{
- QString aHelpFileName = "filterbyscalars_page.html";
+ QString aHelpFileName = "viewing_3d_presentations_page.html#filter_by_scalars_anchor";
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
if (app)
app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_FilterScalarsDlg.h
// Author : vsv
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_FindPane.cxx
// Author : Oleg Uvarov
myConditionBox = new QComboBox( this );
myConditionBox->addItems( QStringList()
- << tr( "MINIMUM" )
- << tr( "MAXIMUM" )
- << "="
- << "<="
- << ">="
- << tr( "BETWEEN" ) );
+ << tr( "MINIMUM" )
+ << tr( "MAXIMUM" )
+ << "="
+ << "<="
+ << ">="
+ << tr( "BETWEEN" ) );
connect( myConditionBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onConditionChanged( int ) ) );
{
if( VISU_GaussPtsAct* aGaussPtsAct = dynamic_cast<VISU_GaussPtsAct*>( myActor ) )
{
- VISU::TGaussPointID aGaussPointID = aGaussPtsAct->GetGaussPointsPL()->GetObjID( aVTKId );
- anId.first = aGaussPointID.first;
- anId.second = aGaussPointID.second;
+ VISU::TGaussPointID aGaussPointID = aGaussPtsAct->GetGaussPointsPL()->GetObjID( aVTKId );
+ anId.first = aGaussPointID.first;
+ anId.second = aGaussPointID.second;
}
}
//printf( "(%d) <%d - %d> %f\n", aVTKId, anId.first, anId.second, aValue );
if( anId.first < 0 ||
- anId.second < 0 && mySelectionMode == GaussPointSelection )
+ anId.second < 0 && mySelectionMode == GaussPointSelection )
continue;
bool ok = false;
{
if( aCondition <= 1 && fabs( aValue - anExtremum ) > eps )
{
- anExtremum = aValue;
- myIdsList.clear();
+ anExtremum = aValue;
+ myIdsList.clear();
}
if( !myIdsList.contains( anId ) )
myIdsList.append( anId );
aStr.remove( ']' );
aFirstId = aStr.section( ' ', 0, 0 ).toInt( &ok );
if( !ok )
- aFirstId = -1;
+ aFirstId = -1;
else
{
- ok = false;
- aSecondId = aStr.section( ' ', 1, 1 ).toInt( &ok );
- if( !ok )
- aSecondId = -1;
+ ok = false;
+ aSecondId = aStr.section( ' ', 1, 1 ).toInt( &ok );
+ if( !ok )
+ aSecondId = -1;
}
}
}
myPrevBtn->setEnabled( myCurrentPage != 0 );
myNextBtn->setEnabled( ( myCurrentPage + 1 ) * PAGE_SIZE < aSize );
myPageLabel->setText( QString( "Page %1/%2" )
- .arg( aSize > 0 ? myCurrentPage + 1 : 0 )
- .arg( aSize > 0 ? ( aSize - 1 ) / PAGE_SIZE + 1 : 0 ) );
+ .arg( aSize > 0 ? myCurrentPage + 1 : 0 )
+ .arg( aSize > 0 ? ( aSize - 1 ) / PAGE_SIZE + 1 : 0 ) );
int aFirstIndex = myCurrentPage * PAGE_SIZE;
int aLastIndex = aFirstIndex + PAGE_SIZE - 1;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_FindPane.h
// Author : Oleg Uvarov
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_GaussPointsDlg.cxx
// Author : Oleg UVAROV
#include "VisuGUI_Tools.h"
#include "VisuGUI_InputPane.h"
+#include "VisuGUI_PrimitiveBox.h"
+#include "VisuGUI_SizeBox.h"
#include "VISU_ColoredPrs3dFactory.hh"
#include "VISU_GaussPoints_i.hh"
#include "VISU_OpenGLPointSpriteMapper.hxx"
#include "VISU_Convertor.hxx"
-#include "VVTK_PrimitiveBox.h"
-#include "VVTK_SizeBox.h"
-
#include "LightApp_Application.h"
#include "SalomeApp_Module.h"
+#include "SalomeApp_IntSpinBox.h"
+#include <SalomeApp_DoubleSpinBox.h>
#include "LightApp_SelectionMgr.h"
#include "SUIT_Desktop.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_MessageBox.h"
#include "SVTK_FontWidget.h"
-#include "QtxDoubleSpinBox.h"
-
#include <QLayout>
#include <QTabWidget>
#include <QButtonGroup>
#include <QLabel>
#include <QPushButton>
#include <QLineEdit>
-#include <QSpinBox>
#include <QComboBox>
#include <QToolButton>
#include <QTabWidget>
QButtonGroup* BarTypeGroup = new QButtonGroup( ActiveBarGroup );
QGroupBox* aGB = new QGroupBox( ActiveBarGroup );
QVBoxLayout* aVBLay = new QVBoxLayout( aGB );
-
+
BarTypeGroup->setExclusive( true );
//aGB->setFrameStyle( QFrame::NoFrame );
aVBLay->setMargin( 0 );
RangeGroupLayout->setSpacing( 6 );
RangeGroupLayout->setMargin( 11 );
- myModeLbl = new QLabel("Scalar Mode", aGB);
+ myModeLbl = new QLabel(tr("SCALAR_MODE"), aGB);
myModeCombo = new QComboBox(aGB);
RangeGroup->addButton( RBFieldRange );
RangeGroup->addButton( RBImposedRange );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = qAbs(aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ));
+
+ QDoubleValidator* dv = new QDoubleValidator(this);
+ dv->setDecimals(aPrecision);
+
MinEdit = new QLineEdit( aGB );
MinEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
MinEdit->setMinimumWidth( 70 );
- MinEdit->setValidator( new QDoubleValidator(this) );
+ MinEdit->setValidator( dv );
MinEdit->setText( "0.0" );
QLabel* MinLabel = new QLabel (tr("LBL_MIN"), aGB);
MinLabel->setBuddy(MinEdit);
MaxEdit = new QLineEdit( aGB );
MaxEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
MaxEdit->setMinimumWidth( 70 );
- MaxEdit->setValidator( new QDoubleValidator(this) );
+ MaxEdit->setValidator( dv );
MaxEdit->setText( "0.0" );
QLabel* MaxLabel = new QLabel (tr("LBL_MAX"), aGB);
MaxLabel->setBuddy(MaxEdit);
TypeGroup->addButton( RainbowButton );
ColorLabel = new QLabel (tr("LBL_NB_COLORS"), ColLabGroup );
- ColorSpin = new QSpinBox( ColLabGroup );
+ ColorSpin = new SalomeApp_IntSpinBox( ColLabGroup );
+ ColorSpin->setAcceptNames( false );
ColorSpin->setMinimum( 2 );
ColorSpin->setMaximum( 256 );
ColorSpin->setSingleStep( 1 );
ColorSpin->setValue( 64 );
LabelLabel = new QLabel (tr("LBL_NB_LABELS"), ColLabGroup);
- LabelSpin = new QSpinBox( ColLabGroup );
+ LabelSpin = new SalomeApp_IntSpinBox( ColLabGroup );
+ LabelSpin->setAcceptNames( false );
LabelSpin->setMinimum( 2 );
LabelSpin->setMaximum( 65 );
LabelSpin->setSingleStep( 1 );
OriginGroupLayout->setMargin( 11 );
QLabel* XLabel = new QLabel (tr("LBL_X"), OriginGroup );
- XSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, OriginGroup );
+ XSpin = new SalomeApp_DoubleSpinBox( OriginGroup );
+ VISU::initSpinBox( XSpin, 0.0, 1.0, 0.1, "parametric_precision" );
XSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
XSpin->setMinimumWidth( 70 );
XSpin->setValue( 0.01 );
QLabel* YLabel = new QLabel (tr("LBL_Y"), OriginGroup );
- YSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, OriginGroup );
+ YSpin = new SalomeApp_DoubleSpinBox( OriginGroup );
+ VISU::initSpinBox( YSpin, 0.0, 1.0, 0.1, "parametric_precision" );
YSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
YSpin->setMinimumWidth( 70 );
YSpin->setValue( 0.01 );
DimGroupLayout->setMargin( 11 );
QLabel* WidthLabel = new QLabel (tr("LBL_WIDTH"), DimGroup );
- WidthSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, DimGroup );
+ WidthSpin = new SalomeApp_DoubleSpinBox( DimGroup );
+ VISU::initSpinBox( WidthSpin, 0.0, 1.0, 0.1, "parametric_precision" );
WidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
WidthSpin->setMinimumWidth( 70 );
WidthSpin->setValue( 0.1 );
QLabel* HeightLabel = new QLabel (tr("LBL_HEIGHT"), DimGroup );
- HeightSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, DimGroup );
+ HeightSpin = new SalomeApp_DoubleSpinBox( DimGroup );
+ VISU::initSpinBox( HeightSpin, 0.0, 1.0, 0.1, "parametric_precision" );
HeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
HeightSpin->setMinimumWidth( 70 );
HeightSpin->setValue( 0.8 );
QLabel* SpacingLabel = new QLabel (tr("LBL_SPACING"), DimGroup );
- SpacingSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.01, DimGroup );
+ SpacingSpin = new SalomeApp_DoubleSpinBox( DimGroup );
+ VISU::initSpinBox( SpacingSpin, 0.0, 1.0, 0.01, "parametric_precision" );
SpacingSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
SpacingSpin->setMinimumWidth( 70 );
SpacingSpin->setValue( 0.01 );
aMainLayout->addWidget( aSaveBox );
QHBoxLayout* aHBoxLay = new QHBoxLayout( aSaveBox );
-
- myTextBtn = new QPushButton("Text properties...", aSaveBox);
+
+ myTextBtn = new QPushButton(tr("Text properties..."), aSaveBox);
aHBoxLay->addWidget( myTextBtn );
-
- myBarBtn = new QPushButton("Bar properties...", aSaveBox);
+
+ myBarBtn = new QPushButton(tr("Bar properties..."), aSaveBox);
aHBoxLay->addWidget( myBarBtn );
myTextDlg = new VisuGUI_TextPrefDlg(this);
myBarDlg = new VisuGUI_BarPrefDlg(this);
aMainLayout->addWidget( myBarDlg );
+ QGroupBox* CheckGroup = new QGroupBox("", this );
+ aMainLayout->addWidget( CheckGroup );
+ QGridLayout* CheckGroupLayout = new QGridLayout( CheckGroup );
+
+ myHideBar = new QCheckBox(tr("HIDE_SCALAR_BAR"), CheckGroup);
+ myHideBar->setChecked(false);
+ CheckGroupLayout->addWidget(myHideBar, 0, 0);
+
// signals and slots connections ===========================================
connect( RBFieldRange, SIGNAL( clicked() ), this, SLOT( fieldRangeClicked() ) );
connect( RBImposedRange,SIGNAL( clicked() ), this, SLOT( imposedRangeClicked() ) );
MinEdit->setEnabled( false );
MaxEdit->setEnabled( false );
- MinEdit->setText( QString::number( myPrsCopy->GetMin() ) );
- MaxEdit->setText( QString::number( myPrsCopy->GetMax() ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = qAbs(aResourceMgr->integerValue("VISU", "visual_data_precision", 0));
+
+ MinEdit->setText(QString::number(myPrsCopy->GetMin(), 'g', aPrecision));
+ MaxEdit->setText(QString::number(myPrsCopy->GetMax(), 'g', aPrecision));
}
MinEdit->setEnabled( RBImposedRange->isChecked() );
MaxEdit->setEnabled( RBImposedRange->isChecked() );
- MinEdit->setText( QString::number( myPrsCopy->GetMin() ) );
- MaxEdit->setText( QString::number( myPrsCopy->GetMax() ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = qAbs(aResourceMgr->integerValue("VISU", "visual_data_precision", 0));
+
+ MinEdit->setText(QString::number(myPrsCopy->GetMin(), 'g', aPrecision));
+ MaxEdit->setText(QString::number(myPrsCopy->GetMax(), 'g', aPrecision));
}
MinEdit->setEnabled( false );
MaxEdit->setEnabled( false );
- MinEdit->setText( QString::number( myPrsCopy->GetMin() ) );
- MaxEdit->setText( QString::number( myPrsCopy->GetMax() ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = qAbs(aResourceMgr->integerValue("VISU", "visual_data_precision", 0));
+
+ MinEdit->setText(QString::number(myPrsCopy->GetMin(), 'g', aPrecision));
+ MaxEdit->setText(QString::number(myPrsCopy->GetMax(), 'g', aPrecision));
}
{
myPrsCopy->SetScalarMode( theMode );
if ( UseFieldRange() ) {
- MinEdit->setText( QString::number( myPrsCopy->GetSourceMin() ) );
- MaxEdit->setText( QString::number( myPrsCopy->GetSourceMax() ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = qAbs(aResourceMgr->integerValue("VISU", "visual_data_precision", 0));
+
+ MinEdit->setText(QString::number(myPrsCopy->GetSourceMin(), 'g', aPrecision));
+ MaxEdit->setText(QString::number(myPrsCopy->GetSourceMax(), 'g', aPrecision));
}
}
* Initialise dialog box from presentation object
*/
void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs,
- bool theInit )
+ bool theInit )
{
myPrsCopy = thePrs;
MaxEdit->setEnabled( false );
}
- MinEdit->setText( QString::number( thePrs->GetMin() ) );
- MaxEdit->setText( QString::number( thePrs->GetMax() ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = qAbs(aResourceMgr->integerValue("VISU", "visual_data_precision", 0));
+
+ MinEdit->setText(QString::number(thePrs->GetMin(), 'g', aPrecision));
+ MaxEdit->setText(QString::number(thePrs->GetMax(), 'g', aPrecision));
setPosAndSize( thePrs->GetPosX(),
- thePrs->GetPosY(),
- thePrs->GetWidth(),
- thePrs->GetHeight(),
- thePrs->GetBarOrientation());
+ thePrs->GetPosY(),
+ thePrs->GetWidth(),
+ thePrs->GetHeight(),
+ thePrs->GetBarOrientation());
- if(RBvert->isChecked()) {
+ if (RBvert->isChecked()) {
myVerTS = thePrs->GetTitleSize();
myVerLS = thePrs->GetLabelSize();
myVerBW = thePrs->GetBarWidth();
QString anUnit = QString(aUnitNames[i].c_str()).simplified();
if(anUnit.isNull() || anUnit == "")
anUnit = "-";
-
+
aComponent = aComponent + ", " + anUnit;
myModeCombo->addItem(aComponent);
thePrs->IsBoldLabel(),
thePrs->IsItalicLabel(),
thePrs->IsShadowLabel());
+
+ myHideBar->setChecked(!thePrs->IsBarVisible());
}
/**
thePrs->SetLabelsFormat( f.c_str() );
thePrs->SetUnitsVisible(myBarDlg->isUnitsVisible());
+ thePrs->SetBarVisible(!myHideBar->isChecked());
+
if (myIsStoreTextProp) {
// "Title"
thePrs->SetTitle(myTextDlg->getTitleText().toLatin1().data());
thePrs->SetShadowTitle(isTitleShadow);
thePrs->SetTitFontType(aTitleFontFamily);
thePrs->SetTitleColor(aTitColor.red()/255.,
- aTitColor.green()/255.,
- aTitColor.blue()/255.);
+ aTitColor.green()/255.,
+ aTitColor.blue()/255.);
// "Label"
QColor aLblColor (255, 255, 255);
thePrs->SetShadowLabel(isLabelShadow);
thePrs->SetLblFontType(aLabelFontFamily);
thePrs->SetLabelColor(aLblColor.red()/255.,
- aLblColor.green()/255.,
- aLblColor.blue()/255.);
+ aLblColor.green()/255.,
+ aLblColor.blue()/255.);
}
return 1;
*/
void VisuGUI_GaussScalarBarPane::XYChanged( double )
{
- QtxDoubleSpinBox* snd = (QtxDoubleSpinBox*)sender();
+ SalomeApp_DoubleSpinBox* snd = (SalomeApp_DoubleSpinBox*)sender();
if ( snd == XSpin ) {
WidthSpin->setMaximum( 1.0 - XSpin->value() );
}
PrsGroup->addButton( myResultsButton );
PrsGroup->addButton( myGeometryButton );
PrsGroup->addButton( myDefShapeButton );
-
+
myTabBox = new QTabWidget (this);
aVBLay->setSpacing(6);
// Primitive
- myPrimitiveBox = new VVTK_PrimitiveBox( aBox );
+ myPrimitiveBox = new VisuGUI_PrimitiveBox( aBox );
aVBLay->addWidget( myPrimitiveBox );
// Size
- mySizeBox = new VVTK_SizeBox( aBox );
+ mySizeBox = new VisuGUI_SizeBox( aBox );
aVBLay->addWidget( mySizeBox );
// Deformed Shape
aDefShapeLayout->setAlignment(Qt::AlignTop);
aDefShapeLayout->setSpacing(6);
aDefShapeLayout->setMargin(11);
-
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
QLabel* aScaleLabel = new QLabel( tr( "SCALE_FACTOR" ), myDefShapeBox );
- myScaleSpinBox = new QtxDoubleSpinBox( 0.0, 10.0, 0.1, aPrecision*(-1), 32, myDefShapeBox );
-
+ myScaleSpinBox = new SalomeApp_DoubleSpinBox( myDefShapeBox );
+ VISU::initSpinBox( myScaleSpinBox, 0.0, 10.0, 0.1, "visual_data_precision" );
+
aDefShapeLayout->addWidget( aScaleLabel, 0, 0 );
aDefShapeLayout->addWidget( myScaleSpinBox, 0, 1 );
{}
void VisuGUI_GaussPointsDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TGAUSSPOINTS>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
myPrimitiveBox->setResolution( myPrsCopy->GetResolution() );
myPrimitiveBox->setFaceLimit( myPrsCopy->GetFaceLimit() );
- mySizeBox->setType( isResults || isDeformed ? VVTK_SizeBox::Results : VVTK_SizeBox::Geometry );
+ mySizeBox->setType( isResults || isDeformed ? VisuGUI_SizeBox::Results : VisuGUI_SizeBox::Geometry );
mySizeBox->setGeomSize( myPrsCopy->GetGeomSize() );
mySizeBox->setMinSize( myPrsCopy->GetMinSize() );
mySizeBox->setMaxSize( myPrsCopy->GetMaxSize() );
myPrsCopy->SetMagnification( mySizeBox->getMagnification() );
myPrsCopy->SetMagnificationIncrement( mySizeBox->getIncrement() );
- VISU::TSameAsFactory<VISU::TGAUSSPOINTS>().Copy(myPrsCopy, thePrs);
-
+ VISU::TSameAsFactory<VISU::TGAUSSPOINTS>().Copy(myPrsCopy, thePrs);
+
//Set created Gauss points presentation selected,
//Issue 0019874(EDF 746 VISU: Picking alphanumeric Gauss)
if(thePrs){
SALOME_ListIO aListIO;
- LightApp_SelectionMgr* aSelectionMgr = VISU::GetSelectionMgr(myModule);
+ //LightApp_SelectionMgr* aSelectionMgr = VISU::GetSelectionMgr(myModule);
Handle(SALOME_InteractiveObject) anIO = thePrs->GetIO();
if(anIO && anIO->hasEntry()) {
aListIO.Append(anIO);
VISU::UpdateObjBrowser(myModule,true);
- //IPAL20836 aSelectionMgr->setSelectedObjects(aListIO);
+ //IPAL20836 aSelectionMgr->setSelectedObjects(aListIO);
}
else
myInputPane->SetRestoreInitialSelection(true);
if( on )//myDefShapeButton->isChecked() )
{
myDefShapeBox->show();
- mySizeBox->setType( VVTK_SizeBox::Results );
+ mySizeBox->setType( VisuGUI_SizeBox::Results );
}
else
myDefShapeBox->hide();
aWarning.append( "presentation might be too important to ensure an acceptable frame rate.\n\n" );
aWarning.append( "Can you please confirm that you want to continue anyway?" );
if( SUIT_MessageBox::warning( this, tr( "Warning" ), aWarning, tr( "&OK" ), tr( "&Cancel" ) ) == 1 )
- return;
+ return;
}
/*
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_GaussPointsDlg.h
// Author : Oleg UVAROV
#include "VisuGUI_Prs3dDlg.h"
#include "VISU_GaussPoints_i.hh"
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class SalomeApp_Module;
-class VVTK_PrimitiveBox;
-class VVTK_SizeBox;
+class SalomeApp_IntSpinBox;
+class VisuGUI_PrimitiveBox;
+class VisuGUI_SizeBox;
class VisuGUI_TextPrefDlg;
class VisuGUI_InputPane;
QRadioButton* RBhori;
QRadioButton* RBvert;
- QtxDoubleSpinBox* XSpin;
- QtxDoubleSpinBox* YSpin;
+ SalomeApp_DoubleSpinBox* XSpin;
+ SalomeApp_DoubleSpinBox* YSpin;
- QtxDoubleSpinBox* WidthSpin;
- QtxDoubleSpinBox* HeightSpin;
- QtxDoubleSpinBox* SpacingSpin;
+ SalomeApp_DoubleSpinBox* WidthSpin;
+ SalomeApp_DoubleSpinBox* HeightSpin;
+ SalomeApp_DoubleSpinBox* SpacingSpin;
QRadioButton* BicolorButton;
QRadioButton* RainbowButton;
QLabel* ColorLabel;
- QSpinBox* ColorSpin;
+ SalomeApp_IntSpinBox* ColorSpin;
QLabel* LabelLabel;
- QSpinBox* LabelSpin;
+ SalomeApp_IntSpinBox* LabelSpin;
QLabel* myModeLbl;
QComboBox* myModeCombo;
QRadioButton* myRBLocal;
QRadioButton* myRBGlobal;
QCheckBox* myCBDisplayed;
+ QCheckBox* myHideBar;
double Imin, Imax;
double myHorX, myHorY, myHorW, myHorH;
//! Initializing dialog from the Gauss Points presentation.
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
//! Update Gauss Points presentation using parameters from the dialog.
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
QRadioButton* myGeometryButton;
QRadioButton* myDefShapeButton;
- VVTK_PrimitiveBox* myPrimitiveBox;
- VVTK_SizeBox* mySizeBox;
+ VisuGUI_PrimitiveBox* myPrimitiveBox;
+ VisuGUI_SizeBox* mySizeBox;
QGroupBox* myDefShapeBox;
- QtxDoubleSpinBox* myScaleSpinBox;
+ SalomeApp_DoubleSpinBox* myScaleSpinBox;
SALOME::GenericObjPtr<VISU::GaussPoints_i> myPrsCopy;
SalomeApp_Module* myModule;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_GaussPointsSelectionPane.cxx
// Author : Oleg Uvarov
SVTK_RenderWindowInteractor* anInteractor = NULL;
if( SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>( myModule ) )
- //if( SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow() )
- anInteractor = aViewWindow->GetInteractor();
+ //if( SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow() )
+ anInteractor = aViewWindow->GetInteractor();
if ( !anInteractor )
- return aResult;
+ return aResult;
mySelector = anInteractor->GetSelector();
if ( !mySelector )
- return aResult;
+ return aResult;
const SALOME_ListIO& aListIO = mySelector->StoredIObjects();
if ( aListIO.Extent() != 1 )
- return aResult;
+ return aResult;
myIO = aListIO.First();
if ( mySelector->HasIndex( myIO ) )
- mySelector->GetIndex(myIO, myMapIndex);
-
- myActor = SVTK::Find<VISU_GaussPtsAct>(anInteractor->getRenderer()->GetActors(),
- SVTK::TIsSameIObject<VISU_GaussPtsAct>( myIO ));
+ mySelector->GetIndex(myIO, myMapIndex);
+
+ VTK::ActorCollectionCopy aCopy(anInteractor->getRenderer()->GetActors());
+ myActor = SVTK::Find<VISU_GaussPtsAct>(aCopy.GetActors(),
+ SVTK::TIsSameIObject<VISU_GaussPtsAct>( myIO ));
if ( !myActor )
- return aResult;
+ return aResult;
myPipeLine = myActor->GetGaussPointsPL();
{
public:
GaussPtsIDValidator( const SalomeApp_Module* theModule,
- QObject * theParent ):
+ QObject * theParent ):
QIntValidator( 0, VTK_LARGE_ID, theParent ),
myHelper(theModule)
{}
validate ( QString & theInput, int & thePos ) const
{
if ( QIntValidator::validate( theInput, thePos ) == QValidator::Invalid)
- return QValidator::Invalid;
+ return QValidator::Invalid;
if ( !myHelper.get() )
- return QValidator::Invalid;
+ return QValidator::Invalid;
return QValidator::Acceptable;
}
{
public:
GaussCellIDValidator( QLineEdit* theLocalPointLabel,
- const SalomeApp_Module* theModule,
- QObject * theParent ):
+ const SalomeApp_Module* theModule,
+ QObject * theParent ):
GaussPtsIDValidator( theModule, theParent ),
myLocalPointLineEdit( theLocalPointLabel )
{}
validate ( QString & theInput, int & thePos ) const
{
if( theInput.isEmpty() )
- return QValidator::Acceptable;
+ return QValidator::Acceptable;
if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid)
- return QValidator::Invalid;
+ return QValidator::Invalid;
VISU::TCellID aCellID = theInput.toInt();
VISU::TLocalPntID aLocalPntID = myLocalPointLineEdit->text().toInt();
VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper();
if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 )
- return QValidator::Intermediate;
+ return QValidator::Intermediate;
return QValidator::Acceptable;
}
{
public:
GaussLocalPointIDValidator( QLineEdit* theParentElementLineEdit,
- const SalomeApp_Module* theModule,
- QObject * theParent ):
+ const SalomeApp_Module* theModule,
+ QObject * theParent ):
GaussPtsIDValidator( theModule, theParent ),
myParentElementLineEdit( theParentElementLineEdit )
{}
validate ( QString & theInput, int & thePos ) const
{
if( theInput.isEmpty() )
- return QValidator::Acceptable;
+ return QValidator::Acceptable;
if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid)
- return QValidator::Invalid;
+ return QValidator::Invalid;
VISU::TLocalPntID aLocalPntID = theInput.toInt();
VISU::TCellID aCellID = myParentElementLineEdit->text().toInt();
VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper();
if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 )
- return QValidator::Intermediate;
+ return QValidator::Intermediate;
return QValidator::Acceptable;
}
//---------------------------------------------------------------------------------
VisuGUI_GaussPointsSelectionPane::VisuGUI_GaussPointsSelectionPane( const SalomeApp_Module* theModule,
- QWidget* theParent ) :
+ QWidget* theParent ) :
QWidget( theParent ),
myModule( theModule ),
myEventCallbackCommand( vtkCallbackCommand::New() )
//printf( "AddObserver(vtkCommand::KeyPressEvent)\n" );
aDevice->AddObserver(vtkCommand::KeyPressEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
if( aDevice->HasObserver(vtkCommand::EndPickEvent) )
aDevice->RemoveObservers(vtkCommand::EndPickEvent);
//printf( "AddObserver(vtkCommand::EndPickEvent)\n" );
aDevice->AddObserver(vtkCommand::EndPickEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
}
SVTK_RenderWindowInteractor* VisuGUI_GaussPointsSelectionPane::getInteractor()
}
void VisuGUI_GaussPointsSelectionPane::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
VisuGUI_GaussPointsSelectionPane* self = reinterpret_cast<VisuGUI_GaussPointsSelectionPane*>(theClientData);
platform = "application";
#endif
SUIT_MessageBox::warning( 0,
- QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
- QObject::tr("BUT_OK"));
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_GaussPointsSelectionPane.h
// Author : Oleg Uvarov
private:
static void ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
void KeyPressed();
void SelectionEvent();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_InputPane.cxx
// Author : Oleg UVAROV
//---------------------------------------------------------------
VisuGUI_InputPane::VisuGUI_InputPane( VISU::VISUType theType,
- SalomeApp_Module* theModule,
- VisuGUI_Prs3dDlg* theDialog ) :
+ SalomeApp_Module* theModule,
+ VisuGUI_Prs3dDlg* theDialog ) :
QGroupBox( theDialog ),
myModule( theModule ),
myDialog( theDialog ),
//---------------------------------------------------------------
VisuGUI_InputPane::~VisuGUI_InputPane()
{
- LightApp_SelectionMgr* aSelectionMgr = VISU::GetSelectionMgr(myModule);
+ if ( myModule->getApp() ) {
+ LightApp_SelectionMgr* aSelectionMgr = VISU::GetSelectionMgr(myModule);
+
+ if (myFieldFilter)
+ {
+ aSelectionMgr->removeFilter(myFieldFilter);
+ delete myFieldFilter;
+ }
- if (myFieldFilter)
- {
- aSelectionMgr->removeFilter(myFieldFilter);
- delete myFieldFilter;
+ // Restore initial selection
+ if(isRestoreInitialSelection)
+ aSelectionMgr->setSelectedObjects(mySavedSelection);
}
-
- // Restore initial selection
- if(isRestoreInitialSelection)
- aSelectionMgr->setSelectedObjects(mySavedSelection);
}
void VisuGUI_InputPane::SetRestoreInitialSelection(bool on){
{
QList<QListWidgetItem*> aList = mySelectedGroups->findItems( theItem->text(), Qt::MatchExactly );
if ( aList.isEmpty() )
- mySelectedGroups->insertItem( mySelectedGroups->count(), theItem->text() );
+ mySelectedGroups->insertItem( mySelectedGroups->count(), theItem->text() );
}
else if (aListWidget == mySelectedGroups)
delete theItem;
{
_PTR(SObject) aChildObj = aIter->Value();
if( !aChildObj )
- return;
+ return;
if( anEntityName.isNull() )
{
- _PTR(SObject) aRefObj;
- if( aChildObj->ReferencedObject( aRefObj ) )
- anEntityName = aRefObj->GetName().c_str();
+ _PTR(SObject) aRefObj;
+ if( aChildObj->ReferencedObject( aRefObj ) )
+ anEntityName = aRefObj->GetName().c_str();
}
VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildObj);
if( aRestoringMap["myComment"] == "TIMESTAMP" )
{
- aTimeStampName = aChildObj->GetName().c_str();
- myTimeStamps->addItem( aTimeStampName );
+ aTimeStampName = aChildObj->GetName().c_str();
+ myTimeStamps->addItem( aTimeStampName );
}
}
for(; anIter != aGroupNames.end(); anIter++){
const std::string aGroupName = *anIter;
mySelectedGroups->insertItem(mySelectedGroups->count(), aGroupName.c_str());
- }
+ }
+ myUseGroupsGroupBox->setEnabled(true);
}
myUseGroupsGroupBox->setChecked(mySelectedGroups->count() > 0);
- myUseGroupsGroupBox->setEnabled(anIsTimeStampFixed);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_InputPane.h
// Author : Oleg UVAROV
public:
VisuGUI_InputPane( VISU::VISUType theType,
- SalomeApp_Module* theModule,
- VisuGUI_Prs3dDlg* theDialog );
+ SalomeApp_Module* theModule,
+ VisuGUI_Prs3dDlg* theDialog );
virtual ~VisuGUI_InputPane();
public:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_InputPanel.cxx
// Author : Oleg Uvarov
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_InputPanel.cxx
// Author : Oleg Uvarov
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_IsoSurfacesDlg.cxx
// Author : Laurent CORNABE & Hubert ROLLAND
// Module : VISU
// $Header$
-
+//
#include "VisuGUI_IsoSurfacesDlg.h"
#include "VisuGUI.h"
#include <LightApp_Application.h>
+#include <SalomeApp_IntSpinBox.h>
+
#include <QtxColorButton.h>
#include <SUIT_Desktop.h>
#include <SUIT_Session.h>
#include <SUIT_MessageBox.h>
#include <SUIT_ResourceMgr.h>
-#include <limits.h>
+#include <limits>
#include <QLayout>
#include <QValidator>
#include <QLabel>
#include <QGroupBox>
-#include <QSpinBox>
#include <QPushButton>
#include <QCheckBox>
#include <QLineEdit>
#include <QTabWidget>
#include <QKeyEvent>
#include <QColorDialog>
-
-using namespace std;
+#include <QButtonGroup>
+#include <QRadioButton>
VisuGUI_IsoSurfPane::VisuGUI_IsoSurfPane (QWidget* parent,
- VisuGUI_ScalarBarPane* theScalarPane)
+ VisuGUI_ScalarBarPane* theScalarPane)
: QWidget(parent),
myScalarPane(theScalarPane)
{
TopGroupLayout->setSpacing( 6 );
TopGroupLayout->setMargin( 11 );
- QLabel* LabelNbr = new QLabel (tr("NB_SURFACES"), TopGroup);
- TopGroupLayout->addWidget( LabelNbr, 0, 0 );
- NbrIso = new QSpinBox( TopGroup );
- NbrIso->setMaximum( 100 );
- NbrIso->setMinimum( 1 );
- NbrIso->setSingleStep( 1 );
- NbrIso->setValue( 1 );
- TopGroupLayout->addWidget( NbrIso, 0, 1 );
+ QGroupBox* aRangeBox = new QGroupBox( tr( "RANGE" ), this );
+ QRadioButton* aUseScalarBarRange = new QRadioButton( tr( "USE_SCALAR_BAR_RANGE" ), aRangeBox );
+ QRadioButton* aUseCustomRange = new QRadioButton( tr( "USE_CUSTOM_RANGE" ), aRangeBox );
+
+ myRangeGrp = new QButtonGroup( aRangeBox );
+ myRangeGrp->addButton( aUseScalarBarRange, ScalarBarRange );
+ myRangeGrp->addButton( aUseCustomRange, CustomRange );
+ aUseScalarBarRange->setChecked( true );
- QLabel* LabelMin = new QLabel (tr("MIN_VALUE"), TopGroup );
- TopGroupLayout->addWidget(LabelMin, 1, 0);
- //MinIso = new QtxDoubleSpinBox( -DBL_MAX, DBL_MAX, 0.1, TopGroup );
- MinIso = new QLineEdit( TopGroup );
- MinIso->setValidator( new QDoubleValidator(TopGroup) );
+ connect( myRangeGrp, SIGNAL( buttonClicked( int ) ), this, SLOT( onRangeButtonClicked( int ) ) );
+
+ QLabel* LabelMin = new QLabel( tr( "MIN_VALUE" ), aRangeBox );
+ MinIso = new QLineEdit( aRangeBox );
+ MinIso->setValidator( new QDoubleValidator( aRangeBox ) );
MinIso->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
MinIso->setMinimumSize( 70, 0 );
- LabelMin->setBuddy(MinIso);
- TopGroupLayout->addWidget( MinIso, 1, 1 );
-
- QLabel* LabelMax = new QLabel (tr("MAX_VALUE"), TopGroup );
- TopGroupLayout->addWidget( LabelMax, 2, 0 );
- //MaxIso = new QtxSpinBoxDbl( -DBL_MAX, DBL_MAX, 0.1, TopGroup );
- MaxIso = new QLineEdit( TopGroup );
- MaxIso->setValidator( new QDoubleValidator(TopGroup) );
+ LabelMin->setBuddy( MinIso );
+
+ QLabel* LabelMax = new QLabel( tr( "MAX_VALUE" ), aRangeBox );
+ MaxIso = new QLineEdit( aRangeBox );
+ MaxIso->setValidator( new QDoubleValidator( aRangeBox ) );
MaxIso->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
MaxIso->setMinimumSize( 70, 0 );
- LabelMax->setBuddy(MaxIso);
- TopGroupLayout->addWidget( MaxIso, 2, 1 );
+ LabelMax->setBuddy( MaxIso );
+
+ QPushButton* aUpdateBtn = new QPushButton( tr("Update scalar bar range with these values"), aRangeBox );
+ aUpdateBtn->setEnabled( false );
+ connect( aUpdateBtn, SIGNAL( clicked() ), this, SLOT(onCBUpdate() ) );
+ connect( aUseCustomRange, SIGNAL( toggled( bool ) ), aUpdateBtn, SLOT( setEnabled( bool ) ) );
+
+ QGridLayout* aRangeLayout = new QGridLayout( aRangeBox );
+ aRangeLayout->setSpacing( 6 );
+ aRangeLayout->setMargin( 11 );
+ aRangeLayout->addWidget( aUseScalarBarRange, 0, 0 );
+ aRangeLayout->addWidget( aUseCustomRange, 0, 1 );
+ aRangeLayout->addWidget( LabelMin, 1, 0 );
+ aRangeLayout->addWidget( MinIso, 1, 1 );
+ aRangeLayout->addWidget( LabelMax, 2, 0 );
+ aRangeLayout->addWidget( MaxIso, 2, 1 );
+ aRangeLayout->addWidget( aUpdateBtn, 3, 0, 1, 2 );
+
+ TopGroupLayout->addWidget( aRangeBox, 0, 0, 1, 2 );
+
+ QLabel* LabelNbr = new QLabel (tr("NB_SURFACES"), TopGroup);
+ TopGroupLayout->addWidget( LabelNbr, 1, 0 );
+ NbrIso = new SalomeApp_IntSpinBox( TopGroup );
+ NbrIso->setAcceptNames( false );
+ NbrIso->setMaximum( 100 );
+ NbrIso->setMinimum( 1 );
+ NbrIso->setSingleStep( 1 );
+ NbrIso->setValue( 1 );
+ TopGroupLayout->addWidget( NbrIso, 1, 1 );
myUseMagnitude = new QCheckBox(tr("MAGNITUDE_COLORING_CHK"), TopGroup);
myUseMagnitude->setChecked(true);
- TopGroupLayout->addWidget( myUseMagnitude, 3, 0 );
+ TopGroupLayout->addWidget( myUseMagnitude, 2, 0 );
mySelColor = new QtxColorButton( TopGroup );
mySelColor->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- TopGroupLayout->addWidget( mySelColor, 3, 1 );
+ TopGroupLayout->addWidget( mySelColor, 2, 1 );
//connect( mySelColor, SIGNAL( clicked() ), this, SLOT( setColor() ) );
connect( myUseMagnitude, SIGNAL( toggled(bool) ), mySelColor, SLOT( setDisabled(bool) ) );
myUseLabels = new QCheckBox(tr("SHOW_VALUES_CHK"), TopGroup);
myUseLabels->setChecked(false);
- TopGroupLayout->addWidget( myUseLabels, 4, 0 );
- myNbLabels = new QSpinBox( TopGroup );
+ TopGroupLayout->addWidget( myUseLabels, 3, 0 );
+ myNbLabels = new SalomeApp_IntSpinBox( TopGroup );
+ myNbLabels->setAcceptNames( false );
myNbLabels->setMinimum(1);
myNbLabels->setMaximum(100);
myNbLabels->setSingleStep(1);
myNbLabels->setEnabled(false);
- TopGroupLayout->addWidget( myNbLabels, 4, 1 );
+ TopGroupLayout->addWidget( myNbLabels, 3, 1 );
connect( myUseLabels, SIGNAL( toggled(bool) ), myNbLabels, SLOT( setEnabled(bool) ) );
- QPushButton* aUpdateBtn = new QPushButton( "Update scalar bar range with these values", TopGroup);
- TopGroupLayout->addWidget( aUpdateBtn, 5, 0, 1, 2);
- connect( aUpdateBtn, SIGNAL( clicked() ), this, SLOT(onCBUpdate() ) );
mySelColor->setEnabled( !myUseMagnitude->isChecked() );
}
NbrIso->setValue(thePrs->GetNbSurfaces());
MinIso->setText(QString::number(thePrs->GetSubMin()));
MaxIso->setText(QString::number(thePrs->GetSubMax()));
+
+ int anId = thePrs->IsSubRangeFixed() ? ScalarBarRange : CustomRange;
+ bool anIsSubRangeFixed = thePrs->IsSubRangeFixed();
+ myRangeGrp->button( anId )->setChecked( true );
+ onRangeButtonClicked( anId );
+
myUseMagnitude->setChecked(thePrs->IsColored());
SALOMEDS::Color anOldColor = thePrs->GetColor();
QColor aColor = QColor(int(255*anOldColor.R),int(255*anOldColor.G),int(255*anOldColor.B));
int VisuGUI_IsoSurfPane::storeToPrsObject (VISU::IsoSurfaces_i* thePrs)
{
thePrs->SetNbSurfaces(NbrIso->value());
- thePrs->SetSubRange(MinIso->text().toDouble(), MaxIso->text().toDouble());
+
+ if( myRangeGrp->checkedId() == ScalarBarRange )
+ {
+ thePrs->SetSubRange( myScalarPane->getMin(), myScalarPane->getMax() );
+ thePrs->SetSubRangeFixed( true );
+ }
+ else // CustomRange
+ {
+ thePrs->SetSubRange( MinIso->text().toDouble(), MaxIso->text().toDouble() );
+ thePrs->SetSubRangeFixed( false );
+ }
+
thePrs->ShowLabels(myUseLabels->isChecked(), myNbLabels->value());
thePrs->ShowColored(myUseMagnitude->isChecked());
if(!thePrs->IsColored()){
return 1;
}
+void VisuGUI_IsoSurfPane::onRangeButtonClicked( int theId )
+{
+ bool isCustomRange = theId == 1;
+ MinIso->setEnabled( isCustomRange );
+ MaxIso->setEnabled( isCustomRange );
+}
+
void VisuGUI_IsoSurfPane::onCBUpdate()
{
myScalarPane->setRange(MinIso->text().toDouble(), MaxIso->text().toDouble(), true);
myIsoPane = new VisuGUI_IsoSurfPane(this, GetScalarPane());
if ( myIsoPane->layout() )
myIsoPane->layout()->setMargin( 5 );
- myTabBox->addTab(myIsoPane, "Iso Surface");
+ myTabBox->addTab(myIsoPane, tr("Iso Surface"));
myInputPane = new VisuGUI_InputPane(VISU::TISOSURFACES, theModule, this);
- myTabBox->addTab(GetScalarPane(), "Scalar Bar");
- myTabBox->addTab(myInputPane, "Input");
+ myTabBox->addTab(GetScalarPane(), tr("Scalar Bar"));
+ myTabBox->addTab(myInputPane, tr("Input"));
TopLayout->addWidget(myTabBox);
}
void VisuGUI_IsoSurfacesDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TISOSURFACES>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_IsoSurfacesDlg.h
// Author : Laurent CORNABE & Hubert ROLLAND
// Module : VISU
// $Header$
-
+//
#ifndef VISUGUI_ISOSURFACESDLG_H
#define VISUGUI_ISOSURFACESDLG_H
class QTabWidget;
class QLineEdit;
-class QSpinBox;
+class SalomeApp_IntSpinBox;
+class QButtonGroup;
class QtxColorButton;
namespace VISU
{
Q_OBJECT;
+public:
+ enum { ScalarBarRange = 0, CustomRange };
+
public:
VisuGUI_IsoSurfPane (QWidget* parent,
- VisuGUI_ScalarBarPane* theScalarPane);
+ VisuGUI_ScalarBarPane* theScalarPane);
~VisuGUI_IsoSurfPane() {};
void initFromPrsObject(VISU::IsoSurfaces_i* thePrs);
QColor color() const;
protected slots:
+ void onRangeButtonClicked( int );
void onCBUpdate();
void setColor();
private:
- QLineEdit* MinIso;
- QLineEdit* MaxIso;
- QSpinBox* NbrIso;
- QCheckBox* myUseMagnitude;
- QtxColorButton* mySelColor;
- QCheckBox* myUseLabels;
- QSpinBox* myNbLabels;
+ QButtonGroup* myRangeGrp;
+ QLineEdit* MinIso;
+ QLineEdit* MaxIso;
+ SalomeApp_IntSpinBox* NbrIso;
+ QCheckBox* myUseMagnitude;
+ QtxColorButton* mySelColor;
+ QCheckBox* myUseLabels;
+ SalomeApp_IntSpinBox* myNbLabels;
VisuGUI_ScalarBarPane* myScalarPane;
};
~VisuGUI_IsoSurfacesDlg();
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Module.cxx
// Author : Laurent CORNABE
#include "SVTK_RenderWindowInteractor.h"
#include "VISU_Event.h"
+#include "VTKViewer_Algorithm.h"
+
#include "VisuGUI_Prs3dTools.h"
#include "VisuGUI_ClippingDlg.h"
#include "VISU_Gen_i.hh"
#include "VISU_Result_i.hh"
-#include "VISU_CutLines_i.hh"
+#include "VISU_CutLinesBase_i.hh"
#include "VISU_Actor.h"
#include "VISU_ScalarMapAct.h"
#define GAUSS_DISPLAY_PRS 5500
#define GAUSS_DISPLAY_ONLY_PRS 5600
-#define GAUSS_SAVE_CONFIGURATION 5700
-#define GAUSS_OVERWRITE_CONFIGURATION 5701
-#define GAUSS_RESTORE_CONFIGURATION 5702
-#define GAUSS_RENAME_CONFIGURATION 5703
+//#define GAUSS_SAVE_CONFIGURATION 5700
+//#define GAUSS_OVERWRITE_CONFIGURATION 5701
+//#define GAUSS_RESTORE_CONFIGURATION 5702
+//#define GAUSS_RENAME_CONFIGURATION 5703
using namespace std;
void
CreateCurves( SalomeApp_Module* theModule,
- VISU::CutLines_i* thePrs,
+ VISU::CutLinesBase_i* thePrs,
QDialog* theDlg,
const bool theCreate = true );
//---------------------------------------------------------------
typedef void (SUIT_ViewWindow::* TViewVisibility)();
void SetViewVisibility(SalomeApp_Application* app,
- TViewVisibility theViewVisibility)
+ TViewVisibility theViewVisibility)
{
ViewManagerList l;
//app->viewManagers( VVTK_Viewer::Type(), l );
for( ; anIt!=aLast; anIt++ )
if( SUIT_ViewManager* aViewManager = *anIt )
{
- QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- int aSize = aViews.size();
- for(int anId = 0; anId < aSize; anId++)
- {
- if(SUIT_ViewWindow* aView = aViews[anId])
- (aView->* theViewVisibility)();
- }
+ QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+ int aSize = aViews.size();
+ for(int anId = 0; anId < aSize; anId++)
+ {
+ if(SUIT_ViewWindow* aView = aViews[anId])
+ (aView->* theViewVisibility)();
+ }
}
}
}
//---------------------------------------------------------------
VisuGUI_Module::VisuGUI_Module() :
- VisuGUI()
+ VisuGUI(),
+ LightApp_Module("VISU")
{
}
// "Save VISU State" command is moved from SalomeApp_Applicaiton
createAction( SAVE_VISU_STATE, tr( "TOT_DESK_FILE_SAVE_GUI_STATE" ), QIcon(),
- tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ),
- 0, getApp()->desktop(), false, getApp(), SLOT( onSaveGUIState() ) );
+ tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ),
+ 0, getApp()->desktop(), false, getApp(), SLOT( onSaveGUIState() ) );
int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
createMenu( SAVE_VISU_STATE, fileMenu, 9, -1 );
QPixmap aPixmap;
/* aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_NEW_VIEWER"));
createAction( GAUSS_NEW_VIEWER,
- tr("MEN_GAUSS_NEW_VIEWER"),
- aPixmap,
+ tr("MEN_GAUSS_NEW_VIEWER"),
+ aPixmap,
+ tr("MEN_GAUSS_NEW_VIEWER"),
tr("MEN_GAUSS_NEW_VIEWER"),
- tr("MEN_GAUSS_NEW_VIEWER"),
- Qt::ALT+Qt::Key_S,
- this,
- false,
+ Qt::ALT+Qt::Key_S,
this,
- SLOT(onCreateViewManager()));
+ false,
+ this,
+ SLOT(onCreateViewManager()));
int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, 100 );
int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 );
createMenu( action( GAUSS_NEW_VIEWER ), newWinMenu, -1 );
this, SLOT(OnCreateGaussPoints()));
mgr->insert( action( GAUSS_CREATE_PRS ), -1, 0, -1 );
mgr->setRule( action( GAUSS_CREATE_PRS ),
- "client='ObjectBrowser' and selcount=1 "
- "and type in {'VISU::TTIMESTAMP' 'VISU::TFIELD'} "
- "and $medEntity in {'EDGE_ENTITY' 'FACE_ENTITY' 'CELL_ENTITY'} "
- "and $medSource in {'eImportFile' 'eCopyAndImportFile'}" );
+ "client='ObjectBrowser' and selcount=1 "
+ "and type in {'VISU::TTIMESTAMP' 'VISU::TFIELD'} "
+ "and $medEntity in {'EDGE_ENTITY' 'FACE_ENTITY' 'CELL_ENTITY'} "
+ "and $medSource in {'eImportFile' 'eCopyAndImportFile'}" );
createMenu( action( GAUSS_CREATE_PRS ), createMenu( tr( "MEN_VISUALISATION" ), -1 ), -1 );
createTool( GAUSS_CREATE_PRS, createTool( tr( "TOOL_VISUALISATION" ) ), -1 );
- createAction( GAUSS_RENAME, VisuGUI::tr("MEN_RENAME"), QIcon(),
+ /*
+ createAction( GAUSS_RENAME, VisuGUI::tr("MEN_RENAME"), QIcon(),
VisuGUI::tr("MEN_RENAME"), "", 0, this, false,
this, SLOT(OnRename()));
- mgr->insert( action( GAUSS_RENAME ), -1, 0, -1 );
- mgr->setRule( action( GAUSS_RENAME ),
- "selcount=1 and type='VISU::TGAUSSPOINTS'" );
-
+ mgr->insert( action( GAUSS_RENAME ), -1, 0, -1 );
+ mgr->setRule( action( GAUSS_RENAME ),
+ "selcount=1 and type='VISU::TGAUSSPOINTS'" );
+ */
+
createAction( GAUSS_EDIT_PRS, VisuGUI::tr("MEN_EDIT_PRS"), QIcon(),
VisuGUI::tr("MEN_EDIT_PRS"), "", 0, this, false,
this, SLOT(OnEditGaussPoints()));
"selcount=1 and type='VISU::TGAUSSPOINTS'" );
action( GAUSS_COPY_PRS )->setEnabled(false);
-
+
QStringList viewers;
#ifndef DISABLE_OCCVIEWER
aRule = "(selcount>0 and type='VISU::TGAUSSPOINTS')";
- createAction( GAUSS_ERASE_PRS, VisuGUI::tr("MEN_HIDE"), QIcon(),
+/* createAction( GAUSS_ERASE_PRS, VisuGUI::tr("MEN_HIDE"), QIcon(),
VisuGUI::tr("MEN_HIDE"), "", 0, this, false,
this, SLOT(OnErasePrs()));
mgr->insert( action( GAUSS_ERASE_PRS ), -1, -1, -1 ); // erase
this, SLOT(OnDisplayOnlyPrs()));
mgr->insert( action( GAUSS_DISPLAY_ONLY_PRS ), -1, -1, -1 ); // display only
mgr->setRule( action( GAUSS_DISPLAY_ONLY_PRS ),
- aRule + " and ({true} in $canBeDisplayed)" );
-
+ aRule + " and ({true} in $canBeDisplayed)" );*/
+/*
createAction( GAUSS_RENAME_CONFIGURATION, VisuGUI::tr("MEN_RENAME"), QIcon(),
- VisuGUI::tr("MEN_RENAME"), "", 0, this, false,
+ VisuGUI::tr("MEN_RENAME"), "", 0, this, false,
this, SLOT(OnRename()));
mgr->insert( action( GAUSS_RENAME_CONFIGURATION ), -1, -1, -1 );
mgr->setRule( action( GAUSS_RENAME_CONFIGURATION ), "selcount=1 and type='VISU::TGAUSSVIEW'" );
mgr->insert( action( GAUSS_RESTORE_CONFIGURATION ), -1, -1, -1 );
mgr->setRule( action( GAUSS_RESTORE_CONFIGURATION ),
"selcount=1 and type='VISU::TGAUSSVIEW'" );
+*/
}
// //---------------------------------------------------------------
// aViewer->setBackgroundColor( aResourceMgr->colorValue( "VTKViewer", "background", aViewer->backgroundColor() ) );
// aViewer->setProjectionMode( aResourceMgr->integerValue( "VTKViewer", "projection_mode", aViewer->projectionMode() ) );
// aViewer->setTrihedronSize( aResourceMgr->integerValue( "VTKViewer", "trihedron_size", aViewer->trihedronSize() ),
-// aResourceMgr->booleanValue( "VTKViewer", "relative_size", aViewer->trihedronRelative() ) );
+// aResourceMgr->booleanValue( "VTKViewer", "relative_size", aViewer->trihedronRelative() ) );
// aViewer->setIncrementalSpeed( aResourceMgr->integerValue( "VTKViewer", "speed_value", aViewer->incrementalSpeed() ),
-// aResourceMgr->integerValue( "VTKViewer", "speed_mode", aViewer->incrementalSpeedMode() ) );
+// aResourceMgr->integerValue( "VTKViewer", "speed_mode", aViewer->incrementalSpeedMode() ) );
// aViewer->setInteractionStyle( aResourceMgr->integerValue( "VTKViewer", "navigation_mode", aViewer->interactionStyle() ) );
// aViewer->setSpacemouseButtons( aResourceMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", aViewer->spacemouseBtn(1) ),
-// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", aViewer->spacemouseBtn(1) ),
-// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", aViewer->spacemouseBtn(1) ) );
+// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", aViewer->spacemouseBtn(1) ),
+// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", aViewer->spacemouseBtn(1) ) );
// new LightApp_VTKSelector( aViewer, anApp->selectionMgr() );
VisuGUI::createPreferences();
createGaussPointsPreferences();
- createInsideCursorPreferences();
- createOutsideCursorPreferences();
+ //createInsideCursorPreferences();
+ //createOutsideCursorPreferences();
createPickingPreferences();
// createSpaceMousePreferences();
//createRecorderPreferences();
setPreferenceProperty( primitiveGr, "columns", 2 );
int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
- LightApp_Preferences::Selector, "VISU",
+ LightApp_Preferences::Selector, "VISU",
"point_sprite_primitive_type" );
QStringList values;
setPreferenceProperty( primitiveTypePref, "indexes", indices );
int clampPref = addPreference( tr( "VISU_GAUSS_PREF_CLAMP" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "point_sprite_clamp" );
+ LightApp_Preferences::IntSpin, "VISU", "point_sprite_clamp" );
setPreferenceProperty( clampPref, "min", 1 );
setPreferenceProperty( clampPref, "max", 512 );
addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "point_sprite_main_texture" );
+ LightApp_Preferences::File, "VISU", "point_sprite_main_texture" );
addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "point_sprite_alpha_texture" );
+ LightApp_Preferences::File, "VISU", "point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU",
+ LightApp_Preferences::DblSpin, "VISU",
"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", "geom_sphere_resolution" );
+ LightApp_Preferences::IntSpin, "VISU", "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", "geom_sphere_face_limit" );
+ LightApp_Preferences::IntSpin, "VISU", "geom_sphere_face_limit" );
setPreferenceProperty( faceLimitPref, "min", 10 );
setPreferenceProperty( faceLimitPref, "max", 1000000 );
setPreferenceProperty( sizeGr, "columns", 2 );
int minSizePref = addPreference( tr( "VISU_GAUSS_PREF_MIN_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU", "point_sprite_min_size" );
+ LightApp_Preferences::IntSpin, "VISU", "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", "point_sprite_max_size" );
+ LightApp_Preferences::IntSpin, "VISU", "point_sprite_max_size" );
setPreferenceProperty( maxSizePref, "min", 1 );
setPreferenceProperty( maxSizePref, "max", 100 );
int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU",
+ LightApp_Preferences::IntSpin, "VISU",
"point_sprite_magnification" );
setPreferenceProperty( magnificationPref, "min", 10 );
setPreferenceProperty( magnificationPref, "max", 1000 );
int incrementPref = addPreference( tr( "VISU_GAUSS_PREF_INCREMENT" ), sizeGr,
- LightApp_Preferences::DblSpin, "VISU", "point_sprite_increment" );
+ LightApp_Preferences::DblSpin, "VISU", "point_sprite_increment" );
setPreferenceProperty( incrementPref, "min", 0.01 );
setPreferenceProperty( incrementPref, "max", 10 );
setPreferenceProperty( incrementPref, "step", 0.1 );
setPreferenceProperty( geomGr, "columns", 2 );
int sizePref = addPreference( tr( "VISU_GAUSS_PREF_SIZE" ), geomGr,
- LightApp_Preferences::IntSpin, "VISU", "point_sprite_size" );
+ LightApp_Preferences::IntSpin, "VISU", "point_sprite_size" );
setPreferenceProperty( sizePref, "min", 1 );
setPreferenceProperty( sizePref, "max", 100 );
addPreference( tr( "VISU_GAUSS_PREF_COLOR" ), geomGr,
- LightApp_Preferences::Color, "VISU", "point_sprite_color" );
+ LightApp_Preferences::Color, "VISU", "point_sprite_color" );
// ScalarBar Preferences
int scalarBarGr = addPreference( tr( "VISU_GAUSS_SCALAR_BAR_PREF_GROUP_TTL" ), gaussTab );
setPreferenceProperty( scalarBarGr, "columns", 2 );
int activeBarPref = addPreference( tr( "VISU_GAUSS_PREF_ACTIVE_BAR" ), scalarBarGr,
- LightApp_Preferences::Selector, "VISU", "scalar_bar_active_local" );
+ LightApp_Preferences::Selector, "VISU", "scalar_bar_active_local" );
values.clear();
values.append( tr( "VISU_GAUSS_PREF_LOCAL" ) );
setPreferenceProperty( activeBarPref, "indexes", indices );
addPreference( tr( "VISU_GAUSS_PREF_DISPLAY_GLOBAL" ), scalarBarGr,
- LightApp_Preferences::Bool, "VISU", "scalar_bar_display_global" );
+ LightApp_Preferences::Bool, "VISU", "scalar_bar_display_global" );
int colorPref = addPreference( tr( "VISU_GAUSS_PREF_SCALAR_BAR_MODE" ), scalarBarGr,
- LightApp_Preferences::Selector, "VISU", "scalar_bar_bicolor" );
+ LightApp_Preferences::Selector, "VISU", "scalar_bar_bicolor" );
values.clear();
values.append( tr( "VISU_GAUSS_PREF_BICOLOR" ) );
setPreferenceProperty( colorPref, "indexes", indices );
int spacingPref = addPreference( tr( "VISU_GAUSS_PREF_SPACING" ), scalarBarGr,
- LightApp_Preferences::DblSpin, "VISU", "scalar_bar_spacing" );
+ LightApp_Preferences::DblSpin, "VISU", "scalar_bar_spacing" );
setPreferenceProperty( spacingPref, "min", 0.01 );
setPreferenceProperty( spacingPref, "max", 1.0 );
setPreferenceProperty( spacingPref, "step", 0.01 );
setPreferenceProperty( primitiveTypePref, "indexes", indices );
int clampPref = addPreference( tr( "VISU_GAUSS_PREF_CLAMP" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_clamp" );
+ LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_clamp" );
setPreferenceProperty( clampPref, "min", 1 );
setPreferenceProperty( clampPref, "max", 512 );
addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "inside_point_sprite_main_texture" );
+ LightApp_Preferences::File, "VISU", "inside_point_sprite_main_texture" );
addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "inside_point_sprite_alpha_texture" );
+ LightApp_Preferences::File, "VISU", "inside_point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU",
+ 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",
+ 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",
+ LightApp_Preferences::IntSpin, "VISU",
"inside_geom_sphere_face_limit" );
setPreferenceProperty( faceLimitPref, "min", 10 );
setPreferenceProperty( faceLimitPref, "max", 1000000 );
setPreferenceProperty( sizeGr, "columns", 4 );
int minSizePref = addPreference( tr( "VISU_GAUSS_PREF_MIN_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU",
+ 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",
+ LightApp_Preferences::IntSpin, "VISU",
"inside_point_sprite_max_size" );
setPreferenceProperty( maxSizePref, "min", 1 );
setPreferenceProperty( maxSizePref, "max", 100 );
setPreferenceProperty( magnificationGr, "columns", 4 );
int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), magnificationGr,
- LightApp_Preferences::IntSpin, "VISU",
+ 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",
+ LightApp_Preferences::DblSpin, "VISU",
"inside_point_sprite_increment" );
setPreferenceProperty( incrementPref, "min", 0.01 );
setPreferenceProperty( incrementPref, "max", 10 );
setPreferenceProperty( primitiveTypePref, "indexes", indices );
int clampPref = addPreference( tr( "VISU_GAUSS_PREF_CLAMP" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_clamp" );
+ LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_clamp" );
setPreferenceProperty( clampPref, "min", 1 );
setPreferenceProperty( clampPref, "max", 512 );
addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "outside_point_sprite_main_texture" );
+ LightApp_Preferences::File, "VISU", "outside_point_sprite_main_texture" );
addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" );
+ LightApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU",
+ 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",
+ 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",
+ LightApp_Preferences::IntSpin, "VISU",
"outside_geom_sphere_face_limit" );
setPreferenceProperty( faceLimitPref, "min", 10 );
setPreferenceProperty( faceLimitPref, "max", 1000000 );
setPreferenceProperty( sizeGr, "columns", 2 );
int sizePref = addPreference( tr( "VISU_GAUSS_PREF_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_size" );
+ LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_size" );
setPreferenceProperty( sizePref, "min", 1 );
setPreferenceProperty( sizePref, "max", 100 );
setPreferenceProperty( colorGr, "columns", 2 );
addPreference( tr( "VISU_GAUSS_PREF_UNIFORM_COLOR" ), colorGr,
- LightApp_Preferences::Bool, "VISU", "outside_point_sprite_uniform" );
+ LightApp_Preferences::Bool, "VISU", "outside_point_sprite_uniform" );
addPreference( tr( "VISU_GAUSS_PREF_COLOR" ), colorGr,
- LightApp_Preferences::Color, "VISU", "outside_point_sprite_color" );
+ LightApp_Preferences::Color, "VISU", "outside_point_sprite_color" );
}
setPreferenceProperty( cursorSizePref, "step", 0.1 );
int pyramidHeightPref = addPreference( tr( "VISU_PICKING_PREF_PYRAMID_HEIGHT" ), cursorGr,
- LightApp_Preferences::DblSpin, "VISU", "picking_pyramid_height" );
+ LightApp_Preferences::DblSpin, "VISU", "picking_pyramid_height" );
setPreferenceProperty( pyramidHeightPref, "min", 1 );
setPreferenceProperty( pyramidHeightPref, "max", 100 );
setPreferenceProperty( infoWindowGr, "columns", 2 );
int infoWindowPref = addPreference( tr( "VISU_PICKING_PREF_INFO_WINDOW" ), infoWindowGr,
- LightApp_Preferences::Bool, "VISU", "picking_info_window" );
+ LightApp_Preferences::Bool, "VISU", "picking_info_window" );
setPreferenceProperty( infoWindowPref, "columns", 2 );
int transparencyPref = addPreference( tr( "VISU_PICKING_PREF_TRANSPARENCY" ), infoWindowGr,
- LightApp_Preferences::IntSpin, "VISU", "picking_transparency" );
+ LightApp_Preferences::IntSpin, "VISU", "picking_transparency" );
setPreferenceProperty( transparencyPref, "min", 0 );
setPreferenceProperty( transparencyPref, "max", 100 );
setPreferenceProperty( transparencyPref, "step", 10 );
int positionPref = addPreference( tr( "VISU_PICKING_PREF_POSITION" ), infoWindowGr,
- LightApp_Preferences::Selector, "VISU", "picking_position" );
+ LightApp_Preferences::Selector, "VISU", "picking_position" );
QStringList values;
values.append( tr( "VISU_PICKING_PREF_BELOW_POINT" ) );
values.append( tr( "VISU_PICKING_PREF_TOP_LEFT_CORNER" ) );
setPreferenceProperty( cameraGr, "columns", 2 );
int cameraPref = addPreference( tr( "VISU_PICKING_PREF_CAMERA_MOVEMENT" ), cameraGr,
- LightApp_Preferences::Bool, "VISU", "picking_camera_movement" );
+ LightApp_Preferences::Bool, "VISU", "picking_camera_movement" );
setPreferenceProperty( cameraPref, "columns", 2 );
int zoomFactorPref = addPreference( tr( "VISU_PICKING_PREF_ZOOM_FACTOR" ), cameraGr,
- LightApp_Preferences::DblSpin, "VISU", "picking_zoom_factor" );
+ LightApp_Preferences::DblSpin, "VISU", "picking_zoom_factor" );
setPreferenceProperty( zoomFactorPref, "min", 0.1 );
setPreferenceProperty( zoomFactorPref, "max", 10.0 );
setPreferenceProperty( zoomFactorPref, "step", 0.1 );
int stepNumberPref = addPreference( tr( "VISU_PICKING_PREF_STEP_NUMBER" ), cameraGr,
- LightApp_Preferences::IntSpin, "VISU", "picking_step_number" );
+ LightApp_Preferences::IntSpin, "VISU", "picking_step_number" );
setPreferenceProperty( stepNumberPref, "min", 1 );
setPreferenceProperty( stepNumberPref, "max", 100 );
setPreferenceProperty( parentMeshGr, "columns", 1 );
addPreference( tr( "VISU_PICKING_PREF_DISPLAY_PARENT_MESH" ), parentMeshGr,
- LightApp_Preferences::Bool, "VISU", "picking_display_parent_mesh" );
+ LightApp_Preferences::Bool, "VISU", "picking_display_parent_mesh" );
}
setPreferenceProperty( recorderGr, "columns", 2 );
int modePref = addPreference( tr( "VISU_RECORDER_PREF_RECORDING_MODE" ), recorderGr,
- LightApp_Preferences::Selector, "VISU", "recorder_mode" );
+ LightApp_Preferences::Selector, "VISU", "recorder_mode" );
QStringList values;
values.append( tr( "VISU_RECORDER_PREF_SKIPPED_FRAMES" ) );
values.append( tr( "VISU_RECORDER_PREF_ALL_DISLPAYED_FRAMES" ) );
setPreferenceProperty( modePref, "indexes", indices );
int fpsPref = addPreference( tr( "VISU_RECORDER_PREF_FPS" ), recorderGr,
- LightApp_Preferences::DblSpin, "VISU", "recorder_fps" );
+ LightApp_Preferences::DblSpin, "VISU", "recorder_fps" );
setPreferenceProperty( fpsPref, "min", 0.1 );
setPreferenceProperty( fpsPref, "max", 100 );
int qualityPref = addPreference( tr( "VISU_RECORDER_PREF_QUALITY" ), recorderGr,
- LightApp_Preferences::IntSpin, "VISU", "recorder_quality" );
+ LightApp_Preferences::IntSpin, "VISU", "recorder_quality" );
setPreferenceProperty( qualityPref, "min", 1 );
setPreferenceProperty( qualityPref, "max", 100 );
addPreference( tr( "VISU_RECORDER_PREF_PROGRESSIVE" ), recorderGr,
- LightApp_Preferences::Bool, "VISU", "recorder_progressive" );
+ LightApp_Preferences::Bool, "VISU", "recorder_progressive" );
}
double initialTime = vtkTimerLog::GetCPUTime();
//CreatePrs3d<VISU::GaussPoints_i, VisuGUI_GaussPointsDlg, 1>(this, VVTK_Viewer::Type());
Prs3d_i* aPrs = CreatePrs3d<VISU::GaussPoints_i, VisuGUI_GaussPointsDlg, 1>(this, SVTK_Viewer::Type());
- if (aPrs)
- emit presentationCreated(aPrs);
+ processPresentationCreated(aPrs);
INFOS( "VisuGUI_Module::OnCreateGaussPoints() : Gauss Points created in " <<
- vtkTimerLog::GetCPUTime() - initialTime << " seconds" );
+ vtkTimerLog::GetCPUTime() - initialTime << " seconds" );
}
// void VisuGUI_Module::OnViewManagerAdded(SUIT_ViewManager* viewMgr)
VisuGUI::preferencesChanged(group,pref);
// if ( group == "VISU" && ( pref == "speed_increment" || pref == "spacemouse_func1_btn" ||
-// pref == "spacemouse_func2_btn" || pref == "spacemouse_func3_btn" ||
-// pref == "spacemouse_func4_btn" || pref == "spacemouse_func5_btn" ) ) {
+// pref == "spacemouse_func2_btn" || pref == "spacemouse_func3_btn" ||
+// pref == "spacemouse_func4_btn" || pref == "spacemouse_func5_btn" ) ) {
// // update properties of VVTK view windows
// SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false );
namespace
{
/* void GetViewParams(VVTK_MainWindow* theViewWindow,
- const char* theSuffix,
- std::ostringstream& theStr)
+ const char* theSuffix,
+ std::ostringstream& theStr)
{
vtkFloatingPointType aColor[3];
vtkRenderer* aRenderer = theViewWindow->getRenderer();
*/
//---------------------------------------------------------------
/* void SetViewParams(VVTK_MainWindow* theViewWindow,
- const char* theSuffix,
- const Storable::TRestoringMap& theMap)
+ const char* theSuffix,
+ const Storable::TRestoringMap& theMap)
{
vtkFloatingPointType aColor[3];
aColor[0] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".R").toDouble();
*/
//---------------------------------------------------------------
/* void GetViewParams(VVTK_MainWindow1* theViewWindow,
- std::ostringstream& theStr)
+ std::ostringstream& theStr)
{
GetViewParams(theViewWindow,"1",theStr);
if(aWidgetCtrl->GetEnabled()){
std::string aSegmentationMode;
if(aWidgetCtrl->IsPlanesActive()){
- VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
- vtkFloatingPointType anOrigin[3];
- aPlanesWidget->GetOrigin(anOrigin);
- Storable::DataToStream(theStr,"myCursorOrigin[0]",anOrigin[0]);
- Storable::DataToStream(theStr,"myCursorOrigin[1]",anOrigin[1]);
- Storable::DataToStream(theStr,"myCursorOrigin[2]",anOrigin[2]);
-
- vtkFloatingPointType aNormal[3];
- aPlanesWidget->GetNormal(aNormal);
- Storable::DataToStream(theStr,"myCursorNormal[0]",aNormal[0]);
- Storable::DataToStream(theStr,"myCursorNormal[1]",aNormal[1]);
- Storable::DataToStream(theStr,"myCursorNormal[2]",aNormal[2]);
-
- vtkFloatingPointType aDepth = aPlanesWidget->Distance();
- Storable::DataToStream(theStr,"myCursorDepth",aDepth);
-
- aSegmentationMode = "Planes";
+ VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
+ vtkFloatingPointType anOrigin[3];
+ aPlanesWidget->GetOrigin(anOrigin);
+ Storable::DataToStream(theStr,"myCursorOrigin[0]",anOrigin[0]);
+ Storable::DataToStream(theStr,"myCursorOrigin[1]",anOrigin[1]);
+ Storable::DataToStream(theStr,"myCursorOrigin[2]",anOrigin[2]);
+
+ vtkFloatingPointType aNormal[3];
+ aPlanesWidget->GetNormal(aNormal);
+ Storable::DataToStream(theStr,"myCursorNormal[0]",aNormal[0]);
+ Storable::DataToStream(theStr,"myCursorNormal[1]",aNormal[1]);
+ Storable::DataToStream(theStr,"myCursorNormal[2]",aNormal[2]);
+
+ vtkFloatingPointType aDepth = aPlanesWidget->Distance();
+ Storable::DataToStream(theStr,"myCursorDepth",aDepth);
+
+ aSegmentationMode = "Planes";
}else if(aWidgetCtrl->IsSphereActive()){
- VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
- vtkFloatingPointType aCenter[3];
- aSphereWidget->GetCenter(aCenter);
- Storable::DataToStream(theStr,"mySphereCursorCenter[0]",aCenter[0]);
- Storable::DataToStream(theStr,"mySphereCursorCenter[1]",aCenter[1]);
- Storable::DataToStream(theStr,"mySphereCursorCenter[2]",aCenter[2]);
+ VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
+ vtkFloatingPointType aCenter[3];
+ aSphereWidget->GetCenter(aCenter);
+ Storable::DataToStream(theStr,"mySphereCursorCenter[0]",aCenter[0]);
+ Storable::DataToStream(theStr,"mySphereCursorCenter[1]",aCenter[1]);
+ Storable::DataToStream(theStr,"mySphereCursorCenter[2]",aCenter[2]);
- vtkFloatingPointType aRadius = aSphereWidget->GetRadius();
- Storable::DataToStream(theStr,"mySphereCursorRaduis",aRadius);
+ vtkFloatingPointType aRadius = aSphereWidget->GetRadius();
+ Storable::DataToStream(theStr,"mySphereCursorRaduis",aRadius);
- aSegmentationMode = "Sphere";
+ aSegmentationMode = "Sphere";
}
Storable::DataToStream(theStr,"mySegmentationMode",aSegmentationMode.c_str());
*/
//---------------------------------------------------------------
/*void SetViewParams(VVTK_MainWindow1* theViewWindow,
- const Storable::TRestoringMap& theMap)
+ const Storable::TRestoringMap& theMap)
{
SetViewParams(theViewWindow,"1",theMap);
}
*/
//---------------------------------------------------------------
/*void GetViewParams(VVTK_MainWindow2* theViewWindow,
- std::ostringstream& theStr)
+ std::ostringstream& theStr)
{
GetViewParams(theViewWindow,"2",theStr);
}
void SetViewParams(VVTK_MainWindow2* theViewWindow,
- const Storable::TRestoringMap& theMap)
+ const Storable::TRestoringMap& theMap)
{
SetViewParams(theViewWindow,"2",theMap);
}
void operator()(VISU_GaussPtsAct* theActor)
{
if(theActor->GetVisibility()){
- const Handle(SALOME_InteractiveObject)& anIO = theActor->getIO();
- myVisibleEntries.insert(TVisibleEntries::value_type(anIO->getEntry(),TSelection()));
+ const Handle(SALOME_InteractiveObject)& anIO = theActor->getIO();
+ myVisibleEntries.insert(TVisibleEntries::value_type(anIO->getEntry(),TSelection()));
}
}
};
/*void GetGaussPointsSelection(SVTK_ViewWindow* theViewWindow,
- TVisibleEntries& theVisibleEntries)
+ TVisibleEntries& theVisibleEntries)
{
// First find all visible Gauss Points presentations
vtkRenderer* aRenderer = theViewWindow->getRenderer();
vtkActorCollection* anActors = aRenderer->GetActors();
TGetVisibleEntries aGetVisibleEntries(theVisibleEntries);
SVTK::ForEach<VISU_GaussPtsAct>(anActors,
- aGetVisibleEntries);
+ aGetVisibleEntries);
// Next, find the sub-ids for the visible Gauss Points presentations
SVTK_Selector* aSelector = theViewWindow->GetSelector();
std::string anEntry = anIO->getEntry();
TVisibleEntries::iterator anEntriesIter = theVisibleEntries.find(anEntry);
if(anEntriesIter != theVisibleEntries.end()){
- TSelection& aSelection = anEntriesIter->second;
- aSelection.myIsSelected = true;
- TColStd_IndexedMapOfInteger anIndexes;
- aSelector->GetIndex(anIO,anIndexes);
- if(anIndexes.Extent() > 0){
- aSelection.myHasSubId = true;
- aSelection.mySubId = anIndexes(1);
- }
+ TSelection& aSelection = anEntriesIter->second;
+ aSelection.myIsSelected = true;
+ TColStd_IndexedMapOfInteger anIndexes;
+ aSelector->GetIndex(anIO,anIndexes);
+ if(anIndexes.Extent() > 0){
+ aSelection.myHasSubId = true;
+ aSelection.mySubId = anIndexes(1);
+ }
}
}
}
//---------------------------------------------------------------
inline void CreateReference(_PTR(Study) theStudyDocument,
- _PTR(StudyBuilder) theStudyBuilder,
- _PTR(SObject) theFatherSObject,
- const string& theRefEntry,
- const TSelection& theSelection)
+ _PTR(StudyBuilder) theStudyBuilder,
+ _PTR(SObject) theFatherSObject,
+ const string& theRefEntry,
+ const TSelection& theSelection)
{
_PTR(SObject) aNewObj = theStudyBuilder->NewObject(theFatherSObject);
_PTR(SObject) aRefSObj = theStudyDocument->FindObjectID(theRefEntry);
//---------------------------------------------------------------
/*void SetGaussPointsSelection(VisuGUI* theModule,
- SVTK_ViewWindow* theViewWindow,
- _PTR(Study) theCStudy,
- _PTR(SObject) theSObject)
+ SVTK_ViewWindow* theViewWindow,
+ _PTR(Study) theCStudy,
+ _PTR(SObject) theSObject)
{
SVTK_Selector* aSelector = theViewWindow->GetSelector();
aSelector->ClearIObjects();
_PTR(SObject) aChildSObject = aChildIter->Value();
_PTR(SObject) aSObject;
if(aChildSObject->ReferencedObject(aSObject)){
- CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
- PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
- if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in())){
- // To set visiblity
- VISU::UpdateViewer(theModule, aPrs3d, anIsFirst, false);
- anIsFirst = false;
-
- // To update selection
- Storable::TRestoringMap aMap = Storable::GetStorableMap(aChildSObject);
- if(!aMap.empty()){
- bool anIsSelected = aMap["myIsSelected"].toInt();
- bool aHasSubId = aMap["myHasSubId"].toInt();
- int aSubId = aMap["mySubId"].toInt();
-
- if(anIsSelected){
- std::string anEntry = aSObject->GetID();
- Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(anEntry.c_str(),"");
- aSelector->AddIObject(anIO);
- if(aHasSubId)
- aSelector->AddOrRemoveIndex(anIO,aSubId,false);
- }
- }
- }
+ CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
+ PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
+ if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in())){
+ // To set visiblity
+ VISU::UpdateViewer(theModule, aPrs3d, anIsFirst, false);
+ anIsFirst = false;
+
+ // To update selection
+ Storable::TRestoringMap aMap = Storable::GetStorableMap(aChildSObject);
+ if(!aMap.empty()){
+ bool anIsSelected = aMap["myIsSelected"].toInt();
+ bool aHasSubId = aMap["myHasSubId"].toInt();
+ int aSubId = aMap["mySubId"].toInt();
+
+ if(anIsSelected){
+ std::string anEntry = aSObject->GetID();
+ Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(anEntry.c_str(),"");
+ aSelector->AddIObject(anIO);
+ if(aHasSubId)
+ aSelector->AddOrRemoveIndex(anIO,aSubId,false);
+ }
+ }
+ }
}
}
//---------------------------------------------------------------
/*void OnStoreConfiguration(SalomeApp_Module* theModule,
- bool theIsNew)
+ bool theIsNew)
{
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule));
if (CheckLock(aCStudy,GetDesktop(theModule)))
std::string aValue = GetViewParams(aViewWindow);
if(theIsNew){
- _PTR(SComponent) aSComponent = ClientFindOrCreateVisuComponent(aCStudy);
-
- static int myNbConfigs = 0;
- std::string aName = VISU::GenerateName("Config.", ++myNbConfigs).toLatin1().data();
-
- std::string aSComponentEntry = aSComponent->GetID();
- anEntry = CreateAttributes(aCStudy,
- aSComponentEntry.c_str(),
- "",
- "",
- aName.c_str(),
- "",
- aValue.c_str());
+ _PTR(SComponent) aSComponent = ClientFindOrCreateVisuComponent(aCStudy);
+
+ static int myNbConfigs = 0;
+ std::string aName = VISU::GenerateName("Config.", ++myNbConfigs).toLatin1().data();
+
+ std::string aSComponentEntry = aSComponent->GetID();
+ anEntry = CreateAttributes(aCStudy,
+ aSComponentEntry.c_str(),
+ "",
+ "",
+ aName.c_str(),
+ "",
+ aValue.c_str());
}else{
- SALOME_ListIO aListIO;
- aSelectionMgr->selectedObjects(aListIO);
- SALOME_ListIteratorOfListIO aListIter( aListIO );
- for(; aListIter.More(); aListIter.Next()){
- Handle(SALOME_InteractiveObject) anIO = aListIter.Value();
- _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
- _PTR(GenericAttribute) anAttr;
- if(aSObject->FindAttribute(anAttr,"AttributeString")){
- _PTR(AttributeString) aComment(anAttr);
- std::string aCommentValue(aComment->Value());
- if(aCommentValue.compare("myComment=GAUSSVIEW") >= 0){
- aComment->SetValue(aValue.c_str());
- anEntry = aSObject->GetID();
-
- _PTR(ChildIterator) aChildIter = aCStudy->NewChildIterator(aSObject);
- for (; aChildIter->More(); aChildIter->Next()) {
- _PTR(SObject) aChildSObject = aChildIter->Value();
- aStudyBuilder->RemoveObject(aChildSObject);
- }
- break;
- }
- }
- }
+ SALOME_ListIO aListIO;
+ aSelectionMgr->selectedObjects(aListIO);
+ SALOME_ListIteratorOfListIO aListIter( aListIO );
+ for(; aListIter.More(); aListIter.Next()){
+ Handle(SALOME_InteractiveObject) anIO = aListIter.Value();
+ _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
+ _PTR(GenericAttribute) anAttr;
+ if(aSObject->FindAttribute(anAttr,"AttributeString")){
+ _PTR(AttributeString) aComment(anAttr);
+ std::string aCommentValue(aComment->Value());
+ if(aCommentValue.compare("myComment=GAUSSVIEW") >= 0){
+ aComment->SetValue(aValue.c_str());
+ anEntry = aSObject->GetID();
+
+ _PTR(ChildIterator) aChildIter = aCStudy->NewChildIterator(aSObject);
+ for (; aChildIter->More(); aChildIter->Next()) {
+ _PTR(SObject) aChildSObject = aChildIter->Value();
+ aStudyBuilder->RemoveObject(aChildSObject);
+ }
+ break;
+ }
+ }
+ }
}
if(anEntry != ""){
- TVisibleEntries aVisibleEntries;
- GetGaussPointsSelection(aViewWindow,
- aVisibleEntries);
-
- _PTR(SObject) aSObject = aCStudy->FindObjectID(anEntry);
- _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder();
- TVisibleEntries::const_iterator anIter = aVisibleEntries.begin();
- for(; anIter != aVisibleEntries.end(); anIter++){
- const std::string& anEntry = anIter->first;
- const TSelection& aSelection = anIter->second;
-
- CreateReference(aCStudy,
- aStudyBuilder,
- aSObject,
- anEntry,
- aSelection);
- }
-
- //UpdateObjBrowser(theModule,true,aSObject);
- UpdateObjBrowser(theModule,true);
+ TVisibleEntries aVisibleEntries;
+ GetGaussPointsSelection(aViewWindow,
+ aVisibleEntries);
+
+ _PTR(SObject) aSObject = aCStudy->FindObjectID(anEntry);
+ _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder();
+ TVisibleEntries::const_iterator anIter = aVisibleEntries.begin();
+ for(; anIter != aVisibleEntries.end(); anIter++){
+ const std::string& anEntry = anIter->first;
+ const TSelection& aSelection = anIter->second;
+
+ CreateReference(aCStudy,
+ aStudyBuilder,
+ aSObject,
+ anEntry,
+ aSelection);
+ }
+
+ //UpdateObjBrowser(theModule,true,aSObject);
+ UpdateObjBrowser(theModule,true);
}
}
}*/
//---------------------------------------------------------------
/* template<class TMainWindow>
void SetMainWindowParams(VisuGUI* theModule,
- _PTR(SObject) theSObject,
- VVTK_ViewWindow* theViewWindow,
- TMainWindow* theMainWindow)
+ _PTR(SObject) theSObject,
+ VVTK_ViewWindow* theViewWindow,
+ TMainWindow* theMainWindow)
{
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule));
std::string aSegmentationMode;
if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){
- aMainWindow->SetPlanesSegementation(false);
- aMainWindow->SetSphereSegementation(false);
- VISU_WidgetCtrl* aWidgetCtrl = aMainWindow->GetWidgetCtrl();
- aSegmentationMode = Storable::FindValue(aMap,"mySegmentationMode").toLatin1().data();
-
- if(aSegmentationMode == "Planes"){
- VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
- vtkFloatingPointType anOrigin[3];
- anOrigin[0] = Storable::FindValue(aMap,"myCursorOrigin[0]").toDouble();
- anOrigin[1] = Storable::FindValue(aMap,"myCursorOrigin[1]").toDouble();
- anOrigin[2] = Storable::FindValue(aMap,"myCursorOrigin[2]").toDouble();
- aPlanesWidget->SetOrigin(anOrigin);
-
- vtkFloatingPointType aNormal[3];
- aNormal[0] = Storable::FindValue(aMap,"myCursorNormal[0]").toDouble();
- aNormal[1] = Storable::FindValue(aMap,"myCursorNormal[1]").toDouble();
- aNormal[2] = Storable::FindValue(aMap,"myCursorNormal[2]").toDouble();
- aPlanesWidget->SetNormal(aNormal);
-
- vtkFloatingPointType aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble();
- aPlanesWidget->SetDistance(aDepth);
-
- aMainWindow->SetPlanesSegementation(true);
- }else if(aSegmentationMode == "Sphere"){
- VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
- vtkFloatingPointType aCenter[3];
- aCenter[0] = Storable::FindValue(aMap,"mySphereCursorCenter[0]").toDouble();
- aCenter[1] = Storable::FindValue(aMap,"mySphereCursorCenter[1]").toDouble();
- aCenter[2] = Storable::FindValue(aMap,"mySphereCursorCenter[2]").toDouble();
- aSphereWidget->SetCenter(aCenter);
-
- vtkFloatingPointType aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble();
- aSphereWidget->SetRadius(aRadius);
-
- aMainWindow->SetSphereSegementation(true);
- }
+ aMainWindow->SetPlanesSegementation(false);
+ aMainWindow->SetSphereSegementation(false);
+ VISU_WidgetCtrl* aWidgetCtrl = aMainWindow->GetWidgetCtrl();
+ aSegmentationMode = Storable::FindValue(aMap,"mySegmentationMode").toLatin1().data();
+
+ if(aSegmentationMode == "Planes"){
+ VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
+ vtkFloatingPointType anOrigin[3];
+ anOrigin[0] = Storable::FindValue(aMap,"myCursorOrigin[0]").toDouble();
+ anOrigin[1] = Storable::FindValue(aMap,"myCursorOrigin[1]").toDouble();
+ anOrigin[2] = Storable::FindValue(aMap,"myCursorOrigin[2]").toDouble();
+ aPlanesWidget->SetOrigin(anOrigin);
+
+ vtkFloatingPointType aNormal[3];
+ aNormal[0] = Storable::FindValue(aMap,"myCursorNormal[0]").toDouble();
+ aNormal[1] = Storable::FindValue(aMap,"myCursorNormal[1]").toDouble();
+ aNormal[2] = Storable::FindValue(aMap,"myCursorNormal[2]").toDouble();
+ aPlanesWidget->SetNormal(aNormal);
+
+ vtkFloatingPointType aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble();
+ aPlanesWidget->SetDistance(aDepth);
+
+ aMainWindow->SetPlanesSegementation(true);
+ }else if(aSegmentationMode == "Sphere"){
+ VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
+ vtkFloatingPointType aCenter[3];
+ aCenter[0] = Storable::FindValue(aMap,"mySphereCursorCenter[0]").toDouble();
+ aCenter[1] = Storable::FindValue(aMap,"mySphereCursorCenter[1]").toDouble();
+ aCenter[2] = Storable::FindValue(aMap,"mySphereCursorCenter[2]").toDouble();
+ aSphereWidget->SetCenter(aCenter);
+
+ vtkFloatingPointType aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble();
+ aSphereWidget->SetRadius(aRadius);
+
+ aMainWindow->SetSphereSegementation(true);
+ }
}
if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){
- SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
- if(anInteractor->isVisible()){
- SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
- }else
- anInteractor->installEventFilter(this);
+ SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+ if(anInteractor->isVisible()){
+ SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
+ }else
+ anInteractor->installEventFilter(this);
}
if(aSegmentationMode != ""){
- if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){
- SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
- if(anInteractor->isVisible())
- SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
- else
- anInteractor->installEventFilter(this);
- }
+ if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){
+ SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+ if(anInteractor->isVisible())
+ SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
+ else
+ anInteractor->installEventFilter(this);
+ }
}
SetGaussPointsSelection(this,aViewWindow,aCStudy,aSObject);
// SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
// VVTK_ViewWindow* aViewWindow = dynamic_cast<VVTK_ViewWindow*>(aWindow);
// if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){
-// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
-// if(theWatched == anInteractor){
-// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
-// anInteractor->removeEventFilter(this);
-// }
+// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+// if(theWatched == anInteractor){
+// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
+// anInteractor->removeEventFilter(this);
+// }
// }
// if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){
-// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
-// if(theWatched == aMainWindow->GetInteractor()){
-// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
-// anInteractor->removeEventFilter(this);
-// }
+// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+// if(theWatched == aMainWindow->GetInteractor()){
+// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
+// anInteractor->removeEventFilter(this);
+// }
// }
// }
// }
vwin->getVisualParameters().toLatin1().data() );
if ( application()->desktop()->activeWindow() == vwin )
- ip->setProperty( "ActiveGaussViewer", QString::number( vvtkViewers ).toLatin1().data() );
+ ip->setProperty( "ActiveGaussViewer", QString::number( vvtkViewers ).toLatin1().data() );
vvtkViewers++;
}
}
// 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)
+ vType == VVTK_Viewer::Type()*/ ) { // way (VVTK_ViewWindow inherits SVTK_ViewWindow)
QVector<SUIT_ViewWindow*> views = vman->getViews();
for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) {
- if ( SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>( 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.toLatin1().data();
+ if ( SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>( views[i] ) ) {
+ VTK::ActorCollectionCopy aCopy(vtkView->getRenderer()->GetActors());
+ vtkActorCollection* allActors = aCopy.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.toLatin1().data();
vtkParam += gSeparator;
- vtkParam += QString::number( *viewsCounter ).toLatin1().data();
+ vtkParam += QString::number( *viewsCounter ).toLatin1().data();
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() ).toLatin1().data() );
- param = vtkParam + "Opacity";
- ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() );
- vtkFloatingPointType r, g, b;
- vActor->GetColor(r, g, b);
- QString colorStr = QString::number( r ); colorStr += gDigitsSep;
- colorStr += QString::number( g ); colorStr += gDigitsSep;
+ 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() ).toLatin1().data() );
+ param = vtkParam + "Quadratic2DRepresentation";
+ ip->setParameter( entry, param, QString::number( vActor->GetQuadratic2DRepresentation() ).toLatin1().data() );
+ param = vtkParam + "Opacity";
+ ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() );
+ vtkFloatingPointType 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.toLatin1().data() );
- param = vtkParam + "LineWidth";
- ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() );
- if ( vActor->IsShrunkable() && vActor->IsShrunk() ) {
- param = vtkParam + "ShrinkMode";
- ip->setParameter( entry, param, "On" );
- param = vtkParam + "ShrinkFactor";
- ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() );
- }
- VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor );
- if ( scalarMapActor && scalarMapActor->IsShading() ) {
- param = vtkParam + "Shading";
- ip->setParameter( entry, param, "On" );
- }
- if ( const VISU::Prs3d_i* vPrs = vActor->GetPrs3d() ) {
- param = vtkParam + "ClippingPlane";
- int nPlanes = vPrs->GetNumberOfClippingPlanes();
- if ( !nPlanes )
- ip->setParameter( entry, param, "Off" );
- for ( int p = 0; p < nPlanes; p++ ) {
- vtkPlane* plane = vPrs->GetClippingPlane( p );
- vtkFloatingPointType normal[3], origin[3];
- plane->GetNormal( normal );
- plane->GetOrigin( origin );
- std::string planeValue = QString::number( normal[0] ).toLatin1().data(); planeValue += gDigitsSep;
- planeValue += QString::number( normal[1] ).toLatin1().data(); planeValue += gDigitsSep;
- planeValue += QString::number( normal[2] ).toLatin1().data(); planeValue += gDigitsSep;
- planeValue += QString::number( origin[0] ).toLatin1().data(); planeValue += gDigitsSep;
- planeValue += QString::number( origin[1] ).toLatin1().data(); planeValue += gDigitsSep;
- planeValue += QString::number( origin[2] ).toLatin1().data();
- param = QString( "%1ClippingPlane_%2" ).arg( vtkParam.c_str() ).arg( p+1 ).toLatin1().data();
- ip->setParameter( entry, param, planeValue );
- }
- }
+ param = vtkParam + "Color";
+ ip->setParameter( entry, param, colorStr.toLatin1().data() );
+ param = vtkParam + "LineWidth";
+ ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() );
+ if ( vActor->IsShrunkable() && vActor->IsShrunk() ) {
+ param = vtkParam + "ShrinkMode";
+ ip->setParameter( entry, param, "On" );
+ param = vtkParam + "ShrinkFactor";
+ ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() );
+ }
+ VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor );
+ if ( scalarMapActor && scalarMapActor->IsShading() ) {
+ param = vtkParam + "Shading";
+ ip->setParameter( entry, param, "On" );
+ }
+ if ( const VISU::Prs3d_i* vPrs = vActor->GetPrs3d() ) {
+ param = vtkParam + "ClippingPlane";
+ int nPlanes = vPrs->GetNumberOfClippingPlanes();
+ if ( !nPlanes )
+ ip->setParameter( entry, param, "Off" );
+ for ( int p = 0; p < nPlanes; p++ ) {
+ vtkPlane* plane = vPrs->GetClippingPlane( p );
+ vtkFloatingPointType normal[3], origin[3];
+ plane->GetNormal( normal );
+ plane->GetOrigin( origin );
+ std::string planeValue = QString::number( normal[0] ).toLatin1().data(); planeValue += gDigitsSep;
+ planeValue += QString::number( normal[1] ).toLatin1().data(); planeValue += gDigitsSep;
+ planeValue += QString::number( normal[2] ).toLatin1().data(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[0] ).toLatin1().data(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[1] ).toLatin1().data(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[2] ).toLatin1().data();
+ param = QString( "%1ClippingPlane_%2" ).arg( vtkParam.c_str() ).arg( p+1 ).toLatin1().data();
+ ip->setParameter( entry, param, planeValue );
+ }
+ }
+
+ } // hasIO
+ } // salome_actor successfull downcast to the VISU_Actor
+ else if ( VISU_PointMap3dActor* vActor = VISU_PointMap3dActor::SafeDownCast( actor ) ) { // PointMap3D
+ 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.toLatin1().data();
+ vtkParam += gSeparator;
+ vtkParam += QString::number( *viewsCounter ).toLatin1().data();
+ vtkParam += gSeparator;
- } // hasIO
- } // salome_actor successfull downcast
- } // isVisible
- } // end of ..while.. actors traversal
- } // if ( vtkView )
+ 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() ).toLatin1().data() );
+ param = vtkParam + "Opacity";
+ ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() );
+ vtkFloatingPointType 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.toLatin1().data() );
+ param = vtkParam + "LineWidth";
+ ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() );
+ if ( vActor->IsShrunkable() && vActor->IsShrunk() ) {
+ param = vtkParam + "ShrinkMode";
+ ip->setParameter( entry, param, "On" );
+ param = vtkParam + "ShrinkFactor";
+ ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() );
+ }
+ }
+ } // salome actor is downcasted to the VISU_PointMap3dActor
+ } // isVisible
+ } // end of ..while.. actors traversal
+ } // if ( vtkView )
} // for ( views )
(*viewsCounter)++;
} // if ( SVTK view model )
else if ( vType == SPlot2d_Viewer::Type() ) { // processing Plot2d viewers
QVector<SUIT_ViewWindow*> views = vman->getViews();
for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) {
- if ( Plot2d_ViewWindow* plotView = dynamic_cast<Plot2d_ViewWindow*>( views[i] ) ) {
- Plot2d_ViewFrame* plotVF = plotView->getViewFrame();
- QList<Plot2d_Curve*> curves;
+ if ( Plot2d_ViewWindow* plotView = dynamic_cast<Plot2d_ViewWindow*>( views[i] ) ) {
+ Plot2d_ViewFrame* plotVF = plotView->getViewFrame();
+ QList<Plot2d_Curve*> curves;
QList<Plot2d_Curve*>::Iterator itCurve;
- plotVF->getCurves( curves );
-
- //Plot2d_Curve* curve;
- for ( itCurve = curves.begin(); itCurve != curves.end(); itCurve++ ) {
- if ( SPlot2d_Curve* sCurve = dynamic_cast<SPlot2d_Curve*>( *itCurve ) ) {
- 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.toLatin1().data(); plotParam += gSeparator;
- plotParam += QString::number( *viewsCounter ).toLatin1().data(); plotParam += gSeparator;
-
- param = plotParam + "Visibility";
- ip->setParameter( entry, param, "On" );
- }
- }
- } // for curves
- } // if ( plotView )
+ plotVF->getCurves( curves );
+
+ //Plot2d_Curve* curve;
+ for ( itCurve = curves.begin(); itCurve != curves.end(); itCurve++ ) {
+ if ( SPlot2d_Curve* sCurve = dynamic_cast<SPlot2d_Curve*>( *itCurve ) ) {
+ 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.toLatin1().data(); plotParam += gSeparator;
+ plotParam += QString::number( *viewsCounter ).toLatin1().data(); plotParam += gSeparator;
+
+ param = plotParam + "Visibility";
+ ip->setParameter( entry, param, "On" );
+ }
+ }
+ } // for curves
+ } // if ( plotView )
} // for ( views )
(*viewsCounter)++;
} // if ( SPlot2d view model )
_PTR(IParameters) ip = ClientFactory::getIParameters(ap);
// actors are stored in a map after displaying of them for quicker access in future
- QMap<QString, QMap<QString, VISU_Actor*> > vtkActors; // map: entry to map: ViewType_<ID> to actor (SVTK/VVTK)
+ QMap<QString, QMap<QString, VISU_ActorBase*> > vtkActors; // map: entry to map: ViewType_<ID> to actor (SVTK/VVTK)
std::vector<std::string> entries = ip->getEntries();
// 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->setWindowTitle( (*namesIt).c_str() );
+// SUIT_ViewManager* vman = onCreateViewManager();
+// SUIT_ViewWindow* vwin = vman->getActiveView();
+// vwin->setWindowTitle( (*namesIt).c_str() );
-// // wait untill the window is really shown. This step fixes MANY bugs..
-// while ( !vwin->isVisible() )
-// qApp->processEvents();
+// // wait untill the window is really shown. This step fixes MANY bugs..
+// while ( !vwin->isVisible() )
+// qApp->processEvents();
-// vwin->setVisualParameters( (*valuesIt).c_str() );
+// vwin->setVisualParameters( (*valuesIt).c_str() );
// }
// continue; // skip to next entry
// }
std::string viewIndexStr = ::getParam( *namesIt, ViewIndex );
int viewIndex = QString( viewIndexStr.c_str() ).toUInt( &ok );
if ( !ok ) // bad conversion of view index to integer
- continue;
+ continue;
// cout << " -- " << viewerType << ": entry = " << entry.latin1() << ", paramName = " << paramName << endl;
if ( viewerType == SVTK_Viewer::Type().toLatin1().data() /*||
- viewerType == VVTK_Viewer::Type().toLatin1().data()*/ ) {
-
- // used as inner map key for locating the actor.
- QString viewerTypeIndex = QString( viewerType.c_str() ) + QString::number( viewIndex );
-
- if ( paramName == "Visibility" && displayer() ) {
- // if VVTK, then we must create viewer first, because
-
- QList<SUIT_ViewManager*> lst;
- getApp()->viewManagers( viewerType.c_str(), 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();
- // both SVTK and VVTK view models can be casted to SALOME_View
- displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
-
- // store displayed actor in a temporary map for quicker access later when restoring other parameters
- SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
- QMap<QString, VISU_Actor*> viewActorMap;
- if ( vtkActors.contains( entry ) )
- viewActorMap = vtkActors[ entry ];
- viewActorMap[ viewerTypeIndex ] = FindActor( GetAppStudy(this), vtkView, entry );
- 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<QString, VISU_Actor*> viewActorMap = vtkActors[ entry ];
- if ( viewActorMap.contains( viewerTypeIndex ) )
- vActor = viewActorMap[ viewerTypeIndex ];
+ viewerType == VVTK_Viewer::Type().toLatin1().data()*/ ) {
+
+ // used as inner map key for locating the actor.
+ QString viewerTypeIndex = QString( viewerType.c_str() ) + QString::number( viewIndex );
+
+ if ( paramName == "Visibility" && displayer() ) {
+ // if VVTK, then we must create viewer first, because
+
+ QList<SUIT_ViewManager*> lst;
+ getApp()->viewManagers( viewerType.c_str(), 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();
+ // both SVTK and VVTK view models can be casted to SALOME_View
+ displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
+
+ // store displayed actor in a temporary map for quicker access later when restoring other parameters
+ SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
+ QMap<QString, VISU_ActorBase*> viewActorMap;
+ if ( vtkActors.contains( entry ) )
+ viewActorMap = vtkActors[ entry ];
+ viewActorMap[ viewerTypeIndex ] = FindActorBase( GetAppStudy(this), vtkView, entry );
+ vtkActors[ entry ] = viewActorMap;
+ }
+ }
+ else { // the rest properties "work" with VISU_Actor, so we initialize it at first
+ VISU_Actor* vActor = 0;
+ VISU_PointMap3dActor* vP3dActor = 0;
+ if ( vtkActors.contains( entry ) ) {
+ QMap<QString, VISU_ActorBase*> viewActorMap = vtkActors[ entry ];
+ if ( viewActorMap.contains( viewerTypeIndex ) ) {
+ vActor = VISU_Actor::SafeDownCast( viewActorMap[ viewerTypeIndex ] );
+ vP3dActor = VISU_PointMap3dActor::SafeDownCast( viewActorMap[ viewerTypeIndex ] );
+ }
}
- if ( !vActor )
- continue;
-
- QString val( (*valuesIt).c_str() );
-
- if ( paramName == "Name" )
- vActor->setName( val.toLatin1().data() );
+ QString val( (*valuesIt).c_str() );
+ if ( vActor ) {
+ // salome_actor successfull downcast to the VISU_Actor
+ if ( paramName == "Name" )
+ vActor->setName( val.toLatin1().data() );
+
+ else if ( paramName == "RepresentationMode" )
+ vActor->SetRepresentation( val.toInt() );
+
+ else if (paramName == "Quadratic2DRepresentation")
+ vActor->SetQuadratic2DRepresentation(VISU_Actor::EQuadratic2DRepresentation(val.toInt()));
+
+ else if ( paramName == "Opacity" )
+ vActor->SetOpacity( val.toFloat() );
+
+ else if ( paramName == "Color" ) {
+ QStringList colors = val.split( gDigitsSep, QString::SkipEmptyParts );
+ if ( colors.count() == 3 )
+ vActor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() );
+ }
- else if ( paramName == "RepresentationMode" )
- vActor->SetRepresentation( val.toInt() );
+ else if ( paramName == "LineWidth" )
+ vActor->SetLineWidth( val.toFloat() );
- else if ( paramName == "Opacity" )
- vActor->SetOpacity( val.toFloat() );
+ else if ( paramName == "ShrinkMode" ) {
+ vActor->SetShrinkable( true );
+ vActor->SetShrink();
+ }
- else if ( paramName == "Color" ) {
- QStringList colors = val.split( gDigitsSep, QString::SkipEmptyParts );
- if ( colors.count() == 3 )
- vActor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() );
- }
+ else if ( paramName == "ShrinkFactor" )
+ vActor->SetShrinkFactor( val.toFloat() );
- else if ( paramName == "LineWidth" )
- vActor->SetLineWidth( val.toFloat() );
+ else if ( paramName == "Shading" ) {
+ if ( VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor ) )
+ scalarMapActor->SetShading();
+ }
- else if ( paramName == "ShrinkMode" ) {
- vActor->SetShrinkable( true );
- vActor->SetShrink();
- }
+ else if ( paramName.find( "ClippingPlane" ) != std::string::npos ) {
+ VISU::Prs3d_i* prs = vActor->GetPrs3d();
+ if ( !prs )
+ continue;
+
+ //prs->RemoveAllClippingPlanes();
+ for (int i = prs->GetNumberOfClippingPlanes() - 1; i >= 0 ; i--) {
+ OrientedPlane* aPlane = dynamic_cast<OrientedPlane*>(prs->GetClippingPlane(i));
+ if (aPlane)
+ prs->RemoveClippingPlane(i);
+ }
+ if ( val != "Off" ) {
+ QStringList vals = val.split( gDigitsSep, QString::SkipEmptyParts );
+ if ( vals.count() == 6 ) { // format check: 6 float values
+ vtkFloatingPointType normal[3], origin[3];
+ for (int x = 0; x < 3; x++ ) {
+ normal[x] = vals[x].toFloat();
+ origin[x] = vals[x+3].toFloat();
+ }
+ OrientedPlane* plane = OrientedPlane::New();
+ plane->SetNormal( normal );
+ plane->SetOrigin( origin );
+ prs->AddClippingPlane( plane );
+ plane->Delete();
+ }
+ }
+ }
+ } // if ( vActor ) --> salome_actor successfull downcast to the VISU_Actor
+ else if ( vP3dActor ) {
+ // salome actor is downcasted to the VISU_PointMap3dActor
+ if ( paramName == "Name" )
+ vP3dActor->setName( val.toLatin1().data() );
+
+ else if ( paramName == "RepresentationMode" )
+ vP3dActor->SetRepresentation( val.toInt() );
+
+ else if ( paramName == "Opacity" )
+ vP3dActor->SetOpacity( val.toFloat() );
+
+ else if ( paramName == "Color" ) {
+ QStringList colors = val.split( gDigitsSep, QString::SkipEmptyParts );
+ if ( colors.count() == 3 )
+ vP3dActor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() );
+ }
- else if ( paramName == "ShrunkFactor" )
- vActor->SetShrinkFactor( val.toFloat() );
+ else if ( paramName == "LineWidth" )
+ vP3dActor->SetLineWidth( val.toFloat() );
- else if ( paramName == "Shading" ) {
- if ( VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor ) )
- scalarMapActor->SetShading();
- }
+ else if ( paramName == "ShrinkMode" ) {
+ vP3dActor->SetShrinkable( true );
+ vP3dActor->SetShrink();
+ }
- else if ( paramName.find( "ClippingPlane" ) != std::string::npos ) {
- VISU::Prs3d_i* prs = vActor->GetPrs3d();
- if ( !prs )
- continue;
+ else if ( paramName == "ShrinkFactor" )
+ vP3dActor->SetShrinkFactor( val.toFloat() );
- //prs->RemoveAllClippingPlanes();
- for (int i = prs->GetNumberOfClippingPlanes() - 1; i >= 0 ; i--) {
- OrientedPlane* aPlane = dynamic_cast<OrientedPlane*>(prs->GetClippingPlane(i));
- if (aPlane)
- prs->RemoveClippingPlane(i);
- }
- if ( val != "Off" ) {
- QStringList vals = val.split( gDigitsSep, QString::SkipEmptyParts );
- if ( vals.count() == 6 ) { // format check: 6 float values
- vtkFloatingPointType normal[3], origin[3];
- for (int x = 0; x < 3; x++ ) {
- normal[x] = vals[x].toFloat();
- origin[x] = vals[x+3].toFloat();
- }
- OrientedPlane* plane = OrientedPlane::New();
- plane->SetNormal( normal );
- plane->SetOrigin( origin );
- prs->AddClippingPlane( plane );
- plane->Delete();
- }
- }
- }
- } // else ..
+ } // else if ( vP3dActor ) --> salome actor is downcasted to the VISU_PointMap3dActor
+ } // else ..
} // if SVTK
else if ( viewerType == SPlot2d_Viewer::Type().toLatin1().data() ) {
- if ( paramName == "Visibility" && displayer() ) {
- QList<SUIT_ViewManager*> lst;
- getApp()->viewManagers( viewerType.c_str(), lst );
+ if ( paramName == "Visibility" && displayer() ) {
+ QList<SUIT_ViewManager*> lst;
+ getApp()->viewManagers( viewerType.c_str(), 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<SALOME_View*>( vmodel ) );
- }
- }
+ 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<SALOME_View*>( vmodel ) );
+ }
+ }
} // if SPlot2d
if ( !vmodel )
continue;
if ( vmodel->getType() == SVTK_Viewer::Type() /*|| // processing SVTK and VVTK viewers
- vmodel->getType() == VVTK_Viewer::Type()*/ ) { // in the same way
+ vmodel->getType() == VVTK_Viewer::Type()*/ ) { // in the same way
SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) (*it)->getActiveView();
vtkView->getRenderer()->ResetCameraClippingRange();
vtkView->Repaint();
// if ( activeGaussViewer >= 0 && activeGaussViewer < lst.count() ) {
// SUIT_ViewWindow* activeView = lst.at( activeGaussViewer )->getActiveView();
// if ( activeView ) {
-// activeView->activateWindow();
-// //activeView->setFocus();
+// activeView->activateWindow();
+// //activeView->setFocus();
// }
// }
// }
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Module.h
// Author :
virtual
SUIT_ViewManager*
getViewManager(const QString& theType,
- const bool theIsCreate);
+ const bool theIsCreate);
virtual
void
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_NameDlg.cxx
// Author : Vadim SANDLER
// Module : SALOME
*/
VisuGUI_NameDlg::VisuGUI_NameDlg( QWidget* parent )
: QDialog( parent ? parent : SUIT_Session::session()->activeApplication()->desktop(),
- Qt::WindowTitleHint | Qt::WindowSystemMenuHint )//,WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+ Qt::WindowTitleHint | Qt::WindowSystemMenuHint )//,WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
{
setWindowTitle( tr("TLT_RENAME") );
setSizeGripEnabled( TRUE );
void VisuGUI_NameDlg::onHelp()
{
- QString aHelpFileName = "viewing_3d_presentations_intro_page.html";
+ QString aHelpFileName = "viewing_3d_presentations_page.html#rename_anchor";
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
if (app) {
VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_NameDlg.h
// Author : Vadim SANDLER
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VisuGUI_OffsetDlg.h"
#include "VisuGUI.h"
#include "LightApp_SelectionMgr.h"
#include "SALOME_ListIteratorOfListIO.hxx"
#include "SalomeApp_Application.h"
+#include <SalomeApp_DoubleSpinBox.h>
#include "SVTK_ViewWindow.h"
#include "SVTK_ViewModel.h"
#include "SUIT_ViewManager.h"
#include "SUIT_MessageBox.h"
#include "SUIT_ResourceMgr.h"
-#include "QtxDoubleSpinBox.h"
-
// VTK Includes
#include "vtkRenderer.h"
aHBLay->setSpacing(6);
aHBLay->addWidget( new QLabel ("dX:", anOffsetsPane) );
- aHBLay->addWidget( myDxEdt = new QtxDoubleSpinBox (anOffsetsPane) );
- myDxEdt->setRange(-MAXVAL, MAXVAL);
+ aHBLay->addWidget( myDxEdt = new SalomeApp_DoubleSpinBox (anOffsetsPane) );
+ VISU::initSpinBox( myDxEdt, -MAXVAL, MAXVAL, 1., "length_precision" );
aHBLay->addWidget( new QLabel("dY:", anOffsetsPane) );;
- aHBLay->addWidget( myDyEdt = new QtxDoubleSpinBox (anOffsetsPane) );
- myDyEdt->setRange(-MAXVAL, MAXVAL);
+ aHBLay->addWidget( myDyEdt = new SalomeApp_DoubleSpinBox (anOffsetsPane) );
+ VISU::initSpinBox( myDyEdt, -MAXVAL, MAXVAL, 1., "length_precision" );
aHBLay->addWidget( new QLabel("dZ:", anOffsetsPane) );
- aHBLay->addWidget( myDzEdt = new QtxDoubleSpinBox (anOffsetsPane) );
- myDzEdt->setRange(-MAXVAL, MAXVAL);
+ aHBLay->addWidget( myDzEdt = new SalomeApp_DoubleSpinBox (anOffsetsPane) );
+ VISU::initSpinBox( myDzEdt, -MAXVAL, MAXVAL, 1., "length_precision" );
QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), anOffsetsPane);
aHBLay->addWidget( aResetBtn );
QString anEntry(anIO->getEntry());
VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anEntry.toLatin1().constData());
if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase))
- addPresentation(aPrsObject);
+ addPresentation(aPrsObject);
else if (VISU::PointMap3d_i* aPrs = dynamic_cast<VISU::PointMap3d_i*>(anObjectInfo.myBase)) {
- addPointMapPresentation(aPrs);
+ addPointMapPresentation(aPrs);
}
}
}
if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
if (VISU_Actor* anActor = VISU::FindActor(vw, thePrs)) {
- anActor->SetPosition(theOffset);
+ anActor->SetPosition(theOffset);
vw->onAdjustTrihedron();
vw->getRenderer()->ResetCameraClippingRange();
vw->Repaint();
for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
- vw->onAdjustTrihedron();
+ vw->onAdjustTrihedron();
if (VISU_ActorBase* anActor = VISU::FindActorBase(vw, thePrs)) {
anActor->SetPosition(theOffset);
- vw->highlight(thePrs->GetIO(), 1);
+ vw->highlight(thePrs->GetIO(), 1);
vw->getRenderer()->ResetCameraClippingRange();
vw->Repaint();
}
updateOffset(myPrsList.at(i), myOldOffsets[i].myOffset);
}
for (int i = 0; i < myPointMapList.count(); i++) {
- updatePointMapOffset(myPointMapList.at(i), myOldOffsets[i].myOffset);
+ updatePointMapOffset(myPointMapList.at(i), myOldPointMapOffsets[i].myOffset);
}
QDialog::reject();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DIALOGBOX_OFFSET_H
#define DIALOGBOX_OFFSET_H
#include <QList>
class QCheckBox;
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class VisuGUI;
class LightApp_SelectionMgr;
}
OffsetStruct(vtkFloatingPointType theX,
- vtkFloatingPointType theY,
- vtkFloatingPointType theZ)
+ vtkFloatingPointType theY,
+ vtkFloatingPointType theZ)
{
myOffset[0] = theX;
myOffset[1] = theY;
VisuGUI * myModule;
LightApp_SelectionMgr* mySelectionMgr;
- QtxDoubleSpinBox * myDxEdt;
- QtxDoubleSpinBox * myDyEdt;
- QtxDoubleSpinBox * myDzEdt;
+ SalomeApp_DoubleSpinBox * myDxEdt;
+ SalomeApp_DoubleSpinBox * myDyEdt;
+ SalomeApp_DoubleSpinBox * myDzEdt;
QCheckBox * mySaveChk;
QList<VISU::Prs3d_i*> myPrsList;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Panel.cxx
// Author : Oleg Uvarov
\brief Frame inserted in viewport with redefined sizeHint method
in order to avoid unreasonable increasing of viewport size
*/
-class VisuGUI_Panel::MainFrame : public QFrame
+class VisuGUI_Panel::MainFrame : public QWidget
{
public:
/*!
\param theParent parent widget
*/
MainFrame( QWidget* theParent = 0 )
- : QFrame( theParent )
+ : QWidget( theParent )
{
}
/*!
\brief Constructor creates panels look and feel
- \param theName name of the panel
+ \param theName panel title
+ \param theModule parent VISU GUI module
\param theParent parent widget
+ \param theBtns panel buttons
*/
-VisuGUI_Panel::VisuGUI_Panel( const QString& theName,
- const VisuGUI* theModule,
- QWidget* theParent,
- const int theBtns )
- : QtxDockWidget( theName, theParent ),
+VisuGUI_Panel::VisuGUI_Panel( const QString& theName,
+ VisuGUI* theModule,
+ QWidget* theParent,
+ const int theBtns )
+ : QtxDockWidget( true, theParent ),
myModule( theModule ),
myOK( 0 ),
myApply( 0 ),
myClose( 0 ),
myHelp( 0 )
{
+ setObjectName( theName );
+
QWidget* aGrp = new QWidget( this );
setWidget( aGrp );
// Create scroll view
myView = new QScrollArea( aGrp );
+ myView->setFrameStyle( QFrame::Plain | QFrame::NoFrame );
// Create main frame
myMainFrame = new MainFrame( myView );
- myMainFrame->setFrameStyle( QFrame::Plain | QFrame::NoFrame );
myView->setWidget( myMainFrame );
myView->setAlignment( Qt::AlignCenter );
myView->setMinimumWidth( myMainFrame->sizeHint().width() + 22 );
// Create buttons
- QWidget* aBtnWg = new QWidget( aGrp );
- QHBoxLayout* aBtnWgLayout = new QHBoxLayout( aBtnWg );
+ QHBoxLayout* aBtnWgLayout = new QHBoxLayout;
+ aBtnWgLayout->setMargin( 0 );
aBtnWgLayout->addStretch();
if( theBtns & OKBtn )
{
- myOK = new QPushButton( tr( "BUT_OK" ), aBtnWg );
+ myOK = new QPushButton( tr( "BUT_OK" ), aGrp );
aBtnWgLayout->addWidget( myOK );
connect( myOK, SIGNAL( clicked() ), SLOT( onOK() ) );
}
if( theBtns & ApplyBtn )
{
- myApply = new QPushButton( tr( "BUT_APPLY" ), aBtnWg );
+ myApply = new QPushButton( tr( "BUT_APPLY" ), aGrp );
aBtnWgLayout->addWidget( myApply );
connect( myApply, SIGNAL( clicked() ), SLOT( onApply() ) );
}
if( theBtns & CloseBtn )
{
- myClose = new QPushButton( tr( "BUT_CLOSE" ), aBtnWg );
+ myClose = new QPushButton( tr( "BUT_CLOSE" ), aGrp );
aBtnWgLayout->addWidget( myClose );
connect( myClose, SIGNAL( clicked() ), SLOT( onClose() ) );
}
if( theBtns & HelpBtn )
{
- myHelp = new QPushButton( tr( "BUT_HELP" ), aBtnWg );
+ myHelp = new QPushButton( tr( "BUT_HELP" ), aGrp );
aBtnWgLayout->addWidget( myHelp );
connect( myHelp, SIGNAL( clicked() ), SLOT( onHelp() ) );
}
// fill layout
QVBoxLayout* aLay = new QVBoxLayout( aGrp );
- aLay->setContentsMargins( 0, 0, 0, 0 );
+ aLay->setMargin( 2 );
aLay->addWidget( myView, 1 );
- aLay->addWidget( aBtnWg );
+ aLay->addLayout( aBtnWgLayout );
+
+ connect( theModule, SIGNAL( moduleDeactivated() ), SLOT( onModuleDeactivated() ) );
+ connect( theModule, SIGNAL( moduleActivated() ), SLOT( onModuleActivated() ) );
}
/*!
{
if ( myClose )
myClose->setFocus();
+ hide();
}
/*!
panels should use it as parent
\return QFrame* object
*/
-QFrame* VisuGUI_Panel::mainFrame()
+QWidget* VisuGUI_Panel::mainFrame()
{
return myMainFrame;
}
+
+void VisuGUI_Panel::onModuleActivated()
+{
+ widget()->setHidden( false );
+}
+
+void VisuGUI_Panel::onModuleDeactivated()
+{
+ widget()->setHidden( true );
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Panel.cxx
// Author : Oleg Uvarov
#include <QtxDockWidget.h>
-class QFrame;
class QScrollArea;
class QPushButton;
public:
VisuGUI_Panel( const QString& theName,
- const VisuGUI* theModule,
- QWidget* theParent,
- const int theBtns = AllBtn );
+ VisuGUI* theModule,
+ QWidget* theParent = 0,
+ const int theBtns = AllBtn );
virtual ~VisuGUI_Panel();
virtual bool isValid( QString& theMessage );
virtual void onClose();
virtual void onHelp();
+ virtual void onModuleActivated();
+ virtual void onModuleDeactivated();
+
protected:
- QFrame* mainFrame();
+ QWidget* mainFrame();
protected:
QScrollArea* myView;
- QFrame* myMainFrame;
+ QWidget* myMainFrame;
QPushButton* myOK;
QPushButton* myApply;
QPushButton* myClose;
QPushButton* myHelp;
- const VisuGUI* myModule;
+ VisuGUI* myModule;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Plot3DDlg.cxx
// Author : Laurent CORNABE & Hubert ROLLAND
// Module : VISU
-// $Header$
-//
+
#include "VisuGUI_Plot3DDlg.h"
#include "VisuGUI.h"
#include "SUIT_MessageBox.h"
#include "SUIT_ResourceMgr.h"
#include "LightApp_Application.h"
-
-#include "QtxDoubleSpinBox.h"
+#include <SalomeApp_IntSpinBox.h>
+#include <SalomeApp_DoubleSpinBox.h>
#include <QLayout>
#include <QValidator>
#include <QTabWidget>
#include <QRadioButton>
-#include <QSpinBox>
#include <QCheckBox>
#include <QVBoxLayout>
#include <QHBoxLayout>
LabelRot1 = new QLabel (tr("ROTATION_X"), GBrot );
GBrotLayout->addWidget(LabelRot1, 0, 0);
// spin 1
- Rot1 = new QtxDoubleSpinBox (-180, 180, 5, GBrot);
+ Rot1 = new SalomeApp_DoubleSpinBox (GBrot);
+ VISU::initSpinBox( Rot1, -180, 180, 5, "angle_precision" );
Rot1->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
GBrotLayout->addWidget(Rot1, 0, 1);
// label 2
LabelRot2 = new QLabel (tr("ROTATION_Y"), GBrot);
GBrotLayout->addWidget(LabelRot2, 1, 0);
// spin 2
- Rot2 = new QtxDoubleSpinBox (-180, 180, 5, GBrot);
+ Rot2 = new SalomeApp_DoubleSpinBox (GBrot);
+ VISU::initSpinBox( Rot2, -180, 180, 5, "angle_precision" );
Rot2->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
GBrotLayout->addWidget(Rot2, 1, 1);
QLabel * valueLabel = new QLabel (tr("POSITION_VALUE"), GBpos);
GBposLayout->addWidget(valueLabel, 0, 0);
// value spin
- PositionSpn = new QtxDoubleSpinBox (0, 1, 0.1, GBpos);
+ PositionSpn = new SalomeApp_DoubleSpinBox (GBpos);
+ VISU::initSpinBox( PositionSpn, 0, 1, 0.1, "parametric_precision" );
GBposLayout->addWidget(PositionSpn, 0, 1);
// Relative CheckBox
RelativeChkB = new QCheckBox (tr("RELATIVE"), GBpos);
bottomLayout->setMargin(0);
// scale
QLabel* scaleLabel = new QLabel (tr("SCALE"), bottomFrame);
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
- ScaleSpn = new QtxDoubleSpinBox (-1.e38, 1.e38, 0.1, aPrecision*(-1), 38, bottomFrame);
+ ScaleSpn = new SalomeApp_DoubleSpinBox (bottomFrame);
+ VISU::initSpinBox( ScaleSpn, -1.e38, 1.e38, 0.1, "visual_data_precision" );
// Presentation type
GBPrsType = new QButtonGroup ( bottomFrame);
QGroupBox* aGB = new QGroupBox (tr("PRESENTATION_TYPE"), bottomFrame);
GBPrsType->addButton( aRB, 1 );
// nb Contours
QLabel* nbContLabel = new QLabel (tr("NUMBER_CONTOURS"), bottomFrame);
- NbContoursSpn = new QSpinBox ( bottomFrame );
+ NbContoursSpn = new SalomeApp_IntSpinBox ( bottomFrame );
+ NbContoursSpn->setAcceptNames( false );
NbContoursSpn->setMinimum( 1 );
NbContoursSpn->setMaximum( 999 );
NbContoursSpn->setSingleStep( 1 );
GBOrientation->button(id)->click();
// rotation
- Rot1->setValue(thePrs->GetRotateX() * 180./PI);
- Rot2->setValue(thePrs->GetRotateY() * 180./PI);
+ Rot1->setValue(thePrs->GetRotateX() * 180./M_PI);
+ Rot2->setValue(thePrs->GetRotateY() * 180./M_PI);
// position
RelativeChkB->setChecked(thePrs->IsPositionRelative());
default: ori = VISU::Plot3D::ZX;
}
// rotation
- thePrs->SetOrientation(ori, Rot1->value()*PI/180., Rot2->value()*PI/180.);
+ thePrs->SetOrientation(ori, Rot1->value()*M_PI/180., Rot2->value()*M_PI/180.);
// position
thePrs->SetPlanePosition(PositionSpn->value(), RelativeChkB->isChecked());
// Set rotation
- Rot1->setValue(theXRotation * 180./PI);
+ Rot1->setValue(theXRotation * 180./M_PI);
Rot1->setEnabled(false);
- Rot2->setValue(theYRotation * 180./PI);
+ Rot2->setValue(theYRotation * 180./M_PI);
Rot2->setEnabled(false);
// Set position
//purpose :
//=======================================================================
void VisuGUI_Plot3DDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TPLOT3D>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Plot3DDlg.h
// Author : Laurent CORNABE & Hubert ROLLAND
class QGroupBox;
class SalomeApp_Module;
+class SalomeApp_IntSpinBox;
+
class VisuGUI_InputPane;
+class SalomeApp_DoubleSpinBox;
namespace VISU
{
class VISU_Plot3DPL;
class SVTK_ViewWindow;
class SALOME_Actor;
-class QtxDoubleSpinBox;
class VisuGUI_Plot3DPane : public QWidget//QVBox
{
QGroupBox * GBoxOrient;
QLabel * LabelRot1;
QLabel * LabelRot2;
- QtxDoubleSpinBox * Rot1;
- QtxDoubleSpinBox * Rot2;
- QtxDoubleSpinBox * PositionSpn;
+ SalomeApp_DoubleSpinBox * Rot1;
+ SalomeApp_DoubleSpinBox * Rot2;
+ SalomeApp_DoubleSpinBox * PositionSpn;
QCheckBox * RelativeChkB;
- QtxDoubleSpinBox * ScaleSpn;
+ SalomeApp_DoubleSpinBox * ScaleSpn;
QButtonGroup * GBPrsType;
- QSpinBox * NbContoursSpn;
+ SalomeApp_IntSpinBox * NbContoursSpn;
QCheckBox * PreviewChkB;
private slots:
~VisuGUI_Plot3DDlg();
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// VISU VISUGUI : GUI of VISU component
+// File : VisuGUI_PrimitiveBox.cxx
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#include "VisuGUI_PrimitiveBox.h"
+#include "VisuGUI_Tools.h"
+
+#include <VISU_OpenGLPointSpriteMapper.hxx>
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
+#include <SalomeApp_DoubleSpinBox.h>
+#include <SalomeApp_IntSpinBox.h>
+
+#include <QLayout>
+#include <QLabel>
+#include <QLineEdit>
+#include <QButtonGroup>
+#include <QRadioButton>
+#include <QPushButton>
+#include <QFileDialog>
+
+#include <iostream>
+
+using namespace std;
+
+VisuGUI_PrimitiveBox::VisuGUI_PrimitiveBox( QWidget* parent ) :
+ QGroupBox( parent )
+{
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+
+ setTitle( tr( "PRIMITIVE_TITLE" ) );
+ //setColumnLayout(0, Qt::Vertical );
+ //layout()->setSpacing( 0 );
+ //layout()->setMargin( 0 );
+
+ QGridLayout* aLayout = new QGridLayout( this );
+ aLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+ aLayout->setSpacing(6);
+ aLayout->setMargin(11);
+
+ myPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
+
+ QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/";
+ myMainTexture = aRootDir + "sprite_texture.bmp";
+ myAlphaTexture = aRootDir + "sprite_alpha.bmp";
+
+ // Primitive Type
+ QGroupBox* aPrimitiveTypeGroup = new QGroupBox( this );
+ aPrimitiveTypeGroup->setMinimumWidth( 450 );
+ QHBoxLayout* aPrimLayout = new QHBoxLayout( aPrimitiveTypeGroup );
+ aPrimLayout->setMargin( 0 );
+
+ //QButtonGroup* aPrimitiveTypeGroup = new QButtonGroup( 3, Qt::Horizontal, this, "PrimitiveTypeGroup" );
+ //aPrimitiveTypeGroup->setMinimumWidth( 450 );
+ //aPrimitiveTypeGroup->setRadioButtonExclusive( true );
+ //aPrimitiveTypeGroup->setFrameStyle( QFrame::NoFrame );
+ //aPrimitiveTypeGroup->layout()->setMargin( 0 );
+
+ myPointSpriteButton = new QRadioButton( tr( "POINT_SPRITE" ), aPrimitiveTypeGroup );
+ myOpenGLPointButton = new QRadioButton( tr( "OPENGL_POINT" ), aPrimitiveTypeGroup );
+ myGeomSphereButton = new QRadioButton( tr( "GEOMETRICAL_SPHERE" ), aPrimitiveTypeGroup );
+
+ aPrimLayout->addWidget( myPointSpriteButton );
+ aPrimLayout->addWidget( myOpenGLPointButton );
+ aPrimLayout->addWidget( myGeomSphereButton );
+
+ aLayout->addWidget( aPrimitiveTypeGroup, 0, 0, 1, 2 );
+
+ // Clamp ( Point Sprite & OpenGL Point )
+ myClampLabel = new QLabel( tr( "CLAMP" ), this );
+ myClampSpinBox = new SalomeApp_DoubleSpinBox( this );
+ VISU::initSpinBox( myClampSpinBox, 1.0, 512.0, 1.0, "parametric_precision" );
+ myClampSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ aLayout->addWidget( myClampLabel, 1, 0 );
+ aLayout->addWidget( myClampSpinBox, 1, 1, 1, 2 );
+
+ // Main Texture ( Point Sprite )
+ myMainTextureLabel = new QLabel( tr( "MAIN_TEXTURE" ), this );
+ myMainTextureLineEdit = new QLineEdit( this );
+ myMainTextureButton = new QPushButton( this );
+ myMainTextureButton->setAutoDefault( false );
+ myMainTextureButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) );
+ connect( myMainTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseMainTexture() ) );
+
+ aLayout->addWidget( myMainTextureLabel, 2, 0 );
+ aLayout->addWidget( myMainTextureLineEdit, 2, 1 );
+ aLayout->addWidget( myMainTextureButton, 2, 2 );
+
+ // Alpha Texture ( Point Sprite )
+ myAlphaTextureLabel = new QLabel( tr( "ALPHA_TEXTURE" ), this );
+ myAlphaTextureLineEdit = new QLineEdit( this );
+ myAlphaTextureButton = new QPushButton( this );
+ myAlphaTextureButton->setAutoDefault( false );
+ myAlphaTextureButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) );
+ connect( myAlphaTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseAlphaTexture() ) );
+
+ aLayout->addWidget( myAlphaTextureLabel, 3, 0 );
+ aLayout->addWidget( myAlphaTextureLineEdit, 3, 1 );
+ aLayout->addWidget( myAlphaTextureButton, 3, 2 );
+
+ // Alpha Threshold ( Point Sprite )
+ myAlphaThresholdLabel = new QLabel( tr( "ALPHA_THRESHOLD" ), this );
+ myAlphaThresholdSpinBox = new SalomeApp_DoubleSpinBox( this );
+ VISU::initSpinBox( myAlphaThresholdSpinBox, 0.0, 1.0, 0.1, "parametric_precision" );
+ myAlphaThresholdSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ aLayout->addWidget( myAlphaThresholdLabel, 4, 0 );
+ aLayout->addWidget( myAlphaThresholdSpinBox, 4, 1, 1, 2 );
+
+ // Resolution ( Geometrical Sphere )
+ myResolutionLabel = new QLabel( tr( "RESOLUTION" ), this );
+ myResolutionSpinBox = new SalomeApp_IntSpinBox( this );
+ VISU::initSpinBox( myResolutionSpinBox, 3, 100, 1 );
+ myResolutionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ connect( myResolutionSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( onResolutionChanged( int ) ) );
+
+ aLayout->addWidget( myResolutionLabel, 5, 0 );
+ aLayout->addWidget( myResolutionSpinBox, 5, 1, 1, 2 );
+
+ // Number of faces ( Geometrical Sphere )
+ myFaceNumberLabel = new QLabel( tr( "FACE_NUMBER" ), this );
+ myFaceNumberLineEdit = new QLineEdit( this );
+ myFaceNumberLineEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ myFaceNumberLineEdit->setEnabled( false );
+ //myFaceNumberLineEdit->setReadOnly( true );
+
+ aLayout->addWidget( myFaceNumberLabel, 6, 0 );
+ aLayout->addWidget( myFaceNumberLineEdit, 6, 1, 1, 2 );
+
+ // Notification ( Geometrical Sphere )
+ myFaceLimitLabel = new QLabel( tr( "FACE_LIMIT" ), this );
+ myFaceLimitSpinBox = new SalomeApp_IntSpinBox( this );
+ VISU::initSpinBox( myFaceLimitSpinBox, 10, 1000000, 10 );
+ myFaceLimitSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ aLayout->addWidget( myFaceLimitLabel, 7, 0 );
+ aLayout->addWidget( myFaceLimitSpinBox, 7, 1, 1, 2 );
+
+ connect( myPointSpriteButton, SIGNAL( clicked() ), this, SLOT( onTogglePointSprite() ) );
+ connect( myOpenGLPointButton, SIGNAL( clicked() ), this, SLOT( onToggleOpenGLPoint() ) );
+ connect( myGeomSphereButton, SIGNAL( clicked() ), this, SLOT( onToggleGeomSphere() ) );
+}
+
+void VisuGUI_PrimitiveBox::onTogglePointSprite()
+{
+ myPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
+
+ myClampLabel->show();
+ myClampSpinBox->show();
+
+ myMainTextureLabel->show();
+ myMainTextureLineEdit->show();
+ myMainTextureButton->show();
+
+ myAlphaTextureLabel->show();
+ myAlphaTextureLineEdit->show();
+ myAlphaTextureButton->show();
+
+ myAlphaThresholdLabel->show();
+ myAlphaThresholdSpinBox->show();
+
+ myResolutionLabel->hide();
+ myResolutionSpinBox->hide();
+
+ myFaceNumberLabel->hide();
+ myFaceNumberLineEdit->hide();
+
+ myFaceLimitLabel->hide();
+ myFaceLimitSpinBox->hide();
+}
+
+void VisuGUI_PrimitiveBox::onToggleOpenGLPoint()
+{
+ myPrimitiveType = VISU_OpenGLPointSpriteMapper::OpenGLPoint;
+
+ myClampLabel->show();
+ myClampSpinBox->show();
+
+ myMainTextureLabel->hide();
+ myMainTextureLineEdit->hide();
+ myMainTextureButton->hide();
+
+ myAlphaTextureLabel->hide();
+ myAlphaTextureLineEdit->hide();
+ myAlphaTextureButton->hide();
+
+ myAlphaThresholdLabel->hide();
+ myAlphaThresholdSpinBox->hide();
+
+ myResolutionLabel->hide();
+ myResolutionSpinBox->hide();
+
+ myFaceNumberLabel->hide();
+ myFaceNumberLineEdit->hide();
+
+ myFaceLimitLabel->hide();
+ myFaceLimitSpinBox->hide();
+}
+
+void VisuGUI_PrimitiveBox::onToggleGeomSphere()
+{
+ myPrimitiveType = VISU_OpenGLPointSpriteMapper::GeomSphere;
+
+ myClampLabel->hide();
+ myClampSpinBox->hide();
+
+ myMainTextureLabel->hide();
+ myMainTextureLineEdit->hide();
+ myMainTextureButton->hide();
+
+ myAlphaTextureLabel->hide();
+ myAlphaTextureLineEdit->hide();
+ myAlphaTextureButton->hide();
+
+ myAlphaThresholdLabel->hide();
+ myAlphaThresholdSpinBox->hide();
+
+ myResolutionLabel->show();
+ myResolutionSpinBox->show();
+
+ myFaceNumberLabel->show();
+ myFaceNumberLineEdit->show();
+
+ myFaceLimitLabel->show();
+ myFaceLimitSpinBox->show();
+}
+
+void VisuGUI_PrimitiveBox::onResolutionChanged( int theResolution )
+{
+ setFaceNumber( 2 * theResolution * ( theResolution - 2 ) );
+}
+
+void VisuGUI_PrimitiveBox::setPrimitiveType( int theType )
+{
+ myPrimitiveType = theType;
+
+ switch( myPrimitiveType )
+ {
+ case VISU_OpenGLPointSpriteMapper::PointSprite :
+ myPointSpriteButton->setChecked( true );
+ onTogglePointSprite();
+ break;
+ case VISU_OpenGLPointSpriteMapper::OpenGLPoint :
+ myOpenGLPointButton->setChecked( true );
+ onToggleOpenGLPoint();
+ break;
+ case VISU_OpenGLPointSpriteMapper::GeomSphere :
+ myGeomSphereButton->setChecked( true );
+ onToggleGeomSphere();
+ break;
+ default : break;
+ }
+}
+
+float VisuGUI_PrimitiveBox::getClamp() const
+{
+ return myClampSpinBox->value();
+}
+
+void VisuGUI_PrimitiveBox::setClamp( float theClamp )
+{
+ myClampSpinBox->setValue( theClamp );
+}
+
+void VisuGUI_PrimitiveBox::setClampMaximum( float theClampMaximum )
+{
+ myClampSpinBox->setMaximum( theClampMaximum );
+}
+
+void VisuGUI_PrimitiveBox::setMainTexture( const QString& theMainTexture )
+{
+ myMainTexture = theMainTexture;
+ myMainTextureLineEdit->setText( theMainTexture.section( '/', -1 ) );
+}
+
+void VisuGUI_PrimitiveBox::setAlphaTexture( const QString& theAlphaTexture )
+{
+ myAlphaTexture = theAlphaTexture;
+ myAlphaTextureLineEdit->setText( theAlphaTexture.section( '/', -1 ) );
+}
+
+float VisuGUI_PrimitiveBox::getAlphaThreshold() const
+{
+ return myAlphaThresholdSpinBox->value();
+}
+
+void VisuGUI_PrimitiveBox::setAlphaThreshold( float theAlphaThreshold )
+{
+ myAlphaThresholdSpinBox->setValue( theAlphaThreshold );
+}
+
+int VisuGUI_PrimitiveBox::getResolution() const
+{
+ return myResolutionSpinBox->value();
+}
+
+void VisuGUI_PrimitiveBox::setResolution( int theResolution )
+{
+ myResolutionSpinBox->setValue( theResolution );
+}
+
+int VisuGUI_PrimitiveBox::getFaceNumber() const
+{
+ int aResolution = getResolution();
+ return 2 * aResolution * ( aResolution - 2 );
+ //return myFaceNumberLineEdit->text().toInt();
+}
+
+void VisuGUI_PrimitiveBox::setFaceNumber( int theFaceNumber )
+{
+ myFaceNumberLineEdit->setText( QString::number( theFaceNumber ) );
+}
+
+int VisuGUI_PrimitiveBox::getFaceLimit() const
+{
+ return myFaceLimitSpinBox->value();
+}
+
+void VisuGUI_PrimitiveBox::setFaceLimit( int theFaceLimit )
+{
+ myFaceLimitSpinBox->setValue( theFaceLimit );
+}
+
+void VisuGUI_PrimitiveBox::onBrowseMainTexture()
+{
+ QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/";
+ QString aFileName = QFileDialog::getOpenFileName( this,
+ 0,
+ aRootDir,
+ "Bitmap (*.bmp *.jpg *.png)" );
+
+ if( aFileName.isNull() )
+ return;
+
+ myMainTexture = aFileName;
+ myMainTextureLineEdit->setText( aFileName.section( '/', -1 ) );
+}
+
+void VisuGUI_PrimitiveBox::onBrowseAlphaTexture()
+{
+ QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/";
+ QString aFileName = QFileDialog::getOpenFileName( this,
+ 0,
+ aRootDir,
+ "Bitmap (*.bmp *.jpg *.png)" );
+
+ if( aFileName.isNull() )
+ return;
+
+ myAlphaTexture = aFileName;
+ myAlphaTextureLineEdit->setText( aFileName.section( '/', -1 ) );
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// VISU VISUGUI : GUI of VISU component
+// File : VisuGUI_PrimitiveBox.h
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#ifndef VISUGUI_PRIMITIVEBOX_H
+#define VISUGUI_PRIMITIVEBOX_H
+
+#include <QGroupBox>
+
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QRadioButton;
+
+class SalomeApp_DoubleSpinBox;
+class SalomeApp_IntSpinBox;
+
+class VisuGUI_PrimitiveBox : public QGroupBox
+{
+ Q_OBJECT
+
+public:
+ VisuGUI_PrimitiveBox( QWidget* );
+ ~VisuGUI_PrimitiveBox() {}
+
+public:
+ int getPrimitiveType() const { return myPrimitiveType; }
+ void setPrimitiveType( int );
+
+ float getClamp() const;
+ void setClamp( float );
+ void setClampMaximum( float );
+
+ QString getMainTexture() const { return myMainTexture; }
+ void setMainTexture( const QString& );
+
+ QString getAlphaTexture() const { return myAlphaTexture; }
+ void setAlphaTexture( const QString& );
+
+ float getAlphaThreshold() const;
+ void setAlphaThreshold( float );
+
+ int getResolution() const;
+ void setResolution( int );
+
+ int getFaceNumber() const;
+ void setFaceNumber( int );
+
+ int getFaceLimit() const;
+ void setFaceLimit( int );
+
+protected slots:
+ void onTogglePointSprite();
+ void onToggleOpenGLPoint();
+ void onToggleGeomSphere();
+
+ void onBrowseMainTexture();
+ void onBrowseAlphaTexture();
+
+ void onResolutionChanged( int );
+
+private:
+ int myPrimitiveType;
+
+ QRadioButton* myPointSpriteButton;
+ QRadioButton* myOpenGLPointButton;
+ QRadioButton* myGeomSphereButton;
+
+ QString myMainTexture;
+ QString myAlphaTexture;
+
+ QLabel* myClampLabel;
+ SalomeApp_DoubleSpinBox* myClampSpinBox;
+
+ QLabel* myMainTextureLabel;
+ QLineEdit* myMainTextureLineEdit;
+ QPushButton* myMainTextureButton;
+
+ QLabel* myAlphaTextureLabel;
+ QLineEdit* myAlphaTextureLineEdit;
+ QPushButton* myAlphaTextureButton;
+
+ QLabel* myAlphaThresholdLabel;
+ SalomeApp_DoubleSpinBox* myAlphaThresholdSpinBox;
+
+ QLabel* myResolutionLabel;
+ SalomeApp_IntSpinBox* myResolutionSpinBox;
+
+ QLabel* myFaceNumberLabel;
+ QLineEdit* myFaceNumberLineEdit;
+
+ QLabel* myFaceLimitLabel;
+ SalomeApp_IntSpinBox* myFaceLimitSpinBox;
+};
+
+
+
+#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Prs3dDlg.cxx
// Author : Laurent CORNABE & Hubert ROLLAND
#include "VISUConfig.hh"
#include "VISU_Convertor.hxx"
+#include "VISU_MeshValue.hxx"
+#include "VISU_Structures_impl.hxx"
#include "VISU_ScalarMapPL.hxx"
#include "VISU_ScalarBarActor.hxx"
#include "VISU_ScalarMapAct.h"
#include "VISU_Result_i.hh"
#include "VISU_Prs3dUtils.hh"
+#include <SalomeApp_IntSpinBox.h>
+#include <SalomeApp_DoubleSpinBox.h>
#include "LightApp_Application.h"
#include "SUIT_Session.h"
#include <QKeyEvent>
#include <QGridLayout>
-#include "QtxDoubleSpinBox.h"
-
#include <vtkTextProperty.h>
-#include <limits.h>
-
-using namespace std;
+#include <limits>
//-----------------------------------------------------------------------
// Text Preferences Dialog
QGroupBox* aTitleGrp = new QGroupBox ( tr("LBL_TITLE"), this);
QVBoxLayout* aVBLay = new QVBoxLayout( aTitleGrp );
- // edit line
+ // edit line
myTitleEdt = new QLineEdit (aTitleGrp);
aVBLay->addWidget( myTitleEdt);
aHBLay->setSpacing(5);
myTitleFont = new SVTK_FontWidget (aHBox);
+ myTitleFont->Initialize();
aHBLay->addWidget( myTitleFont );
aMainLay->addWidget(aTitleGrp);
aHBLay = new QHBoxLayout( aHBox );
aHBLay->setSpacing(5);
-
+
myLabelFont = new SVTK_FontWidget (aHBox);
+ myLabelFont->Initialize();
aHBLay->addWidget( myLabelFont );
aMainLay->addWidget(aLabelsGrp);
else {
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ "application")).arg(aHelpFileName),
QObject::tr("BUT_OK"));
}
}
aMainLay->setMargin( 5 );
// dimensions
-
+
QGroupBox* aDimGrp = new QGroupBox( this );
QGridLayout* aDimGrpLay = new QGridLayout( aDimGrp );
aDimGrpLay->setSpacing( 5 );
aDimGrpLay->setMargin( 5 );
- myTitleSizeSpin = new QSpinBox( aDimGrp );
+ myTitleSizeSpin = new SalomeApp_IntSpinBox( aDimGrp );
+ myTitleSizeSpin->setAcceptNames( false );
myTitleSizeSpin->setRange( 0, 100 );
myTitleSizeSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myTitleSizeSpin->setMinimumWidth( 70 );
myTitleSizeSpin->setValue( 0 );
myTitleSizeSpin->setSpecialValueText( tr( "AUTO" ) );
QLabel* aTitleSizeLbl = new QLabel( tr( "LBL_TITLE_W" ), aDimGrp );
-
- myLabelSizeSpin = new QSpinBox( aDimGrp );
+
+ myLabelSizeSpin = new SalomeApp_IntSpinBox( aDimGrp );
+ myLabelSizeSpin->setAcceptNames( false );
myLabelSizeSpin->setRange( 0, 100 );
myLabelSizeSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myLabelSizeSpin->setMinimumWidth( 70 );
myLabelSizeSpin->setValue( 0 );
myLabelSizeSpin->setSpecialValueText( tr( "AUTO" ) );
QLabel* aLabelSizeLbl = new QLabel( tr( "LBL_LABEL_W" ), aDimGrp );
-
- myBarWidthSpin = new QSpinBox( aDimGrp );
+
+ myBarWidthSpin = new SalomeApp_IntSpinBox( aDimGrp );
+ myBarWidthSpin->setAcceptNames( false );
myBarWidthSpin->setRange( 0, 100 );
myBarWidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myBarWidthSpin->setMinimumWidth( 70 );
myBarWidthSpin->setValue( 0 );
myBarWidthSpin->setSpecialValueText( tr( "AUTO" ) );
QLabel* aBarWidthLbl = new QLabel( tr( "LBL_BAR_W" ), aDimGrp );
-
- myBarHeightSpin = new QSpinBox( aDimGrp );
+
+ myBarHeightSpin = new SalomeApp_IntSpinBox( aDimGrp );
+ myBarHeightSpin->setAcceptNames( false );
myBarHeightSpin->setRange( 0, 100 );
myBarHeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myBarHeightSpin->setMinimumWidth( 70 );
// format and units
QLabel* aPrecLbl = new QLabel( tr( "PRECISION" ), aDimGrp );
- myPrecisionSpin = new QSpinBox( aDimGrp );
+ myPrecisionSpin = new SalomeApp_IntSpinBox( aDimGrp );
+ myPrecisionSpin->setAcceptNames( false );
myPrecisionSpin->setRange( 1, 100 );
-
+
myUnitsChk = new QCheckBox( tr( "LBL_SHOW_UNITS" ), aDimGrp );
-
+
// layout
-
+
aDimGrpLay->addWidget( aTitleSizeLbl, 0, 0 );
aDimGrpLay->addWidget( myTitleSizeSpin, 0, 1 );
aDimGrpLay->addWidget( aLabelSizeLbl, 0, 2 );
aDimGrpLay->addWidget( aPrecLbl, 2, 0 );
aDimGrpLay->addWidget( myPrecisionSpin, 2, 1 );
aDimGrpLay->addWidget( myUnitsChk, 2, 2, 1, 2 );
-
+
aMainLay->addWidget( aDimGrp );
// Common buttons ===========================================================
//----------------------------------------------------------------------------
void VisuGUI_BarPrefDlg::setRatios( int titleRatioSize, int labelRatioWidth,
- int barRatioWidth, int barRatioHeight )
+ int barRatioWidth, int barRatioHeight )
{
myTitleSizeSpin->setValue( myTitleSize = titleRatioSize );
myLabelSizeSpin->setValue( myLabelSize = labelRatioWidth );
//----------------------------------------------------------------------------
void VisuGUI_BarPrefDlg::getRatios( int& titleRatioSize, int& labelRatioWidth,
- int& barRatioWidth, int& barRatioHeight )
+ int& barRatioWidth, int& barRatioHeight )
{
titleRatioSize = myTitleSizeSpin->value();
labelRatioWidth = myLabelSizeSpin->value();
}
else {
SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ),
- tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
- arg( app->resourceMgr()->stringValue( "ExternalBrowser",
- "application" ) ).
- arg( aHelpFileName ) );
+ tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser",
+ "application" ) ).
+ arg( aHelpFileName ) );
}
}
{
QString dVal;
int aBWH = myOrientation == 1 ? myBarWidthSpin->value() : myBarHeightSpin->value();
- if( ( myLabelSizeSpin->value()+ aBWH ) > 100 )
+ if( ( myLabelSizeSpin->value()+ aBWH ) > 100 )
{
SUIT_MessageBox::warning( this, tr( "WRN_VISU" ), tr( "MSG_BIG_SCALE" ) );
return;
- }
-
+ }
+
if ( myTitleSizeSpin->value() > 100 )
{
SUIT_MessageBox::warning( this, tr( "WRN_VISU" ), tr( "MSG_BIG_SCALE_TLT" ) );
return;
}
-
+
myTitleSize = myTitleSizeSpin->value();
myLabelSize = myLabelSizeSpin->value();
myBarWidth = myBarWidthSpin->value();
/*!
Constructor
*/
-VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane( QWidget* parent, bool thePreview )
- : QWidget( parent ),
+VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane( QWidget* parent, bool theIsDisplayGaussMetric, bool thePreview )
+ : QWidget( parent ),
myPreviewActor( 0 ),
myScalarMap( 0 ),
- myScalarMapPL( 0 )
+ myScalarMapPL( 0 ),
+ myIsDisplayGaussMetric( theIsDisplayGaussMetric )
{
QVBoxLayout* aMainLayout = new QVBoxLayout( this );
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
myVerLS = aResourceMgr->integerValue("VISU", propertyName + "label_size", 0);
myVerBW = aResourceMgr->integerValue("VISU", propertyName + "bar_width", 0);
myVerBH = aResourceMgr->integerValue("VISU", propertyName + "bar_height",0);
-
+
propertyName = QString("scalar_bar_horizontal_");
myHorX = aResourceMgr->doubleValue("VISU", propertyName + "x", 0.);
myHorY = aResourceMgr->doubleValue("VISU", propertyName + "y", 0.);
//RangeGroupLayout->setSpacing( 6 );
//RangeGroupLayout->setMargin( 11 );
- myModeLbl = new QLabel("Scalar Mode", aGB);
+ myModeLbl = new QLabel(tr("SCALAR_MODE"), aGB);
myModeCombo = new QComboBox(aGB);
CBLog = new QCheckBox (tr("LOGARITHMIC_SCALING"), aGB);
CBLog->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ myGaussMetricLabel = new QLabel( tr("VISU_GAUSS_METRIC"), aGB );
+ myGaussMetric = new QComboBox( aGB );
+ myGaussMetric->addItem( tr("VISU_GAUSS_METRIC_AVERAGE") );
+ myGaussMetric->addItem( tr("VISU_GAUSS_METRIC_MINIMUM") );
+ myGaussMetric->addItem( tr("VISU_GAUSS_METRIC_MAXIMUM") );
+ myGaussMetric->setToolTip( tr("VISU_GAUSS_METRIC_TOOLTIP") );
+
+ if( !myIsDisplayGaussMetric ) {
+ myGaussMetricLabel->hide();
+ myGaussMetric->hide();
+ }
+
RBFrange = new QRadioButton (tr("FIELD_RANGE_BTN"), aGB);
RBIrange = new QRadioButton (tr("IMPOSED_RANGE_BTN"), aGB);
RangeGroup->addButton( RBFrange, 0 );
RangeGroup->addButton( RBIrange, 1 );
RBFrange->setChecked( true );
+ int aPrecision = qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) );
+ QDoubleValidator* dv = new QDoubleValidator(this);
+ dv->setDecimals(aPrecision);
+
MinEdit = new QLineEdit( aGB );
MinEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//MinEdit->setMinimumWidth( 70 );
- MinEdit->setValidator( new QDoubleValidator(this) );
+ MinEdit->setValidator( dv );
MinEdit->setText( "0.0" );
QLabel* MinLabel = new QLabel (tr("LBL_MIN"), aGB);
MinLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
MaxEdit = new QLineEdit( aGB );
MaxEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//MaxEdit->setMinimumWidth( 70 );
- MaxEdit->setValidator( new QDoubleValidator(this) );
+ MaxEdit->setValidator( dv );
MaxEdit->setText( "0.0" );
QLabel* MaxLabel = new QLabel (tr("LBL_MAX"), aGB);
MaxLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
RangeGroupLayout->addWidget( myModeLbl, 0, 0, 1, 1 );
RangeGroupLayout->addWidget( myModeCombo, 0, 1, 1, 2);
RangeGroupLayout->addWidget( CBLog, 0, 3, 1, 1);
- RangeGroupLayout->addWidget( RBFrange, 1, 0, 1, 2);
- RangeGroupLayout->addWidget( RBIrange, 1, 2, 1, 2);
- RangeGroupLayout->addWidget( MinLabel, 2, 0 );
- RangeGroupLayout->addWidget( MinEdit, 2, 1 );
- RangeGroupLayout->addWidget( MaxLabel, 2, 2 );
- RangeGroupLayout->addWidget( MaxEdit, 2, 3 );
+ RangeGroupLayout->addWidget( myGaussMetricLabel, 1, 0, 1, 1);
+ RangeGroupLayout->addWidget( myGaussMetric, 1, 1, 1, 3);
+ RangeGroupLayout->addWidget( RBFrange, 2, 0, 1, 2);
+ RangeGroupLayout->addWidget( RBIrange, 2, 2, 1, 2);
+ RangeGroupLayout->addWidget( MinLabel, 3, 0 );
+ RangeGroupLayout->addWidget( MinEdit, 3, 1 );
+ RangeGroupLayout->addWidget( MaxLabel, 3, 2 );
+ RangeGroupLayout->addWidget( MaxEdit, 3, 3 );
// Colors and Labels ========================================================
QGroupBox* ColLabGroup = new QGroupBox (tr("COLORS_LABELS_GRP"), this);
//ColLabGroupLayout->setMargin( 11 );
QLabel* ColorLabel = new QLabel (tr("LBL_NB_COLORS"), ColLabGroup);
- ColorSpin = new QSpinBox( ColLabGroup );
+ ColorSpin = new SalomeApp_IntSpinBox( ColLabGroup );
+ ColorSpin->setAcceptNames( false );
ColorSpin->setMinimum( 2 );
ColorSpin->setMaximum( 256 );
ColorSpin->setSingleStep( 1 );
ColorSpin->setValue( 64 );
QLabel* LabelLabel = new QLabel (tr("LBL_NB_LABELS"), ColLabGroup);
- LabelSpin = new QSpinBox( ColLabGroup );
+ LabelSpin = new SalomeApp_IntSpinBox( ColLabGroup );
+ LabelSpin->setAcceptNames( false );
LabelSpin->setMinimum( 2 );
LabelSpin->setMaximum( 65 );
LabelSpin->setSingleStep( 1 );
-
+
LabelSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//LabelSpin->setMinimumWidth( 70 );
LabelSpin->setValue( 5 );
//OriginGroupLayout->setMargin( 11 );
QLabel* XLabel = new QLabel (tr("LBL_X"), OriginGroup);
- XSpin = new QtxDoubleSpinBox( OriginGroup );
- VISU::initSpinBox(XSpin, 0.0, +1.0);
+ XSpin = new SalomeApp_DoubleSpinBox( OriginGroup );
+ VISU::initSpinBox( XSpin, 0.0, +1.0, .1, "parametric_precision" );
XSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//XSpin->setMinimumWidth( 70 );
XSpin->setValue( 0.01 );
QLabel* YLabel = new QLabel (tr("LBL_Y"), OriginGroup);
- YSpin = new QtxDoubleSpinBox( OriginGroup );
- VISU::initSpinBox(YSpin, 0.0, +1.0);
+ YSpin = new SalomeApp_DoubleSpinBox( OriginGroup );
+ VISU::initSpinBox( YSpin, 0.0, +1.0, .1, "parametric_precision" );
YSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//YSpin->setMinimumWidth( 70 );
YSpin->setValue( 0.1 );
//DimGroupLayout->setMargin( 11 );
QLabel* WidthLabel = new QLabel (tr("LBL_WIDTH"), DimGroup);
- WidthSpin = new QtxDoubleSpinBox( DimGroup );
- VISU::initSpinBox(WidthSpin, 0.0, +1.0);
+ WidthSpin = new SalomeApp_DoubleSpinBox( DimGroup );
+ VISU::initSpinBox( WidthSpin, 0.0, +1.0, .1, "parametric_precision" );
WidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//WidthSpin->setMinimumWidth( 70 );
WidthSpin->setValue( 0.1 );
QLabel* HeightLabel = new QLabel (tr("LBL_HEIGHT"), DimGroup);
- HeightSpin = new QtxDoubleSpinBox( DimGroup );
- VISU::initSpinBox(HeightSpin, 0.0, +1.0);
+ HeightSpin = new SalomeApp_DoubleSpinBox( DimGroup );
+ VISU::initSpinBox( HeightSpin, 0.0, +1.0, .1, "parametric_precision" );
HeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
//HeightSpin->setMinimumWidth( 70 );
HeightSpin->setValue( 0.8 );
QWidget* aSaveBox = new QWidget(this);
aMainLayout->addWidget( aSaveBox );
QHBoxLayout* aVBLay = new QHBoxLayout( aSaveBox );
- aVBLay->addWidget( myTextBtn = new QPushButton("Text properties...", aSaveBox) );
- aVBLay->addWidget( myBarBtn = new QPushButton("Bar properties...", aSaveBox) );
-
+ aVBLay->addWidget( myTextBtn = new QPushButton(tr("Text properties..."), aSaveBox) );
+ aVBLay->addWidget( myBarBtn = new QPushButton(tr("Bar properties..."), aSaveBox) );
+
aMainLayout->addWidget( myTextDlg = new VisuGUI_TextPrefDlg(this) );
myTextDlg->setTitleVisible(!thePreview);
myBarDlg = new VisuGUI_BarPrefDlg(this);
aMainLayout->addWidget( CheckGroup );
//QHBoxLayout* CheckGroupLayout = new QHBoxLayout( CheckGroup );
QGridLayout* CheckGroupLayout = new QGridLayout( CheckGroup );
-
+
myPreviewCheck = new QCheckBox(tr("LBL_SHOW_PREVIEW"), CheckGroup);
myPreviewCheck->setChecked(false);
CheckGroupLayout->addWidget(myPreviewCheck, 0, 0);
-
+
myHideBar = new QCheckBox(tr("HIDE_SCALAR_BAR"), CheckGroup);
myHideBar->setChecked(false);
CheckGroupLayout->addWidget(myHideBar, 0, 1);
int lp = aResourceMgr->integerValue( "VISU", propertyName + "scalar_bar_label_precision", 3 );
myBarDlg->setLabelsPrecision( lp );
-
+
myBarDlg->setUnitsVisible(aResourceMgr->booleanValue("VISU", propertyName + "display_units", true));
// signals and slots connections ===========================================
connect( RBIrange, SIGNAL( toggled( bool ) ), this, SLOT( onImposedRange( bool ) ) );
connect( myModeCombo, SIGNAL( activated( int ) ), this, SLOT( changeScalarMode( int ) ) );
+ connect( myGaussMetric, SIGNAL( activated( int ) ), this, SLOT( changeGaussMetric( int ) ) );
connect( OrientGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( changeDefaults( int ) ) );
connect( XSpin, SIGNAL( valueChanged( double ) ), this, SLOT( XYChanged( double ) ) );
connect( YSpin, SIGNAL( valueChanged( double ) ), this, SLOT( XYChanged( double ) ) );
connect( myTextBtn, SIGNAL( clicked() ), this, SLOT( onTextPref() ) );
connect( myBarBtn, SIGNAL( clicked() ), this, SLOT( onBarPref() ) );
connect( myPreviewCheck, SIGNAL( toggled( bool )), this, SLOT( onPreviewCheck( bool ) ) );
-
+
connect( CBDistr, SIGNAL( toggled( bool ) ), this, SLOT( onShowDistribution( bool ) )); // RKV
-
+
connect( ColorSpin, SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() ));
connect( LabelSpin, SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() ));
connect( WidthSpin, SIGNAL( valueChanged( double ) ), this, SLOT( updatePreview() ));
}
else
aResourceMgr->setValue("VISU", "scalar_range_type", 0);
-
+
aResourceMgr->setValue("VISU", "scalar_bar_logarithmic", isLogarithmic());
aResourceMgr->setValue("VISU", "scalar_bar_show_distribution", isShowDistribution()); // RKV
-
+
////
if (myIsStoreTextProp) {
isTitleBold, isTitleItalic, isTitleShadow);
QFont aTitleFont;
-
+
aTitleFont.setBold(isTitleBold);
aTitleFont.setItalic(isTitleItalic);
aTitleFont.setOverline(isTitleShadow);
-
+
QString titleFontFamily;
switch (aTitleFontFamily) {
case VTK_ARIAL:
break;
}
aTitleFont.setFamily(titleFontFamily);
-
+
aResourceMgr->setValue("VISU", "scalar_bar_title_font", aTitleFont);
-
+
aResourceMgr->setValue("VISU", "scalar_bar_title_color", aTitleColor);
-
+
// "Label"
QColor aLabelColor (255, 255, 255);
int aLabelFontFamily = VTK_ARIAL;
QFont aLabelFont;
-
+
aLabelFont.setBold(isLabelBold);
aLabelFont.setItalic(isLabelItalic);
aLabelFont.setOverline(isLabelShadow);
}
aLabelFont.setFamily(labelFontFamily);
-
+
aResourceMgr->setValue("VISU", "scalar_bar_label_font", aLabelFont);
aResourceMgr->setValue("VISU", "scalar_bar_label_color", aLabelColor);
QString anUnit = QString(aUnitNames[i].c_str()).simplified();
if(anUnit.isNull() || anUnit == "")
anUnit = "-";
-
+
aComponent = aComponent + ", " + anUnit;
myModeCombo->addItem(aComponent);
myModeLbl->setEnabled(isScalarMode);
myModeCombo->setEnabled(isScalarMode);
+ // Gauss Metric option should be visible only if at least one
+ // of mesh values on geometry is based on multiple gauss points
+ bool isEnableGaussMetric = false;
+ if( myIsDisplayGaussMetric ) {
+ const VISU::TValField& aValField = aField->myValField;
+ VISU::TValField::const_iterator anIter = aValField.find(myScalarMap->GetScalarTimeStampNumber());
+ if ( anIter != aValField.end() ) {
+ VISU::PValForTime aValForTime = anIter->second;
+ if( aValForTime && aValForTime->GetMaxNbGauss() > 1 )
+ isEnableGaussMetric = true;
+ }
+ }
+
+ myGaussMetricLabel->setEnabled(isEnableGaussMetric);
+ myGaussMetric->setEnabled(isEnableGaussMetric);
+ if( isEnableGaussMetric )
+ myGaussMetric->setCurrentIndex((int)myScalarMap->GetGaussMetric());
+
setRange( myScalarMap->GetMin(), myScalarMap->GetMax(), myScalarMap->IsRangeFixed() );
setScalarBarData( myScalarMap->GetNbColors(), myScalarMap->GetLabels() );
myTitle = aTitle.in();
setPosAndSize( myScalarMap->GetPosX(),
- myScalarMap->GetPosY(),
- myScalarMap->GetWidth(),
- myScalarMap->GetHeight(),
- myScalarMap->GetBarOrientation());
+ myScalarMap->GetPosY(),
+ myScalarMap->GetWidth(),
+ myScalarMap->GetHeight(),
+ myScalarMap->GetBarOrientation());
if(RBvert->isChecked()) {
myVerTS = myScalarMap->GetTitleSize();
myScalarMapPL = VISU_ScalarMapPL::New();
if(myScalarMap->GetSpecificPL())
myScalarMapPL->ShallowCopy(myScalarMap->GetSpecificPL(), true);
-
+
if ( myBusy ) return;
myBusy = true;
myPreviewActor->GetScalarBar()->VisibilityOn();
myPreviewActor->PickableOff();
//myPreviewActor->SetBarVisibility(!myHideBar->isChecked());
-
+
myScalarMapPL->SetScalarMode(myModeCombo->currentIndex());
if(isLogarithmic())
myScalarMapPL->SetScaling(VISU::LOGARITHMIC);
else
myScalarMapPL->SetScaling(VISU::LINEAR);
+ if( myGaussMetric->isVisible() )
+ myScalarMapPL->SetGaussMetric((VISU::TGaussMetric)myGaussMetric->currentIndex());
+
if ( RBFrange->isChecked() ) {
myScalarMapPL->SetSourceRange();
} else {
myScalarMapPL->SetScalarRange( aRange );
}
- myScalarMapPL->SetNbColors(sbCol);
+ myScalarMapPL->SetNbColors(sbCol);
myScalarMapPL->Update();
-
+
aScalarBarActor->SetLookupTable(myScalarMapPL->GetBarTable());
aScalarBarActor->SetDistribution( myScalarMapPL->GetDistribution() );
aScalarBarActor->SetDistributionVisibility( isShowDistribution() );
-
+
if (!myTextDlg->getTitleText().isEmpty()) {
VISU::PValForTime aValForTime;
const VISU::PField& aField = myScalarMap->GetScalarField();
aValForTime = anIter->second;
if (aValForTime) {
- std::strstream aStream;
+ std::stringstream aStream;
const VISU::TTime& aTime = aValForTime->myTime;
aStream<< myTextDlg->getTitleText().toLatin1().data() <<" ";
- if(myBarDlg->isUnitsVisible())
- aStream<<VISU_Convertor::GenerateName(aTime)<<std::ends;
+ if(myBarDlg->isUnitsVisible())
+ aStream<<VISU_Convertor::GenerateName(aTime)<<std::ends;
else {
- QString aName;
- aName.sprintf("%g", aTime.first);
- aStream << aName.toLatin1().data() << std::ends;
+ QString aName;
+ aName.sprintf("%g", aTime.first);
+ aStream << aName.toLatin1().data() << std::ends;
}
std::string aScalarBarTitle = aStream.str();
aScalarBarActor->SetTitle(aScalarBarTitle.c_str());
bool isTitleItalic;
bool isTitleShadow;
myTextDlg->myTitleFont->GetData(aTitleColor,aTitleFontFamily,
- isTitleBold,isTitleItalic,isTitleShadow);
+ isTitleBold,isTitleItalic,isTitleShadow);
vtkTextProperty* aTitleProp = aScalarBarActor->GetTitleTextProperty();
aTitleProp->SetFontFamily(aTitleFontFamily);
aTitleProp->SetColor(vtkFloatingPointType(aTitleColor.red())/255.,
- vtkFloatingPointType(aTitleColor.green())/255.,
- vtkFloatingPointType(aTitleColor.blue())/255.);
+ vtkFloatingPointType(aTitleColor.green())/255.,
+ vtkFloatingPointType(aTitleColor.blue())/255.);
(isTitleBold)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
(isTitleItalic)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
(isTitleShadow)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
-
+
// label text property
QColor aLabelColor;
int aLabelFontFamily;
bool isLabelItalic;
bool isLabelShadow;
myTextDlg->myLabelFont->GetData(aLabelColor, aLabelFontFamily,
- isLabelBold, isLabelItalic, isLabelShadow);
+ isLabelBold, isLabelItalic, isLabelShadow);
vtkTextProperty* aLabelProp = aScalarBarActor->GetLabelTextProperty();
aLabelProp->SetFontFamily(aLabelFontFamily);
aLabelProp->SetColor(vtkFloatingPointType(aLabelColor.red())/255.,
- vtkFloatingPointType(aLabelColor.green())/255.,
- vtkFloatingPointType(aLabelColor.blue())/255.);
+ vtkFloatingPointType(aLabelColor.green())/255.,
+ vtkFloatingPointType(aLabelColor.blue())/255.);
(isLabelBold)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
(isLabelItalic)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
(isLabelShadow)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
- int VerTS, VerTH, VerLS, VerBW, VerBH;
+ int VerTS, VerLS, VerBW, VerBH;
myBarDlg->getRatios(VerTS, VerLS, VerBW, VerBH);
aScalarBarActor->SetRatios(VerTS, VerLS, VerBW, VerBH);
void VisuGUI_ScalarBarPane::deleteScalarBar()
{
if ( myBusy ) return;
-
+
if (myPreviewActor == 0) return;
vtkRenderer* aRend = myPreviewActor->GetRenderer();
vtkRenderWindow* aWnd = aRend->GetRenderWindow();
return 0;
myScalarMap->SetScalarMode(myModeCombo->currentIndex());
+ if( myGaussMetric->isVisible() )
+ myScalarMap->SetGaussMetric((VISU::GaussMetric)myGaussMetric->currentIndex());
myScalarMap->SetPosition(XSpin->value(), YSpin->value());
myScalarMap->SetSize(WidthSpin->value(), HeightSpin->value());
if(RBvert->isChecked()) {
myScalarMap->SetShadowTitle(isTitleShadow);
myScalarMap->SetTitFontType(aTitleFontFamily);
myScalarMap->SetTitleColor(aTitColor.red()/255.,
- aTitColor.green()/255.,
- aTitColor.blue()/255.);
+ aTitColor.green()/255.,
+ aTitColor.blue()/255.);
// "Label"
QColor aLblColor (255, 255, 255);
myScalarMap->SetShadowLabel(isLabelShadow);
myScalarMap->SetLblFontType(aLabelFontFamily);
myScalarMap->SetLabelColor(aLblColor.red()/255.,
- aLblColor.green()/255.,
- aLblColor.blue()/255.);
+ aLblColor.green()/255.,
+ aLblColor.blue()/255.);
myIsStoreTextProp = false;
}
*/
void VisuGUI_ScalarBarPane::XYChanged( double )
{
- QtxDoubleSpinBox* snd = (QtxDoubleSpinBox*)sender();
+ SalomeApp_DoubleSpinBox* snd = (SalomeApp_DoubleSpinBox*)sender();
if ( snd == XSpin ) {
WidthSpin->setMaximum( 1.0 - XSpin->value() );
}
myScalarMap->SetScalarMode(theMode);
if ( RBFrange->isChecked() ) {
- MinEdit->setText( QString::number( myScalarMap->GetSourceMin() ) );
- MaxEdit->setText( QString::number( myScalarMap->GetSourceMax() ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = qAbs( aResourceMgr->integerValue("VISU", "visual_data_precision", 0) );
+
+ MinEdit->setText(QString::number(myScalarMap->GetSourceMin(), 'g', aPrecision));
+ MaxEdit->setText(QString::number(myScalarMap->GetSourceMax(), 'g', aPrecision));
+ }
+
+ updatePreview();
+}
+
+
+//----------------------------------------------------------------------------
+/*!
+ Called when scalar mode is changed
+*/
+void VisuGUI_ScalarBarPane::changeGaussMetric( int theGaussMetric )
+{
+ myScalarMap->SetGaussMetric((VISU::GaussMetric)theGaussMetric);
+
+ if ( RBFrange->isChecked() ) {
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = qAbs( aResourceMgr->integerValue("VISU", "visual_data_precision", 0) );
+
+ MinEdit->setText(QString::number(myScalarMap->GetSourceMin(), 'g', aPrecision));
+ MaxEdit->setText(QString::number(myScalarMap->GetSourceMax(), 'g', aPrecision));
}
updatePreview();
*/
void VisuGUI_ScalarBarPane::setRange( double imin, double imax, bool sbRange )
{
- MinEdit->setText( QString::number( imin ) );
- MaxEdit->setText( QString::number( imax ) );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = qAbs( aResourceMgr->integerValue("VISU", "visual_data_precision", 0) );
+
+ MinEdit->setText(QString::number(imin, 'g', aPrecision+1)); // VSR +1 is for 'g' format
+ MaxEdit->setText(QString::number(imax, 'g', aPrecision+1)); // VSR +1 is for 'g' format
+
if( sbRange )
RBIrange->setChecked( true );
else
if ( RBIrange->isChecked() ) {
if (minVal >= maxVal) {
SUIT_MessageBox::warning( this,tr("WRN_VISU"),
- tr("MSG_MINMAX_VALUES"),
- tr("BUT_OK"));
+ tr("MSG_MINMAX_VALUES"),
+ tr("BUT_OK"));
return false;
}
}
if ( CBLog->isChecked() ) {
if ( minVal <= 0.0 || maxVal <= 0.0 ) {
if ( RBIrange->isChecked() ) {
- SUIT_MessageBox::warning( this,
+ SUIT_MessageBox::warning( this,
tr("WRN_VISU"),
tr("WRN_LOGARITHMIC_RANGE"),
tr("BUT_OK"));
} else {
- if ( minVal == 0 || maxVal == 0 )
- SUIT_MessageBox::warning( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_RANGE"),
- tr("BUT_OK"));
- else
- SUIT_MessageBox::warning( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_FIELD_RANGE"),
- tr("BUT_OK"));
- RBIrange->setChecked(true);
- changeRange(1);
+ if ( minVal == 0 || maxVal == 0 )
+ SUIT_MessageBox::warning( this,
+ tr("WRN_VISU"),
+ tr("WRN_LOGARITHMIC_RANGE"),
+ tr("BUT_OK"));
+ else
+ SUIT_MessageBox::warning( this,
+ tr("WRN_VISU"),
+ tr("WRN_LOGARITHMIC_FIELD_RANGE"),
+ tr("BUT_OK"));
+ RBIrange->setChecked(true);
+ changeRange(1);
}
return false;
}
}
else {
SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ),
- tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
- arg( app->resourceMgr()->stringValue( "ExternalBrowser",
- "application" ) ).
- arg( aHelpFileName ) );
+ tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser",
+ "application" ) ).
+ arg( aHelpFileName ) );
}
}
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
-
+
if ( e->key() == Qt::Key_F1 ) {
e->accept();
onHelp();
}
//----------------------------------------------------------------------------
-VisuGUI_ScalarBarBaseDlg::VisuGUI_ScalarBarBaseDlg( SalomeApp_Module* theModule, bool thePreview ) :
+VisuGUI_ScalarBarBaseDlg::VisuGUI_ScalarBarBaseDlg( SalomeApp_Module* theModule, bool theIsDisplayGaussMetric, bool thePreview ) :
VisuGUI_Prs3dDlg( theModule )
{
- myScalarPane = new VisuGUI_ScalarBarPane(this, thePreview);
+ myScalarPane = new VisuGUI_ScalarBarPane(this, theIsDisplayGaussMetric, thePreview);
myScalarPane->layout()->setMargin( 5 );
}
//----------------------------------------------------------------------------
void VisuGUI_ScalarBarBaseDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
myScalarPane->initFromPrsObject( thePrs );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Prs3dDlg.h
// Author : Laurent CORNABE & Hubert ROLLAND
class QCheckBox;
class QPushButton;
class QRadioButton;
-class QSpinBox;
class QLineEdit;
class QComboBox;
class QToolButton;
class QTabWidget;
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class SalomeApp_Module;
+class SalomeApp_IntSpinBox;
class SVTK_FontWidget;
class VISU_ScalarMapAct;
class VISU_ScalarMapPL;
~VisuGUI_BarPrefDlg() {};
void setRatios(int titleRatioSize, int labelRatioWidth,
- int barRatioWidth, int barRatioHeight);
+ int barRatioWidth, int barRatioHeight);
void getRatios(int& titleRatioSize, int& labelRatioWidth,
- int& barRatioWidth, int& barRatioHeight);
+ int& barRatioWidth, int& barRatioHeight);
void setUnitsVisible(bool isVisible);
bool isUnitsVisible();
void onHelp();
protected:
- QSpinBox* myTitleSizeSpin;
- QSpinBox* myLabelSizeSpin;
- QSpinBox* myBarWidthSpin;
- QSpinBox* myBarHeightSpin;
+ SalomeApp_IntSpinBox* myTitleSizeSpin;
+ SalomeApp_IntSpinBox* myLabelSizeSpin;
+ SalomeApp_IntSpinBox* myBarWidthSpin;
+ SalomeApp_IntSpinBox* myBarHeightSpin;
QCheckBox* myUnitsChk;
- QSpinBox* myPrecisionSpin;
+ SalomeApp_IntSpinBox* myPrecisionSpin;
int myTitleSize;
int myLabelSize;
Q_OBJECT;
public:
- VisuGUI_ScalarBarPane(QWidget* parent, bool thePreview = FALSE);
+ VisuGUI_ScalarBarPane(QWidget* parent, bool theIsDisplayGaussMetric = false, bool thePreview = FALSE);
~VisuGUI_ScalarBarPane();
void setRange( double imin, double imax, bool sbRange );
QRadioButton* RBhori;
QRadioButton* RBvert;
- QtxDoubleSpinBox* XSpin;
- QtxDoubleSpinBox* YSpin;
+ SalomeApp_DoubleSpinBox* XSpin;
+ SalomeApp_DoubleSpinBox* YSpin;
- QtxDoubleSpinBox* WidthSpin;
- QtxDoubleSpinBox* HeightSpin;
+ SalomeApp_DoubleSpinBox* WidthSpin;
+ SalomeApp_DoubleSpinBox* HeightSpin;
- QSpinBox* ColorSpin;
- QSpinBox* LabelSpin;
+ SalomeApp_IntSpinBox* ColorSpin;
+ SalomeApp_IntSpinBox* LabelSpin;
QCheckBox* CBSave;
QCheckBox* CBLog;
QLabel* myModeLbl;
QComboBox* myModeCombo;
+ QLabel* myGaussMetricLabel;
+ QComboBox* myGaussMetric;
QPushButton* myTextBtn;
QPushButton* myBarBtn;
VisuGUI_TextPrefDlg* myTextDlg;
void onImposedRange( bool );
void XYChanged( double );
void changeScalarMode( int );
+ void changeGaussMetric( int );
void onTextPref();
void onBarPref();
void onPreviewCheck(bool thePreview);
std::string myTitle;
bool myBusy;
+ bool myIsDisplayGaussMetric;
};
~VisuGUI_Prs3dDlg() {}
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit ) = 0;
+ bool theInit ) = 0;
virtual int storeToPrsObject( VISU::ColoredPrs3d_i* thePrs ) = 0;
Q_OBJECT;
public:
- VisuGUI_ScalarBarBaseDlg( SalomeApp_Module* theModule, bool thePreview = FALSE );
+ VisuGUI_ScalarBarBaseDlg( SalomeApp_Module* theModule, bool theIsDisplayGaussMetric = false, bool thePreview = FALSE );
~VisuGUI_ScalarBarBaseDlg();
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
protected slots:
void accept();
void reject();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Module.h
// Author :
#include "VISUConfig.hh"
#include "VisuGUI_Tools.h"
+#include "VISU_Tools.h"
#include "VisuGUI_ViewTools.h"
#include "VISU_ColoredPrs3dFactory.hh"
#include "VISU_PipeLine.hxx"
template<class TPrs3d_i, class TViewer, class TDlg, int TIsDlgModal>
void
EditPrs3d(VisuGUI* theModule,
- Handle(SALOME_InteractiveObject)& theIO,
- VISU::Prs3d_i* thePrs3d,
- SVTK_ViewWindow* theViewWindow)
+ Handle(SALOME_InteractiveObject)& theIO,
+ VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow)
{
if (TPrs3d_i* aPrs3d = dynamic_cast<TPrs3d_i*>(thePrs3d)) {
bool isModal = TIsDlgModal;
if( ColoredPrs3d_i* aColoredPrs3d = dynamic_cast<ColoredPrs3d_i*>(aPrs3d) )
- if( !aColoredPrs3d->IsTimeStampFixed() )
- isModal = 0;
+ if( !aColoredPrs3d->IsTimeStampFixed() )
+ isModal = 0;
TDlg* aDlg = new TDlg (theModule);
aDlg->initFromPrsObject(aPrs3d, true);
if (runAndWait(aDlg,isModal)) {
- if (!(aDlg->storeToPrsObject(aPrs3d))) {
- delete aDlg;
- return;
- }
- try {
- aPrs3d->UpdateActors();
- } catch (std::runtime_error& exc) {
- aPrs3d->RemoveActors();
-
- INFOS(exc.what());
- SUIT_MessageBox::warning
- (GetDesktop(theModule), QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()) );
- }
- if (theViewWindow) {
- theViewWindow->getRenderer()->ResetCameraClippingRange();
- theViewWindow->Repaint();
- }
- // Optionally, create table and curves for cut lines
- QApplication::setOverrideCursor(Qt::WaitCursor);
- CreateCurves( theModule,
- dynamic_cast<VISU::CutLines_i*>( aPrs3d ),
- aDlg,
- false ); // in edition mode
- QApplication::restoreOverrideCursor();
+ if (!(aDlg->storeToPrsObject(aPrs3d))) {
+ delete aDlg;
+ return;
+ }
+ try {
+ aPrs3d->UpdateActors();
+ } catch (std::runtime_error& exc) {
+ aPrs3d->RemoveActors();
+
+ INFOS(exc.what());
+ SUIT_MessageBox::warning
+ (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()) );
+ }
+ if (theViewWindow) {
+ theViewWindow->getRenderer()->ResetCameraClippingRange();
+ theViewWindow->Repaint();
+ }
+ // Optionally, create table and curves for cut lines
+ QApplication::setOverrideCursor(Qt::WaitCursor);
+ CreateCurves( theModule,
+ dynamic_cast<VISU::CutLinesBase_i*>( aPrs3d ),
+ aDlg,
+ false ); // in edition mode
+ QApplication::restoreOverrideCursor();
}
delete aDlg;
}
template<class TPrs3d_i, class TDlg, int TIsDlgModal>
void
EditPrs3d(VisuGUI* theModule,
- Handle(SALOME_InteractiveObject)& theIO,
- VISU::Prs3d_i* thePrs3d,
- SVTK_ViewWindow* theViewWindow = NULL)
+ Handle(SALOME_InteractiveObject)& theIO,
+ VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow = NULL)
{
SVTK_ViewWindow* aViewWindow = theViewWindow;
if (!aViewWindow)
template<class TPrs3d_i>
TPrs3d_i*
CreatePrs3dFromFactory(VisuGUI* theModule,
- _PTR(SObject) theTimeStamp,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- int theTimeId,
- ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
+ _PTR(SObject) theTimeStamp,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeId,
+ ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
{
VISU::Result_var aResult;
if (CheckResult(theModule, theTimeStamp, aResult)){
QApplication::setOverrideCursor(Qt::WaitCursor);
TPrs3d_i* aPrs3d = NULL;
if(thePublishInStudyMode == VISU::ColoredPrs3d_i::EPublishUnderTimeStamp)
- aPrs3d = VISU::CreatePrs3d<TPrs3d_i>(aResult,
- theMeshName,
- theEntity,
- theFieldName,
- theTimeId);
+ aPrs3d = VISU::CreatePrs3d<TPrs3d_i>(aResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeId);
else
{
- CORBA::Float anUsedMemory = 0.0;
- CORBA::Float aRequiredMemory = 0.0;
- VISU::ColoredPrs3dCache::EnlargeType anEnlargeType =
- VISU::GetRequiredCacheMemory<TPrs3d_i>(aResult,
- theMeshName,
- theEntity,
- theFieldName,
- theTimeId,
- anUsedMemory,
- aRequiredMemory);
-
- if( anEnlargeType == VISU::ColoredPrs3dCache::IMPOSSIBLE )
- {
- size_t aMb = 1024 * 1024;
- double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(8192*aMb)) / double(aMb);
-
- CORBA::Float aNecessaryMemory = aRequiredMemory - aFreeMemory - anUsedMemory;
- SUIT_MessageBox::warning(GetDesktop(theModule),
- QObject::tr("WRN_VISU"),
- QObject::tr("ERR_NO_MEMORY_TO_BUILD").arg(aNecessaryMemory) );
- QApplication::restoreOverrideCursor();
- return NULL;
- }
- else
- {
- if( anEnlargeType == VISU::ColoredPrs3dCache::ENLARGE )
- {
- if(SUIT_MessageBox::information(GetDesktop(theModule),
- QObject::tr("WRN_VISU"),
- QObject::tr("WRN_EXTRA_MEMORY_REQUIRED").arg(aRequiredMemory),
- QObject::tr("&OK"), QObject::tr("&Cancel"),
- 0, 1) == 1)
- {
- QApplication::restoreOverrideCursor();
- return NULL;
- }
- }
- aPrs3d = VISU::CreateHolder2GetDeviceByType<TPrs3d_i>(aResult,
- theMeshName,
- theEntity,
- theFieldName,
- theTimeId,
- anEnlargeType,
- aRequiredMemory);
- }
+ CORBA::Float anUsedMemory = 0.0;
+ CORBA::Float aRequiredMemory = 0.0;
+ VISU::ColoredPrs3dCache::EnlargeType anEnlargeType =
+ VISU::GetRequiredCacheMemory<TPrs3d_i>(aResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeId,
+ anUsedMemory,
+ aRequiredMemory);
+
+ if( anEnlargeType == VISU::ColoredPrs3dCache::IMPOSSIBLE )
+ {
+ size_t aMb = 1024 * 1024;
+ double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(8192*(double)aMb)) / double(aMb);
+
+ CORBA::Float aNecessaryMemory = aRequiredMemory - aFreeMemory - anUsedMemory;
+ SUIT_MessageBox::warning(GetDesktop(theModule),
+ QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_NO_MEMORY_TO_BUILD").arg(aNecessaryMemory) );
+ QApplication::restoreOverrideCursor();
+ return NULL;
+ }
+ else
+ {
+ if( anEnlargeType == VISU::ColoredPrs3dCache::ENLARGE )
+ {
+ if(SUIT_MessageBox::information(GetDesktop(theModule),
+ QObject::tr("WRN_VISU"),
+ QObject::tr("WRN_EXTRA_MEMORY_REQUIRED").arg(aRequiredMemory),
+ QObject::tr("&OK"), QObject::tr("&Cancel"),
+ 0, 1) == 1)
+ {
+ QApplication::restoreOverrideCursor();
+ return NULL;
+ }
+ }
+ aPrs3d = VISU::CreateHolder2GetDeviceByType<TPrs3d_i>(aResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeId,
+ anEnlargeType,
+ aRequiredMemory);
+ }
}
QApplication::restoreOverrideCursor();
if(aPrs3d)
- return aPrs3d;
+ return aPrs3d;
}
SUIT_MessageBox::warning(GetDesktop(theModule),
- QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_BUILD_PRESENTATION") );
+ QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_BUILD_PRESENTATION") );
return NULL;
}
template<class TPrs3d_i, class TViewer, class TDlg, int IsDlgModal>
TPrs3d_i*
CreateAndEditPrs3d(VisuGUI* theModule,
- _PTR(SObject) theTimeStamp,
- ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
+ _PTR(SObject) theTimeStamp,
+ ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
{
Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(theTimeStamp);
VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap);
TPrs3d_i* aPrs3d =
CreatePrs3dFromFactory<TPrs3d_i>(theModule,
- theTimeStamp,
- (const char*)aMeshName.toLatin1(),
- (Entity)anEntity.toInt(),
- (const char*)aFieldName.toLatin1(),
- aTimeStampId.toInt(),
- thePublishInStudyMode);
+ theTimeStamp,
+ (const char*)aMeshName.toLatin1(),
+ (Entity)anEntity.toInt(),
+ (const char*)aFieldName.toLatin1(),
+ aTimeStampId.toInt(),
+ thePublishInStudyMode);
QApplication::restoreOverrideCursor();
if (aPrs3d) {
SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
if(aResourceMgr->booleanValue("VISU","display_only",false)){
- theModule->OnEraseAll();
- }
+ theModule->OnEraseAll();
+ SetVisibilityState(aPrs3d->GetEntry(),Qtx::ShownState);
+ }
if (!aValue) {
- if (TDlg* aDlg = new TDlg(theModule)) { // dialog box in creation mode
- aDlg->initFromPrsObject(aPrs3d, true);
- if (runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) {
- if(aResourceMgr->booleanValue("VISU","display_only",false)){
- if(SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(theModule, false)) aPlot2d->EraseAll();
- }
- // Optionally, create table and curves for cut lines
- QApplication::setOverrideCursor(Qt::WaitCursor);
- CreateCurves( theModule,
- dynamic_cast<VISU::CutLines_i*>( aPrs3d ),
- aDlg,
- true ); // in creation mode
- UpdateObjBrowser(theModule,true,theTimeStamp);
- QApplication::restoreOverrideCursor();
- delete aDlg;
- } else {
- DeletePrs3d(theModule,aPrs3d);
- QApplication::restoreOverrideCursor();
- delete aDlg;
- return NULL;
- }
- }
+ if (TDlg* aDlg = new TDlg(theModule)) { // dialog box in creation mode
+ aDlg->initFromPrsObject(aPrs3d, true);
+ if (runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) {
+ if(aResourceMgr->booleanValue("VISU","display_only",false)){
+ if(SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(theModule, false)) aPlot2d->EraseAll();
+ }
+ // Optionally, create table and curves for cut lines
+ QApplication::setOverrideCursor(Qt::WaitCursor);
+ CreateCurves( theModule,
+ dynamic_cast<VISU::CutLinesBase_i*>( aPrs3d ),
+ aDlg,
+ true ); // in creation mode
+ UpdateObjBrowser(theModule,true,theTimeStamp);
+ QApplication::restoreOverrideCursor();
+ delete aDlg;
+ } else {
+ if ( theModule->application() )
+ DeletePrs3d(theModule,aPrs3d);
+ QApplication::restoreOverrideCursor();
+ delete aDlg;
+ return NULL;
+ }
+ }
}
// aViewWindow = GetViewWindow<TViewer>(theModule); IPAL 20125 dmv
// Display created presentation.
if (aViewWindow) {
- PublishInView(theModule, aPrs3d, aViewWindow);
+ PublishInView(theModule, aPrs3d, aViewWindow);
if(GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)){
- aViewWindow->onFitAll();
- }
+ aViewWindow->onFitAll();
+ }
- AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos);
+ AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos);
}
return aPrs3d;
template<class TPrs3d_i, class TViewer, class TDlg, int IsDlgModal>
TPrs3d_i*
CreatePrs3dInViewer(VisuGUI* theModule,
- _PTR(SObject) theTimeStampSObj,
- ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
+ _PTR(SObject) theTimeStampSObj,
+ ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
{
TPrs3d_i* aPrs = 0;
// Create new TViewWindow instance, if it does not exist.
template<class TPrs3d_i, class TDlg, int IsDlgModal>
TPrs3d_i*
CreatePrs3d(VisuGUI* theModule,
- const QString& theDesiredViewerType = QString())
+ const QString& theDesiredViewerType = QString())
{
TPrs3d_i* aPrs = 0;
if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule)))
if(/*aPublishInStudyMode == */VISU::ColoredPrs3d_i::EPublishIndependently){
// CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,0>
- // (theModule,aTimeStampSObj,aPublishInStudyMode);
+ // (theModule,aTimeStampSObj,aPublishInStudyMode);
aPrs = CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,0>
- (theModule,aTimeStampSObj,aPublishInStudyMode);
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
return aPrs;
}else{
if(theDesiredViewerType.isNull()){
- if (/*SUIT_ViewManager* aViewManager = */theModule->getApp()->activeViewManager())
- /*if (aViewManager->getType() == VVTK_Viewer::Type()){
- aPrs = CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,aPublishInStudyMode);
- return aPrs;
- }*/
- aPrs = CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,aPublishInStudyMode);
+ if (/*SUIT_ViewManager* aViewManager = */theModule->getApp()->activeViewManager())
+ /*if (aViewManager->getType() == VVTK_Viewer::Type()){
+ aPrs = CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
+ return aPrs;
+ }*/
+ aPrs = CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
}else{
- /*if(theDesiredViewerType == VVTK_Viewer::Type()) {
- aPrs = CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,aPublishInStudyMode);
- } else {*/
- aPrs = CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,aPublishInStudyMode);
- //}
+ /*if(theDesiredViewerType == VVTK_Viewer::Type()) {
+ aPrs = CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
+ } else {*/
+ aPrs = CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
+ //}
}
}
return aPrs;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_ScalarBarDlg.cxx
// Author : Laurent CORNABE & Hubert ROLLAND
#include "VisuGUI_InputPane.h"
#include "SVTK_ViewWindow.h"
-#include "SVTK_FontWidget.h"
#include "VISUConfig.hh"
#include "VISU_Convertor.hxx"
Constructor
*/
VisuGUI_ScalarBarDlg::VisuGUI_ScalarBarDlg (SalomeApp_Module* theModule)
- : VisuGUI_ScalarBarBaseDlg(theModule)
+ : VisuGUI_ScalarBarBaseDlg(theModule, true)
{
setWindowTitle(tr("DLG_PROP_TITLE"));
setSizeGripEnabled(TRUE);
myTabBox = new QTabWidget(this);
myInputPane = new VisuGUI_InputPane(VISU::TSCALARMAP, theModule, this);
- myTabBox->addTab(GetScalarPane(), "Scalar Bar");
- myTabBox->addTab(myInputPane, "Input");
+ myTabBox->addTab(GetScalarPane(), tr("SCALAR_BAR_TAB"));
+ myTabBox->addTab(myInputPane, tr("INPUT_TAB"));
TopLayout->addWidget(myTabBox);
Initialize dialog from the presentation
*/
void VisuGUI_ScalarBarDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TSCALARMAP>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_ScalarBarDlg.h
// Author : Laurent CORNABE & Hubert ROLLAND
~VisuGUI_ScalarBarDlg();
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Selection.cxx
// Author : Sergey Anikin
#include "VISU_Actor.h"
#include "VISU_ScalarMapAct.h"
+#include "VISU_GaussPtsAct.h"
#include "SalomeApp_Study.h"
#include "LightApp_Study.h"
QVariant val( LightApp_Selection::parameter( ind, p ) );
if ( !val.isValid() ) {
if ( p == "type" ) val = QVariant( type( ind ) );
+ else if ( p == "isFieldPrs" ) val = QVariant( isFieldPrs( ind ) );
else if ( p == "nbComponents" ) val = QVariant( nbComponents( ind ) );
else if ( p == "medEntity" ) val = QVariant( medEntity( ind ) );
else if ( p == "medSource" ) val = QVariant( medSource( ind ) );
else if ( p == "hasActor" ) val = QVariant( hasActor( ind ) );
else if ( p == "isShading" ) val = QVariant( isShading( ind ) );
else if ( p == "isScalarMapAct" ) val = QVariant( isScalarMapAct( ind ) );
+ else if ( p == "isGaussPtsAct" ) val = QVariant( isGaussPtsAct( ind ) );
else if ( p == "isVisuComponent") val = QVariant( isVisuComponent( ind ) );
else if ( p == "fullResolution" ) val = QVariant( fullResolution( ind ) );
else if ( p == "mediumResolution" ) val = QVariant( mediumResolution( ind ) );
else if ( p == "isPlot2dViewer" ) val = QVariant( Plot2dViewerType( ind ) );
else if ( p == "isValuesLabeled" ) val = QVariant( isValuesLabeled( ind ) );
else if ( p == "isScalarBarVisible" ) val = QVariant( isScalarBarVisible( ind ) );
+ else if ( p == "quadratic2DMode" ) val = QVariant( quadratic2DMode(ind) );
+ else if ( p == "hasDeviation" ) val = QVariant( hasDeviation(ind) );
+ else if ( p == "isDeviationDisplayed" ) val = QVariant( isDeviationDisplayed(ind) );
}
return val;
ENUM2STRING( aResStr, VISU::TSCALARMAPONDEFORMEDSHAPE );
ENUM2STRING( aResStr, VISU::TCUTPLANES );
ENUM2STRING( aResStr, VISU::TCUTLINES );
+ ENUM2STRING( aResStr, VISU::TCUTSEGMENT );
ENUM2STRING( aResStr, VISU::TVECTORS );
ENUM2STRING( aResStr, VISU::TSTREAMLINES );
ENUM2STRING( aResStr, VISU::TPLOT3D );
}
+//---------------------------------------------------------------
+bool VisuGUI_Selection::isFieldPrs( const int ind ) const
+{
+ SalomeApp_Study* aStudy = GetStudy();
+ if ( !aStudy )
+ return false;
+
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
+ VISU::Base_i* aBase = anObjectInfo.myBase;
+ return ( aBase && aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER );
+}
+
+
//---------------------------------------------------------------
QString VisuGUI_Selection::nbComponents( const int ind ) const
{
Result_i::ECreationId aCreationId = aResult->GetCreationId();
switch(aCreationId){
case Result_i::eImportFile :
- return "eImportFile";
+ return "eImportFile";
case Result_i::eCopyAndImportFile :
- return "eCopyAndImportFile";
+ return "eCopyAndImportFile";
case Result_i::eImportMed :
- return "eImportMed";
+ return "eImportMed";
case Result_i::eImportMedField :
- return "eImportMedField";
+ return "eImportMedField";
default:
- return QString();
+ return QString();
}
}
}
{
QString
operator()(const SalomeApp_Module* theModule,
- const QString& theEntry)
+ const QString& theEntry)
{
if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){
QString aType = aViewManager->getType();
TPopupFunctor aFunctor;
if(aType == SVTK_Viewer::Type())
- return aFunctor.template Get<SVTK_Viewer>(theModule, theEntry);
+ return aFunctor.template Get<SVTK_Viewer>(theModule, theEntry);
//else if(aType == VVTK_Viewer::Type())
//return aFunctor.template Get<VVTK_Viewer>(theModule, theEntry);
}
template<class TViewer>
bool
GetPrs3dSelectionInfo(const SalomeApp_Module* theModule,
- const QString& theEntry,
- VISU::Prs3d_i*& thePrs3d,
- SVTK_ViewWindow*& theViewWindow,
- VISU_Actor*& thenActor)
+ const QString& theEntry,
+ VISU::Prs3d_i*& thePrs3d,
+ SVTK_ViewWindow*& theViewWindow,
+ VISU_Actor*& thenActor)
{
VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(theModule), (const char*)theEntry.toLatin1());
thePrs3d = GetPrs3dFromBase(anObjectInfo.myBase);
aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
if ( aSelectionInfo.empty() )
- return QString();
+ return QString();
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
aPointMap3d = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);
anActorBase = VISU::FindActorBase(aViewWindow, aPointMap3d);
QString
virtual
getPointMap(VISU::PointMap3d_i* thePrs3d,
- SVTK_ViewWindow* theViewWindow,
- VISU_ActorBase* theActor)
+ SVTK_ViewWindow* theViewWindow,
+ VISU_ActorBase* theActor)
{
return QString();
}
QString
virtual
getPointMap(VISU::PointMap3d_i* thePrs3d,
- SVTK_ViewWindow* theViewWindow,
- VISU_ActorBase* theActorBase)
+ SVTK_ViewWindow* theViewWindow,
+ VISU_ActorBase* theActorBase)
{
QString aResStr = "";
if (theActorBase) {
switch (theActorBase->GetRepresentation()) {
- ENUM2STRING( aResStr, VISU::WIREFRAME ); // = 1
- ENUM2STRING( aResStr, VISU::SHADED ); // = 2
+ ENUM2STRING( aResStr, VISU::WIREFRAME ); // = 1
+ ENUM2STRING( aResStr, VISU::SHADED ); // = 2
}
}
return aResStr;
_PTR(SObject) SO = aStudy->FindObjectID( (const char*)entry( ind ).toLatin1() );
if ( SO ){
for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) {
- _PTR(SObject) refSO;
- if ( !Iter->Value()->ReferencedObject( refSO ) && ( !named || Iter->Value()->GetName().size() ) )
- cnt++;
+ _PTR(SObject) refSO;
+ if ( !Iter->Value()->ReferencedObject( refSO ) && ( !named || Iter->Value()->GetName().size() ) )
+ cnt++;
}
}
}
QString
virtual
getPointMap(VISU::PointMap3d_i* thePointMap,
- SVTK_ViewWindow* theViewWindow,
- VISU_ActorBase* theActorBase)
+ SVTK_ViewWindow* theViewWindow,
+ VISU_ActorBase* theActorBase)
{
if (theActorBase)
return theActorBase->IsShrunk() ? "1" : "0";
return TPopupDispatcher<TIsScalarMapActFunctor>()(myModule, entry(ind));
}
+//----------------------------------------------------------------------------
+struct TIsGaussPtsActFunctor: TViewFunctor
+{
+ QString
+ virtual
+ get(VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow,
+ VISU_Actor* theActor)
+ {
+ return dynamic_cast<VISU_GaussPtsAct*>(theActor)? "1" : "0";
+ }
+};
+
+
+//---------------------------------------------------------------
+QString VisuGUI_Selection::isGaussPtsAct( const int ind ) const
+{
+ return TPopupDispatcher<TIsGaussPtsActFunctor>()(myModule, entry(ind));
+}
//----------------------------------------------------------------------------
bool VisuGUI_Selection::isVisuComponent( const int ind ) const
_PTR(SObject) SO = aStudy->FindObjectID( (const char*) entry( ind ).toLatin1() );
if ( SO ){
for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) {
- _PTR(SObject) refSO;
- if ( Iter->Value()->ReferencedObject(refSO) )
- entryId = refSO->GetID().c_str();
- else
- entryId = Iter->Value()->GetID().c_str();
-
- LightApp_Displayer* displayer = LightApp_Displayer::FindDisplayer( myModule->moduleName(), false );
- if ( displayer->IsDisplayed( entryId ) && findHidden == false )
- return true;
- else if ( !displayer->IsDisplayed( entryId ) && findHidden == true )
- return true;
+ _PTR(SObject) refSO;
+ if ( Iter->Value()->ReferencedObject(refSO) )
+ entryId = refSO->GetID().c_str();
+ else
+ entryId = Iter->Value()->GetID().c_str();
+
+ LightApp_Displayer* displayer = LightApp_Displayer::FindDisplayer( myModule->moduleName(), false );
+ if ( displayer->IsDisplayed( entryId ) && findHidden == false )
+ return true;
+ else if ( !displayer->IsDisplayed( entryId ) && findHidden == true )
+ return true;
}
}
}
_PTR(SObject) SO = aStudy->FindObjectID( (const char*) entry( ind ).toLatin1() );
if ( SO ){
for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) {
- _PTR(SObject) refSO;
- if ( Iter->Value()->ReferencedObject(refSO) ) {
- // reference on curve
- }
- else
- refSO = Iter->Value();
-
- CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(refSO);
- if(!CORBA::is_nil(aCORBAObject)){
- PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
- if(dynamic_cast<VISU::Curve_i*>(aServant.in()))
- return true;
- }
+ _PTR(SObject) refSO;
+ if ( Iter->Value()->ReferencedObject(refSO) ) {
+ // reference on curve
+ }
+ else
+ refSO = Iter->Value();
+
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(refSO);
+ if(!CORBA::is_nil(aCORBAObject)){
+ PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+ if(dynamic_cast<VISU::Curve_i*>(aServant.in()))
+ return true;
+ }
}
}
}
if( SUIT_ViewManager* vman = sApp->activeViewManager() )
if( SUIT_ViewModel* vmod = vman->getViewModel() ) {
viewerType = vmod->getType();
- if (viewerType ==SPlot2d_Viewer::Type())
- return true;
- }
+ if (viewerType ==SPlot2d_Viewer::Type())
+ return true;
+ }
return false;
}
{
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor))
return anActor->GetBarVisibility() ? "true" : "false";
+ else if ( VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor))
+ return anActor->GetBarVisibility() ? "true" : "false";
return QString();
}
};
{
return TPopupDispatcher<TIsScalarBarVisibleFunctor>()(myModule, entry(ind)) == "true";
}
+
+struct TGetQuadratic2DRepresentation: TViewFunctor
+{
+ QString virtual get (VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow,
+ VISU_Actor* theActor)
+ {
+ if(theActor->GetQuadratic2DRepresentation() == VISU_Actor::eLines)
+ return "VISU::LINES";
+ else if (theActor->GetQuadratic2DRepresentation() == VISU_Actor::eArcs)
+ return "VISU::ARCS";
+
+ return QString();
+ }
+};
+
+
+QString VisuGUI_Selection::quadratic2DMode( const int ind) const
+{
+ return TPopupDispatcher<TGetQuadratic2DRepresentation>()(myModule, entry(ind));
+}
+
+
+bool VisuGUI_Selection::hasDeviation(const int ind) const {
+ SalomeApp_Study* aSStudy = GetStudy();
+ if ( !aSStudy )
+ return false;
+
+ _PTR(Study) aStudy = GetCStudy( aSStudy );
+ if ( aStudy ) {
+ _PTR(SObject) SO = aStudy->FindObjectID( (const char*) entry( ind ).toLatin1() );
+ if ( SO ) {
+ CORBA::Object_var anObj = VISU::ClientSObjectToObject( SO );
+ if( !CORBA::is_nil( anObj )) {
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>( VISU::GetServant( anObj ).in()) ) {
+ return aCurve->hasDeviation();
+ }
+ }
+ }
+ }
+ return false;
+}
+
+bool VisuGUI_Selection::isDeviationDisplayed(const int ind) const {
+ SalomeApp_Study* aSStudy = GetStudy();
+ if ( !aSStudy )
+ return false;
+
+ _PTR(Study) aStudy = GetCStudy( aSStudy );
+ if ( aStudy ) {
+ _PTR(SObject) SO = aStudy->FindObjectID( (const char*) entry( ind ).toLatin1() );
+ if ( SO ) {
+ CORBA::Object_var anObj = VISU::ClientSObjectToObject( SO );
+ if( !CORBA::is_nil( anObj )) {
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>( VISU::GetServant( anObj ).in()) ) {
+ return aCurve->isDeviationShown();
+ }
+ }
+ }
+ }
+ return false;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Selection.h
// Author : Sergey Anikin
private:
QString type( const int ) const;
+ bool isFieldPrs( const int ) const;
QString nbComponents( const int ) const;
QString medEntity( const int ) const;
QString medSource( const int ) const;
bool hasActor( const int ) const;
QString isShading( const int ) const;
QString isScalarMapAct( const int ) const;
+ QString isGaussPtsAct( const int ) const;
bool isScalarBarVisible( const int ) const;
bool isVisuComponent( const int ) const;
QString isValuesLabeled( const int ) const;
QString lowResolution( const int ) const;
QString resolutionState( const int ) const;
+ QString quadratic2DMode( const int ) const;
+ bool hasDeviation(const int) const;
+ bool isDeviationDisplayed(const int) const;
+
private:
bool findDisplayedCurves( const int, bool ) const;
bool hasCurves( const int ) const;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_SelectionPanel.h
// Author : Laurent CORNABE & Hubert ROLLAND
#include "SVTK_Selector.h"
#include "SVTK_RenderWindowInteractor.h"
+#include "VTKViewer_Algorithm.h"
+
#include "utilities.h"
// OCCT Includes
// QT Includes
#include <QLabel>
-#include <QSpinBox>
#include <QListWidget>
#include <QLayout>
#include <QButtonGroup>
// STL Includes
#include <map>
-using namespace std;
-
class CustomIntValidator: public QIntValidator
{
public:
}
};
-VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const VisuGUI* theModule, QWidget* theParent ) :
- VisuGUI_Panel( tr("WINDOW_TITLE" ), theModule, theParent, CloseBtn | HelpBtn ),
+VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( VisuGUI* theModule, QWidget* theParent ) :
+ VisuGUI_Panel( tr( "WINDOW_TITLE" ), theModule, theParent, CloseBtn | HelpBtn ),
myPreferencesDlg( 0 )
{
+ setWindowTitle( tr( "WINDOW_TITLE" ) );
+ setObjectName( tr( "WINDOW_TITLE" ) );
+
QVBoxLayout* TopLayout = new QVBoxLayout ( mainFrame() );
QWidget* aNamePane = new QWidget (mainFrame());
{
int aColumnId = aColumnIter.next();
if( aColumnId >= 0 && aColumnId < aColumnHeaders.size() )
- aHorizontalHeaderLabels << aColumnHeaders[ aColumnId ];
+ aHorizontalHeaderLabels << aColumnHeaders[ aColumnId ];
}
aTable->setColumnCount( aHorizontalHeaderLabels.size() );
aTable->setHorizontalHeaderLabels( aHorizontalHeaderLabels );
aTable->resizeColumnsToContents();
connect( aTable, SIGNAL( doubleClicked( const QModelIndex& ) ),
- this, SLOT( onDoubleClicked( const QModelIndex& ) ) );
+ this, SLOT( onDoubleClicked( const QModelIndex& ) ) );
}
// Actor Pane
TopLayout->addWidget( aPrefBtn );
- SalomeApp_Application* anApp =
- dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
- LightApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr();
- connect( aSelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionEvent() ) );
+ connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+ this, SLOT( onSelectionEvent() ) );
connect( this, SIGNAL( selectionModeChanged( int ) ), myModule, SLOT( OnSwitchSelectionMode( int ) ) );
void VisuGUI_SelectionPanel::closeEvent( QCloseEvent* theEvent )
{
- onClose();
+ //onClose();
VisuGUI_Panel::closeEvent(theEvent);
}
}
TPointData getPointData( TPointID thePointVTKID, VISU_Actor* theActor, const VISU::PIDMapper& theMapper,
- bool theIsValueData )
+ bool theIsValueData )
{
TPointData aPointData;
case GaussPointSelection:
break;
default:
- close();
+ hide();
return;
}
if (aSObject) {
VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(aSObject);
if (!aMap.empty()) {
- aMeshName = VISU::Storable::FindValue(aMap, "myMeshName");
- aFieldName = VISU::Storable::FindValue(aMap, "myFieldName");
+ aMeshName = VISU::Storable::FindValue(aMap, "myMeshName");
+ aFieldName = VISU::Storable::FindValue(aMap, "myFieldName");
}
}
int anID = aMapIndex(ind);
switch( aType )
- {
+ {
case 1:
- {
- if( aSingleSelection )
- myCellIDValLbl->setText( QString::number( anID ) );
+ {
+ if( aSingleSelection )
+ myCellIDValLbl->setText( QString::number( anID ) );
vtkCell* aCell = anVISUActor->GetElemCell( anID );
- int aCellVTKID = anVISUActor->GetElemVTKID( anID );
+ int aCellVTKID = anVISUActor->GetElemVTKID( anID );
if( !aCell || aCellVTKID < 0 )
- break;
-
- int aNbOfPoints = aCell->GetNumberOfPoints();
- if( aNbOfPoints < 1 )
- break;
-
- TPointDataMap aPointDataMap;
-
- vtkIdList* aPointList = aCell->GetPointIds();
- for( int i = 0; i < aNbOfPoints; i++ )
- {
- int aPointVTKID = aPointList->GetId(i);
-
- TPointID aPointID = anVISUActor->GetNodeObjId( aPointVTKID );
- TPointData aPointData = getPointData( aPointVTKID, anVISUActor, aMapper, true );
- aPointDataMap[ aPointID ] = aPointData;
- aGlobalPointDataMap[ aPointID ] = aPointData;
- }
-
- TCellToPointData aCellToPointData;
- aCellToPointData.CellData = getValueData( aCellVTKID, anVISUActor, aDataSet->GetCellData() );
- aCellToPointData.PointDataMap = aPointDataMap;
- aCellToPointDataMap[ anID ] = aCellToPointData;
- break;
+ break;
+
+ int aNbOfPoints = aCell->GetNumberOfPoints();
+ if( aNbOfPoints < 1 )
+ break;
+
+ TPointDataMap aPointDataMap;
+
+ vtkIdList* aPointList = aCell->GetPointIds();
+ for( int i = 0; i < aNbOfPoints; i++ )
+ {
+ int aPointVTKID = aPointList->GetId(i);
+
+ TPointID aPointID = anVISUActor->GetNodeObjId( aPointVTKID );
+ TPointData aPointData = getPointData( aPointVTKID, anVISUActor, aMapper, true );
+ aPointDataMap[ aPointID ] = aPointData;
+ aGlobalPointDataMap[ aPointID ] = aPointData;
+ }
+
+ TCellToPointData aCellToPointData;
+ aCellToPointData.CellData = getValueData( aCellVTKID, anVISUActor, aDataSet->GetCellData() );
+ aCellToPointData.PointDataMap = aPointDataMap;
+ aCellToPointDataMap[ anID ] = aCellToPointData;
+ break;
}
case 2:
{
- if( aSingleSelection )
- myIDValLbl->setText( QString::number( anID ) );
-
- int aPointVTKID = anVISUActor->GetNodeVTKID( anID );
- if( aPointVTKID < 0 )
- break;
-
- TCellDataMap aCellDataMap;
-
- VISU::TElnoPoints anElnoPoints = VISU::GetElnoPoints( aDataSet, anID );
- VISU::TElnoPoints::iterator anElnoIter = anElnoPoints.begin();
- for( ; anElnoIter != anElnoPoints.end(); anElnoIter++ )
- {
- VISU::TElnoPointID anElnoPointID = *anElnoIter;
- VISU::TVTKPointID aVTKPointID = anElnoPointID.first;
- VISU::TVTKCellID aVTKCellID = anElnoPointID.second;
-
- TCellID aCellID = anVISUActor->GetElemObjId( aVTKCellID );
- TValueData aValueData = getValueData( aVTKPointID, anVISUActor, aDataSet->GetPointData() );
- aCellDataMap[ aCellID ] = aValueData;
- }
-
- TPointToCellData aPointToCellData;
- aPointToCellData.PointData = getPointData( aPointVTKID, anVISUActor, aMapper, !isElno );
- aPointToCellData.CellDataMap = aCellDataMap;
- aPointToCellDataMap[ anID ] = aPointToCellData;
- break;
+ if( aSingleSelection )
+ myIDValLbl->setText( QString::number( anID ) );
+
+ int aPointVTKID = anVISUActor->GetNodeVTKID( anID );
+ if( aPointVTKID < 0 )
+ break;
+
+ TCellDataMap aCellDataMap;
+
+ VISU::TElnoPoints anElnoPoints = VISU::GetElnoPoints( aDataSet, anID );
+ VISU::TElnoPoints::iterator anElnoIter = anElnoPoints.begin();
+ for( ; anElnoIter != anElnoPoints.end(); anElnoIter++ )
+ {
+ VISU::TElnoPointID anElnoPointID = *anElnoIter;
+ VISU::TVTKPointID aVTKPointID = anElnoPointID.first;
+ VISU::TVTKCellID aVTKCellID = anElnoPointID.second;
+
+ TCellID aCellID = anVISUActor->GetElemObjId( aVTKCellID );
+ TValueData aValueData = getValueData( aVTKPointID, anVISUActor, aDataSet->GetPointData() );
+ aCellDataMap[ aCellID ] = aValueData;
+ }
+
+ TPointToCellData aPointToCellData;
+ aPointToCellData.PointData = getPointData( aPointVTKID, anVISUActor, aMapper, !isElno );
+ aPointToCellData.CellDataMap = aCellDataMap;
+ aPointToCellDataMap[ anID ] = aPointToCellData;
+ break;
}
}
}
switch( aType )
{
case 1:
- if( isElno )
- aTableIds.append( CellElno );
- else
- {
- aTableIds.append( CellStdCell );
- aTableIds.append( CellStdPoint );
- }
- break;
+ if( isElno )
+ aTableIds.append( CellElno );
+ else
+ {
+ aTableIds.append( CellStdCell );
+ aTableIds.append( CellStdPoint );
+ }
+ break;
case 2:
- aTableIds.append( isElno ? PointElno : PointStd );
- break;
+ aTableIds.append( isElno ? PointElno : PointStd );
+ break;
}
QListIterator<int> aTableIter( aTableIds );
while( aTableIter.hasNext() )
{
- int aTableId = aTableIter.next();
- if( !myTables.contains( aTableId ) )
- continue;
-
- QTableWidget* aTable = myTables[ aTableId ];
- if( !aTable )
- continue;
-
- int aRow = -1;
- switch( aTableId )
- {
- case CellStdPoint:
- {
- int aRowCount = aGlobalPointDataMap.size();
- aTable->setRowCount( aRowCount );
-
- TPointDataMap::const_iterator aPointIter = aGlobalPointDataMap.begin();
- for( ; aPointIter != aGlobalPointDataMap.end(); aPointIter++ )
- {
- aRow++;
- TPointID aPointID = aPointIter.key();
- const TPointData& aPointData = aPointIter.value();
- const TValueData& aValueData = aPointData.ValueData;
-
- setData( aTableId, aRow, Point, aPointID );
- setData( aTableId, aRow, X, aPointData.X );
- setData( aTableId, aRow, Y, aPointData.Y );
- setData( aTableId, aRow, Z, aPointData.Z );
- setData( aTableId, aRow, I, aPointData.I );
- setData( aTableId, aRow, J, aPointData.J );
- setData( aTableId, aRow, K, aPointData.K );
- setData( aTableId, aRow, Scalar, aValueData.Scalar );
- setData( aTableId, aRow, Vector, aValueData.Vector );
- }
- break;
- }
- case CellStdCell:
- case CellElno:
- {
- int aRowCount = 0;
- TCellToPointDataMap::const_iterator aCellToPointIter = aCellToPointDataMap.begin();
- for( ; aCellToPointIter != aCellToPointDataMap.end(); aCellToPointIter++ )
- {
- if( aTableId == CellStdCell )
- aRowCount++;
- else if( aTableId == CellElno )
- {
- const TCellToPointData& aCellToPointData = aCellToPointIter.value();
- const TPointDataMap& aPointDataMap = aCellToPointData.PointDataMap;
- int aNbPoints = aPointDataMap.size();
-
- aRowCount += aNbPoints;
- }
- }
- aTable->setRowCount( aRowCount );
-
- aCellToPointIter = aCellToPointDataMap.begin();
- for( ; aCellToPointIter != aCellToPointDataMap.end(); aCellToPointIter++ )
- {
- aRow++;
-
- TCellID aCellID = aCellToPointIter.key();
- const TCellToPointData& aCellToPointData = aCellToPointIter.value();
- const TValueData& aCellData = aCellToPointData.CellData;
-
- setData( aTableId, aRow, Cell, aCellID );
- if( aTableId == CellStdCell )
- {
- setData( aTableId, aRow, Scalar, aCellData.Scalar );
- setData( aTableId, aRow, Vector, aCellData.Vector );
- }
- else if( aTableId == CellElno )
- {
- const TPointDataMap& aPointDataMap = aCellToPointData.PointDataMap;
- int aNbPoints = aPointDataMap.size();
- if( aNbPoints > 1 )
- setRowSpan( aTableId, aRow, Cell, aNbPoints );
-
- TPointDataMap::const_iterator aPointIter = aPointDataMap.begin();
- for( aRow--; aPointIter != aPointDataMap.end(); aPointIter++ )
- {
- aRow++;
- TPointID aPointID = aPointIter.key();
- const TPointData& aPointData = aPointIter.value();
- const TValueData& aValueData = aPointData.ValueData;
-
- setData( aTableId, aRow, Point, aPointID );
- setData( aTableId, aRow, X, aPointData.X );
- setData( aTableId, aRow, Y, aPointData.Y );
- setData( aTableId, aRow, Z, aPointData.Z );
- setData( aTableId, aRow, I, aPointData.I );
- setData( aTableId, aRow, J, aPointData.J );
- setData( aTableId, aRow, K, aPointData.K );
- setData( aTableId, aRow, Scalar, aValueData.Scalar );
- setData( aTableId, aRow, Vector, aValueData.Vector );
- }
- }
- }
- break;
- }
- case PointStd:
- case PointElno:
- {
- int aRowCount = 0;
- TPointToCellDataMap::const_iterator aPointToCellIter = aPointToCellDataMap.begin();
- for( ; aPointToCellIter != aPointToCellDataMap.end(); aPointToCellIter++ )
- {
- const TPointToCellData& aPointToCellData = aPointToCellIter.value();
- const TCellDataMap& aCellDataMap = aPointToCellData.CellDataMap;
- int aNbCells = aCellDataMap.size();
- if( aNbCells > 1 )
- aRowCount += aNbCells;
- else
- aRowCount++;
- }
- aTable->setRowCount( aRowCount );
-
- aPointToCellIter = aPointToCellDataMap.begin();
- for( ; aPointToCellIter != aPointToCellDataMap.end(); aPointToCellIter++ )
- {
- aRow++;
-
- TPointID aPointID = aPointToCellIter.key();
- const TPointToCellData& aPointToCellData = aPointToCellIter.value();
- const TPointData& aPointData = aPointToCellData.PointData;
-
- setData( aTableId, aRow, Point, aPointID );
- setData( aTableId, aRow, X, aPointData.X );
- setData( aTableId, aRow, Y, aPointData.Y );
- setData( aTableId, aRow, Z, aPointData.Z );
- setData( aTableId, aRow, I, aPointData.I );
- setData( aTableId, aRow, J, aPointData.J );
- setData( aTableId, aRow, K, aPointData.K );
-
- if( aTableId == PointElno )
- {
- const TCellDataMap& aCellDataMap = aPointToCellData.CellDataMap;
- int aNbCells = aCellDataMap.size();
- if( aNbCells > 1 )
- for( int aColumnId = Point; aColumnId <= K; aColumnId++ )
- setRowSpan( aTableId, aRow, aColumnId, aNbCells );
-
- TCellDataMap::const_iterator aCellIter = aCellDataMap.begin();
- for( aRow--; aCellIter != aCellDataMap.end(); aCellIter++ )
- {
- aRow++;
- TCellID aCellID = aCellIter.key();
- const TValueData& aCellData = aCellIter.value();
-
- setData( aTableId, aRow, Cell, aCellID );
- setData( aTableId, aRow, Scalar, aCellData.Scalar );
- setData( aTableId, aRow, Vector, aCellData.Vector );
- }
- }
- else
- {
- const TValueData& aValueData = aPointData.ValueData;
- setData( aTableId, aRow, Scalar, aValueData.Scalar );
- setData( aTableId, aRow, Vector, aValueData.Vector );
- }
- }
- break;
- }
- }
-
- for( int aCol = column( aTableId, I ), aLastCol = column( aTableId, K ); aCol <= aLastCol; aCol++ )
- if( aCol != -1 )
- aTable->setColumnHidden( aCol, !isStructured );
- aTable->resizeColumnsToContents();
+ int aTableId = aTableIter.next();
+ if( !myTables.contains( aTableId ) )
+ continue;
+
+ QTableWidget* aTable = myTables[ aTableId ];
+ if( !aTable )
+ continue;
+
+ int aRow = -1;
+ switch( aTableId )
+ {
+ case CellStdPoint:
+ {
+ int aRowCount = aGlobalPointDataMap.size();
+ aTable->setRowCount( aRowCount );
+
+ TPointDataMap::const_iterator aPointIter = aGlobalPointDataMap.begin();
+ for( ; aPointIter != aGlobalPointDataMap.end(); aPointIter++ )
+ {
+ aRow++;
+ TPointID aPointID = aPointIter.key();
+ const TPointData& aPointData = aPointIter.value();
+ const TValueData& aValueData = aPointData.ValueData;
+
+ setData( aTableId, aRow, Point, aPointID );
+ setData( aTableId, aRow, X, aPointData.X );
+ setData( aTableId, aRow, Y, aPointData.Y );
+ setData( aTableId, aRow, Z, aPointData.Z );
+ setData( aTableId, aRow, I, aPointData.I );
+ setData( aTableId, aRow, J, aPointData.J );
+ setData( aTableId, aRow, K, aPointData.K );
+ setData( aTableId, aRow, Scalar, aValueData.Scalar );
+ setData( aTableId, aRow, Vector, aValueData.Vector );
+ }
+ break;
+ }
+ case CellStdCell:
+ case CellElno:
+ {
+ int aRowCount = 0;
+ TCellToPointDataMap::const_iterator aCellToPointIter = aCellToPointDataMap.begin();
+ for( ; aCellToPointIter != aCellToPointDataMap.end(); aCellToPointIter++ )
+ {
+ if( aTableId == CellStdCell )
+ aRowCount++;
+ else if( aTableId == CellElno )
+ {
+ const TCellToPointData& aCellToPointData = aCellToPointIter.value();
+ const TPointDataMap& aPointDataMap = aCellToPointData.PointDataMap;
+ int aNbPoints = aPointDataMap.size();
+
+ aRowCount += aNbPoints;
+ }
+ }
+ aTable->setRowCount( aRowCount );
+
+ aCellToPointIter = aCellToPointDataMap.begin();
+ for( ; aCellToPointIter != aCellToPointDataMap.end(); aCellToPointIter++ )
+ {
+ aRow++;
+
+ TCellID aCellID = aCellToPointIter.key();
+ const TCellToPointData& aCellToPointData = aCellToPointIter.value();
+ const TValueData& aCellData = aCellToPointData.CellData;
+
+ setData( aTableId, aRow, Cell, aCellID );
+ if( aTableId == CellStdCell )
+ {
+ setData( aTableId, aRow, Scalar, aCellData.Scalar );
+ setData( aTableId, aRow, Vector, aCellData.Vector );
+ }
+ else if( aTableId == CellElno )
+ {
+ const TPointDataMap& aPointDataMap = aCellToPointData.PointDataMap;
+ int aNbPoints = aPointDataMap.size();
+ if( aNbPoints > 1 )
+ setRowSpan( aTableId, aRow, Cell, aNbPoints );
+
+ TPointDataMap::const_iterator aPointIter = aPointDataMap.begin();
+ for( aRow--; aPointIter != aPointDataMap.end(); aPointIter++ )
+ {
+ aRow++;
+ TPointID aPointID = aPointIter.key();
+ const TPointData& aPointData = aPointIter.value();
+ const TValueData& aValueData = aPointData.ValueData;
+
+ setData( aTableId, aRow, Point, aPointID );
+ setData( aTableId, aRow, X, aPointData.X );
+ setData( aTableId, aRow, Y, aPointData.Y );
+ setData( aTableId, aRow, Z, aPointData.Z );
+ setData( aTableId, aRow, I, aPointData.I );
+ setData( aTableId, aRow, J, aPointData.J );
+ setData( aTableId, aRow, K, aPointData.K );
+ setData( aTableId, aRow, Scalar, aValueData.Scalar );
+ setData( aTableId, aRow, Vector, aValueData.Vector );
+ }
+ }
+ }
+ break;
+ }
+ case PointStd:
+ case PointElno:
+ {
+ int aRowCount = 0;
+ TPointToCellDataMap::const_iterator aPointToCellIter = aPointToCellDataMap.begin();
+ for( ; aPointToCellIter != aPointToCellDataMap.end(); aPointToCellIter++ )
+ {
+ const TPointToCellData& aPointToCellData = aPointToCellIter.value();
+ const TCellDataMap& aCellDataMap = aPointToCellData.CellDataMap;
+ int aNbCells = aCellDataMap.size();
+ if( aNbCells > 1 )
+ aRowCount += aNbCells;
+ else
+ aRowCount++;
+ }
+ aTable->setRowCount( aRowCount );
+
+ aPointToCellIter = aPointToCellDataMap.begin();
+ for( ; aPointToCellIter != aPointToCellDataMap.end(); aPointToCellIter++ )
+ {
+ aRow++;
+
+ TPointID aPointID = aPointToCellIter.key();
+ const TPointToCellData& aPointToCellData = aPointToCellIter.value();
+ const TPointData& aPointData = aPointToCellData.PointData;
+
+ setData( aTableId, aRow, Point, aPointID );
+ setData( aTableId, aRow, X, aPointData.X );
+ setData( aTableId, aRow, Y, aPointData.Y );
+ setData( aTableId, aRow, Z, aPointData.Z );
+ setData( aTableId, aRow, I, aPointData.I );
+ setData( aTableId, aRow, J, aPointData.J );
+ setData( aTableId, aRow, K, aPointData.K );
+
+ if( aTableId == PointElno )
+ {
+ const TCellDataMap& aCellDataMap = aPointToCellData.CellDataMap;
+ int aNbCells = aCellDataMap.size();
+ if( aNbCells > 1 )
+ for( int aColumnId = Point; aColumnId <= K; aColumnId++ )
+ setRowSpan( aTableId, aRow, aColumnId, aNbCells );
+
+ TCellDataMap::const_iterator aCellIter = aCellDataMap.begin();
+ for( aRow--; aCellIter != aCellDataMap.end(); aCellIter++ )
+ {
+ aRow++;
+ TCellID aCellID = aCellIter.key();
+ const TValueData& aCellData = aCellIter.value();
+
+ setData( aTableId, aRow, Cell, aCellID );
+ setData( aTableId, aRow, Scalar, aCellData.Scalar );
+ setData( aTableId, aRow, Vector, aCellData.Vector );
+ }
+ }
+ else
+ {
+ const TValueData& aValueData = aPointData.ValueData;
+ setData( aTableId, aRow, Scalar, aValueData.Scalar );
+ setData( aTableId, aRow, Vector, aValueData.Vector );
+ }
+ }
+ break;
+ }
+ }
+
+ for( int aCol = column( aTableId, I ), aLastCol = column( aTableId, K ); aCol <= aLastCol; aCol++ )
+ if( aCol != -1 )
+ aTable->setColumnHidden( aCol, !isStructured );
+ aTable->resizeColumnsToContents();
}
int stackId = isElno ? ElnoMesh : StdMesh;
QStackedWidget* aStackedWg = aType == 1 ? myCellStackedWg : aType == 2 ? myPointStackedWg : 0;
if( aStackedWg )
- aStackedWg->setCurrentIndex( stackId );
+ aStackedWg->setCurrentIndex( stackId );
}
}
myFl = false;
bool onIdEdit (const QString& theText,
TGetVTKIdMethod theMethod,
bool theIsCell,
- const SalomeApp_Module* theModule,
+ const SalomeApp_Module* theModule,
QLabel* theMeshName,
QString theValue,
QLabel* theFieldName)
{
int aVTKId = (aPipeLine->*theMethod)(anObjId);
if(aVTKId < 0)
- return false;
+ return false;
TColStd_MapOfInteger newIndices;
newIndices.Add(anObjId);
aViewWindow->highlight(anIO, true, true);
SVTK_RenderWindowInteractor* anInteractor = aViewWindow->GetInteractor();
- VISU_Actor* anActor = SVTK::Find<VISU_Actor>(anInteractor->getRenderer()->GetActors(),
- SVTK::TIsSameIObject<VISU_Actor>( anIO ));
+ VTK::ActorCollectionCopy aCopy(anInteractor->getRenderer()->GetActors());
+ VISU_Actor* anActor = SVTK::Find<VISU_Actor>(aCopy.GetActors(),
+ SVTK::TIsSameIObject<VISU_Actor>( anIO ));
anActor->Highlight( anIO );
return true;
if (myFl) return;
TGetVTKIdMethod aMethod = &VISU_PipeLine::GetNodeVTKID;
bool anIsSelected = onIdEdit(myIDValLbl->text(),
- aMethod,
- false,
- myModule,
- myMeshName,
- tr("WRN_NO_AVAILABLE_DATA"),
- myFieldName);
+ aMethod,
+ false,
+ myModule,
+ myMeshName,
+ tr("WRN_NO_AVAILABLE_DATA"),
+ myFieldName);
if (anIsSelected)
// as selection manager doesn't send signal currentSelectionChanged()
onSelectionEvent();
if (myFl) return;
TGetVTKIdMethod aMethod = &VISU_PipeLine::GetElemVTKID;
bool anIsSelected = onIdEdit(myCellIDValLbl->text(),
- aMethod,
- true,
- myModule,
- myMeshName,
- tr("WRN_NO_AVAILABLE_DATA"),
- myFieldName);
+ aMethod,
+ true,
+ myModule,
+ myMeshName,
+ tr("WRN_NO_AVAILABLE_DATA"),
+ myFieldName);
if (anIsSelected)
// as selection manager doesn't send signal currentSelectionChanged()
onSelectionEvent();
void VisuGUI_SelectionPanel::onClose()
{
- close();
+ //hide();
VisuGUI_Panel::onClose();
}
onHelp();
}
}
+
+void VisuGUI_SelectionPanel::onModuleActivated()
+{
+ disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+ this, SLOT( onSelectionEvent() ) );
+ connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+ this, SLOT( onSelectionEvent() ) );
+ VisuGUI_Panel::onModuleActivated();
+}
+
+void VisuGUI_SelectionPanel::onModuleDeactivated()
+{
+ disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+ this, SLOT( onSelectionEvent() ) );
+ VisuGUI_Panel::onModuleDeactivated();
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_SelectionPanel.h
// Author : Laurent CORNABE & Hubert ROLLAND
#ifndef VISUGUI_SELECTIONPANEL_H
#define VISUGUI_SELECTIONPANEL_H
-#include <VisuGUI_Panel.h>
+#include "VisuGUI_Panel.h"
#include <QMap>
enum ColumnId { Cell = 0, Point, X, Y, Z, I, J, K, Scalar, Vector };
public:
- VisuGUI_SelectionPanel( const VisuGUI* theModule, QWidget* theParent = 0 );
+ VisuGUI_SelectionPanel( VisuGUI* theModule, QWidget* theParent = 0 );
virtual ~VisuGUI_SelectionPanel ();
public:
void setSelectionMode( int theId );
+protected slots:
+ virtual void onModuleActivated();
+ virtual void onModuleDeactivated();
+
protected:
virtual void keyPressEvent( QKeyEvent* theEvent );
virtual void showEvent( QShowEvent* theEvent );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_SelectionPrefDlg.cxx
// Author : Oleg UVAROV
// Module : SALOME
//
#include "VisuGUI_SelectionPrefDlg.h"
#include "VisuGUI.h"
+#include "VisuGUI_Tools.h"
#include "VISU_PickingSettings.h"
#include <LightApp_Application.h>
+#include <SalomeApp_IntSpinBox.h>
+#include <SalomeApp_DoubleSpinBox.h>
+
#include <QtxColorButton.h>
-#include <QtxDoubleSpinBox.h>
-#include <QtxIntSpinBox.h>
#include <QComboBox>
#include <QGroupBox>
#include <QLineEdit>
#include <QPushButton>
-using namespace std;
-
/*!
Constructor
*/
VisuGUI_SelectionPrefDlg::VisuGUI_SelectionPrefDlg( QWidget* parent )
: QDialog( parent ? parent : SUIT_Session::session()->activeApplication()->desktop(),
- Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
+ Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
{
setWindowTitle( tr("TLT_SELECTION_PREFERENCES") );
setSizeGripEnabled( TRUE );
CursorGroupLayout->setMargin(11);
QLabel* CursorSizeLabel = new QLabel( tr( "CURSOR_SIZE" ), CursorGroup );
- myCursorSizeSpinBox = new QtxDoubleSpinBox( 0, 1, 0.1, CursorGroup );
+ myCursorSizeSpinBox = new SalomeApp_DoubleSpinBox( CursorGroup );
+ VISU::initSpinBox( myCursorSizeSpinBox, 0, 1, 0.1, "parametric_precision" );
myCursorSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
QLabel* PyramidHeightLabel = new QLabel( tr( "PYRAMID_HEIGHT" ), CursorGroup );
double aHeightMin=1.e-7;
double aHeightMax=10.;
double aHeightStep=0.1;
- myPyramidHeightSpinBox = new QtxDoubleSpinBox(aHeightMin, aHeightMax, aHeightStep, CursorGroup );
+ myPyramidHeightSpinBox = new SalomeApp_DoubleSpinBox(CursorGroup );
+ VISU::initSpinBox( myPyramidHeightSpinBox, aHeightMin, aHeightMax, aHeightStep, "length_precision" );
myPyramidHeightSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
QLabel* SelectionColorLabel = new QLabel( tr( "SELECTION_COLOR" ), CursorGroup );
ToleranceGroupLayout->setMargin(11);
QLabel* PointToleranceLabel = new QLabel( tr( "POINT_TOLERANCE" ), ToleranceGroup );
- myPointToleranceSpinBox = new QtxDoubleSpinBox( 0.001, 10.0, 0.01, ToleranceGroup );
+ myPointToleranceSpinBox = new SalomeApp_DoubleSpinBox(ToleranceGroup );
+ VISU::initSpinBox( myPointToleranceSpinBox, 0.001, 10.0, 0.01, "len_tol_precision" );
myPointToleranceSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
ToleranceGroupLayout->addWidget( PointToleranceLabel, 0, 0 );
InfoWindowGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
QLabel* TransparencyLabel = new QLabel( tr( "TRANSPARENCY" ), myInfoWindowGroup );
- myTransparencySpinBox = new QtxIntSpinBox( 0, 100, 10, myInfoWindowGroup );
+ myTransparencySpinBox = new SalomeApp_IntSpinBox( 0, 100, 10, myInfoWindowGroup );
+ myTransparencySpinBox->setAcceptNames( false );
myTransparencySpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
InfoWindowGroupLayout->addWidget( TransparencyLabel, 0, 0 );
CameraGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
QLabel* ZoomFactorLabel = new QLabel( tr( "ZOOM_FACTOR" ), myCameraGroup );
- myZoomFactorSpinBox = new QtxDoubleSpinBox( 0.1, 10.0, 0.1, myCameraGroup );
+ myZoomFactorSpinBox = new SalomeApp_DoubleSpinBox( myCameraGroup );
+ VISU::initSpinBox( myZoomFactorSpinBox, 0.1, 10.0, 0.1, "parametric_precision" );
myZoomFactorSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
QLabel* StepNumberLabel = new QLabel( tr( "STEP_NUMBER" ), myCameraGroup );
StepNumberLabel->setToolTip( tr( "STEP_NUMBER_TIP" ) );
- myStepNumberSpinBox = new QtxIntSpinBox( 1, 100, 1, myCameraGroup );
+ myStepNumberSpinBox = new SalomeApp_IntSpinBox( 1, 100, 1, myCameraGroup );
+ myStepNumberSpinBox->setAcceptNames( false );
myStepNumberSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
CameraGroupLayout->addWidget( ZoomFactorLabel, 0, 0 );
vtkFloatingPointType* aColor = aPickingSettings->GetColor();
mySelectionColorButton->setColor( QColor( ( int )( aColor[0] * 255.0 ),
- ( int )( aColor[1] * 255.0 ),
- ( int )( aColor[2] * 255.0 ) ) );
+ ( int )( aColor[1] * 255.0 ),
+ ( int )( aColor[2] * 255.0 ) ) );
myInfoWindowGroup->setChecked( aPickingSettings->GetInfoWindowEnabled() );
- myTransparencySpinBox->setValue( int(aPickingSettings->GetInfoWindowTransparency() * 100.0) );
+ // VSR 28.06.2011 : IPAL 22513: add 0.5 to eliminate any prevision problems
+ vtkFloatingPointType transparency = aPickingSettings->GetInfoWindowTransparency() * 100.0 + 0.5;
+ myTransparencySpinBox->setValue( (int) transparency );
myPositionComboBox->setCurrentIndex( aPickingSettings->GetInfoWindowPosition() );
myCameraGroup->setChecked( aPickingSettings->GetCameraMovementEnabled() );
myZoomFactorSpinBox->setValue( aPickingSettings->GetZoomFactor() );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_SelectionPrefDlg.cxx
// Author : Oleg UVAROV
// Module : SALOME
class QPushButton;
class QtxColorButton;
-class QtxDoubleSpinBox;
-class QtxIntSpinBox;
+class SalomeApp_DoubleSpinBox;
+class SalomeApp_IntSpinBox;
class VisuGUI_SelectionPrefDlg : public QDialog
{
void onHelp();
private:
- QtxDoubleSpinBox* myCursorSizeSpinBox;
- QtxDoubleSpinBox* myPyramidHeightSpinBox;
+ SalomeApp_DoubleSpinBox* myCursorSizeSpinBox;
+ SalomeApp_DoubleSpinBox* myPyramidHeightSpinBox;
QtxColorButton* mySelectionColorButton;
- QtxDoubleSpinBox* myPointToleranceSpinBox;
+ SalomeApp_DoubleSpinBox* myPointToleranceSpinBox;
QGroupBox* myInfoWindowGroup;
- QtxIntSpinBox* myTransparencySpinBox;
+ SalomeApp_IntSpinBox* myTransparencySpinBox;
QComboBox* myPositionComboBox;
QGroupBox* myCameraGroup;
- QtxDoubleSpinBox* myZoomFactorSpinBox;
- QtxIntSpinBox* myStepNumberSpinBox;
+ SalomeApp_DoubleSpinBox* myZoomFactorSpinBox;
+ SalomeApp_IntSpinBox* myStepNumberSpinBox;
QPushButton* myButtonOk;
QPushButton* myButtonApply;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_SetupPlot2dDlg.cxx
// Author : Vadim SANDLER
// Module : SALOME
#include "LightApp_Application.h"
+#include <SalomeApp_IntSpinBox.h>
+
#include <QtxColorButton.h>
#include <SALOMEDSClient_AttributeTableOfInteger.hxx>
#include <QScrollArea>
#include <QLayout>
#include <QColorDialog>
-#include <QSpinBox>
#include <QKeyEvent>
#include <QFrame>
#include "utilities.h"
-using namespace std;
-
#define DLG_SIZE_WIDTH 500
#define DLG_SIZE_HEIGHT 400
#define MAX_LINE_WIDTH 100
/*!
Constructor
*/
-VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, QWidget* parent )
- : QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
+VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, VISU::Table_i* table , QWidget* parent )
+ : QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
+ myTable(table)
{
setModal( true );
setWindowTitle( tr("TLT_SETUP_PLOT2D") );
QLabel* labAssigned = new QLabel( tr( "ASSIGNED" ), frame );
QLabel* labData = new QLabel( tr( "DATA_LBL" ), frame );
QLabel* labUnit = new QLabel( tr( "UNITS_LBL" ), frame );
+ QLabel* labDvtn = new QLabel( tr( "DVTN_LBL" ), frame );
QLabel* labAttr = new QLabel( tr( "ATTRIBUTES_LBL" ), frame );
labAxis->setAlignment( Qt::AlignCenter );
labAssigned->setAlignment( Qt::AlignCenter );
labData->setAlignment( Qt::AlignCenter );
labUnit->setAlignment( Qt::AlignCenter );
+ labDvtn->setAlignment( Qt::AlignCenter );
labAttr->setAlignment( Qt::AlignCenter );
QFont font = labAxis->font(); font.setBold( true );
labAxis->setFont( font );
labAssigned->setFont( font );
labData->setFont( font );
labUnit->setFont( font );
+ labDvtn->setFont( font );
labAttr->setFont( font );
- frameLayout->addWidget( labAxis, 0, 0, 1, 2 );
+ frameLayout->addWidget( labAxis, 0, 0, 1, 3 );
+ lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
+ frameLayout->addWidget( lin, 0, 3 );
+
+ frameLayout->addWidget( labAssigned, 0, 4 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 0, 2 );
+ frameLayout->addWidget( lin, 0, 5 );
- frameLayout->addWidget( labAssigned, 0, 3 );
+ frameLayout->addWidget( labData, 0, 6 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 0, 4 );
+ frameLayout->addWidget( lin, 0, 7 );
- frameLayout->addWidget( labData, 0, 5 );
+ frameLayout->addWidget( labUnit, 0, 8 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 0, 6 );
- frameLayout->addWidget( labUnit, 0, 7 );
+ frameLayout->addWidget( lin, 0, 9 );
+
+ frameLayout->addWidget( labDvtn, 0, 10 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 0, 8 );
- frameLayout->addWidget( labAttr, 0, 9, 1, 5 );
- //frameLayout->setColStretch( 14, 5 );
+ frameLayout->addWidget( lin, 0, 11 );
+
+ frameLayout->addWidget( labAttr, 0, 12, 1, 5 );
+ //frameLayout->setColStretch( 15, 5 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::HLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 1, 0, 1, 15 );
+ frameLayout->addWidget( lin, 1, 0, 1, 17 );
int row = 2;
_PTR(GenericAttribute) anAttr;
tblIntAttr = anAttr;
if ( tblIntAttr ) {
try {
- int nbRows = tblIntAttr->GetNbRows() ;
- vector<string> rowTitles = tblIntAttr->GetRowTitles();
- vector<string> rowUnits = tblIntAttr->GetRowUnits();
- QStringList rows;
- for ( int i = 0; i < nbRows; i++ )
- rows.append( rowTitles[i].c_str() );
-
- for ( int i = 0; i < nbRows; i++ ) {
- VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this );
- item->createWidgets( frame, rows );
- frameLayout->addWidget( item->myHBtn, row, 0 );
- frameLayout->addWidget( item->myVBtn, row, 1 );
- frameLayout->addWidget( item->myAssigned, row, 3 );
-
- frameLayout->addWidget( item->myTitleLab, row, 5 );
- if ( rowTitles.size() > 0 )
- item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
- frameLayout->addWidget( item->myUnitLab, row, 7 );
- if ( rowUnits.size() > 0 )
- item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
- frameLayout->addWidget( item->myAutoCheck, row, 9 );
- frameLayout->addWidget( item->myLineCombo, row, 10 );
- frameLayout->addWidget( item->myLineSpin, row, 11 );
- frameLayout->addWidget( item->myMarkerCombo, row, 12 );
- frameLayout->addWidget( item->myColorBtn, row, 13 );
- connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
- connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
- myItems.append( item );
- row++;
- }
+ int nbRows = tblIntAttr->GetNbRows() ;
+ std::vector<std::string> rowTitles = tblIntAttr->GetRowTitles();
+ std::vector<std::string> rowUnits = tblIntAttr->GetRowUnits();
+ QStringList rows;
+ for ( int i = 0; i < nbRows; i++ ) {
+ if(myTable && myTable->isDeviationRow(i)) continue;
+ rows.append( rowTitles[i].c_str() );
+ }
+
+ int nbItems=0;
+ for ( int i = 0; i < nbRows; i++ ) {
+ if(myTable && myTable->isDeviationRow(i)) continue;
+ VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this );
+ item->createWidgets( frame, rows );
+ frameLayout->addWidget( item->myHBtn, row, 0 );
+ frameLayout->addWidget( item->myVBtn, row, 1 );
+ frameLayout->addWidget( item->myV2Btn, row, 2 );
+ frameLayout->addWidget( item->myAssigned, row, 4 );
+
+ frameLayout->addWidget( item->myTitleLab, row, 6 );
+ if ( rowTitles.size() > 0 )
+ item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
+ frameLayout->addWidget( item->myUnitLab, row, 8 );
+ if ( rowUnits.size() > 0 )
+ item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
+
+ frameLayout->addWidget( item->myDvtnLab, row, 10 );
+ if(myTable && myTable->hasDeviationData(i)) {
+ QString lbl = VISU::Table_i::deviationLabel(myTable->getDeviationInfo(i));
+ if(lbl.size() > 0 )
+ item->myDvtnLab->setText(lbl);
+ }
+
+ frameLayout->addWidget( item->myAutoCheck, row, 12 );
+ frameLayout->addWidget( item->myLineCombo, row, 13 );
+ frameLayout->addWidget( item->myLineSpin, row, 14 );
+ frameLayout->addWidget( item->myMarkerCombo, row, 15 );
+ frameLayout->addWidget( item->myColorBtn, row, 16 );
+ connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
+ connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
+ connect( item, SIGNAL( ver2Toggled( bool ) ), this, SLOT( onV2BtnToggled( bool ) ) );
+ myItems.append( item );
+ myIdxMap[nbItems] = i;
+ nbItems++;
+ row++;
+ }
}
catch( ... ) {
- MESSAGE("VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg : Exception has been caught (int)!!!");
+ MESSAGE("VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg : Exception has been caught (int)!!!");
}
}
}
tblRealAttr = anAttr;
if ( tblRealAttr ) {
try {
- int nbRows = tblRealAttr->GetNbRows() ;
- vector<string> rowTitles = tblRealAttr->GetRowTitles();
- vector<string> rowUnits = tblRealAttr->GetRowUnits();
- QStringList rows;
- for ( int i = 0; i < nbRows; i++ )
- rows.append( rowTitles[i].c_str() );
-
- for ( int i = 0; i < nbRows; i++ ) {
- VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this );
- item->createWidgets( frame, rows );
- frameLayout->addWidget( item->myHBtn, row, 0 );
- frameLayout->addWidget( item->myVBtn, row, 1 );
- frameLayout->addWidget( item->myAssigned, row, 3 );
-
- frameLayout->addWidget( item->myTitleLab, row, 5 );
- if ( rowTitles.size() > 0 )
- item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
- frameLayout->addWidget( item->myUnitLab, row, 7 );
- if ( rowUnits.size() > 0 )
- item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
- frameLayout->addWidget( item->myAutoCheck, row, 9 );
- frameLayout->addWidget( item->myLineCombo, row, 10 );
- frameLayout->addWidget( item->myLineSpin, row, 11 );
- frameLayout->addWidget( item->myMarkerCombo, row, 12 );
- frameLayout->addWidget( item->myColorBtn, row, 13 );
- connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
- connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
- myItems.append( item );
- row++;
- }
+ int nbRows = tblRealAttr->GetNbRows() ;
+ std::vector<std::string> rowTitles = tblRealAttr->GetRowTitles();
+ std::vector<std::string> rowUnits = tblRealAttr->GetRowUnits();
+ QStringList rows;
+ for ( int i = 0; i < nbRows; i++ ) {
+ if(myTable && myTable->isDeviationRow(i)) continue;
+ rows.append( rowTitles[i].c_str() );
+ }
+ int nbItems = 0;
+ for ( int i = 0; i < nbRows; i++ ) {
+ if(myTable && myTable->isDeviationRow(i)) continue;
+ VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this );
+ item->createWidgets( frame, rows );
+ frameLayout->addWidget( item->myHBtn, row, 0 );
+ frameLayout->addWidget( item->myVBtn, row, 1 );
+ frameLayout->addWidget( item->myV2Btn, row, 2 );
+ frameLayout->addWidget( item->myAssigned, row, 4 );
+
+ frameLayout->addWidget( item->myTitleLab, row, 6 );
+ if ( rowTitles.size() > 0 )
+ item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
+ frameLayout->addWidget( item->myUnitLab, row, 8 );
+ if ( rowUnits.size() > 0 )
+ item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
+
+ frameLayout->addWidget( item->myDvtnLab, row, 10 );
+
+ frameLayout->addWidget( item->myDvtnLab, row, 10 );
+ if(myTable && myTable->hasDeviationData(i)) {
+ QString lbl = VISU::Table_i::deviationLabel(myTable->getDeviationInfo(i));
+ if(lbl.size() > 0 )
+ item->myDvtnLab->setText(lbl);
+ }
+
+ frameLayout->addWidget( item->myAutoCheck, row, 12 );
+ frameLayout->addWidget( item->myLineCombo, row, 13 );
+ frameLayout->addWidget( item->myLineSpin, row, 14 );
+ frameLayout->addWidget( item->myMarkerCombo, row, 15 );
+ frameLayout->addWidget( item->myColorBtn, row, 16 );
+ connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
+ connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
+ connect( item, SIGNAL( ver2Toggled( bool ) ), this, SLOT( onV2BtnToggled( bool ) ) );
+ myItems.append( item );
+ myIdxMap[nbItems] = i;
+ nbItems++;
+ row++;
+ }
}
catch( ... ) {
- MESSAGE("VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg : Exception has been caught (real)!!!");
+ MESSAGE("VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg : Exception has been caught (real)!!!");
}
}
}
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 2, 2, row, 1 );
+ frameLayout->addWidget( lin, 2, 3, row, 1 );
+ lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
+ frameLayout->addWidget( lin, 2, 5, row, 1 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 2, 4, row, 1 );
+ frameLayout->addWidget( lin, 2, 7, row, 1 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 2, 6, row, 1 );
+ frameLayout->addWidget( lin, 2, 9, row, 1 );
+ lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
+ frameLayout->addWidget( lin, 2, 11, row, 1 );
+
//frameLayout->setRowStretch( row+1, 5 );
myView->setWidget( frame );
Gets curves info ( indexes of row data in the table for horizontal and verical axes )
*/
void VisuGUI_SetupPlot2dDlg::getCurvesSource( int& horIndex, QList<int>& verIndexes,
- QList<int>& zIndices )
+ QList<int>& ver2Indexes, QList<int>& zIndices )
{
/* collecting horizontal and vertical axis items */
horIndex = -1;
if ( myItems.at( i )->isHorizontalOn() ) {
horIndex = i;
}
- else if ( myItems.at( i )->isVerticalOn() ) {
- verIndexes.append( i );
- zIndices.append( myItems.at( i )->assigned() );
+ else {
+ if ( myItems.at( i )->isVerticalOn() ) {
+ verIndexes.append( i );
+ }
+ else if ( myItems.at( i )->isVertical2On() ) {
+ ver2Indexes.append( i );
+ }
+ zIndices.append( idx(myItems.at( i )->assigned()) );
}
-
}
}
/*!
Gets curve attributes
*/
bool VisuGUI_SetupPlot2dDlg::getCurveAttributes( const int vIndex,
- bool& isAuto,
- int& marker,
- int& line,
- int& lineWidth,
- QColor& color)
+ bool& isAuto,
+ int& marker,
+ int& line,
+ int& lineWidth,
+ QColor& color)
{
if ( vIndex >= 0 && vIndex < myItems.count() ) {
isAuto = myItems.at( vIndex )->isAutoAssign();
/* collecting horizontal and vertical axis items */
int horIndex;
int i, j;
- QList<int> verIndex, zIndices;
- getCurvesSource( horIndex, verIndex, zIndices );
- if ( horIndex < 0 || verIndex.isEmpty() ) /* no curves can be created */
+ QList<int> verIndex, ver2Index, zIndices;
+ getCurvesSource( horIndex, verIndex, ver2Index, zIndices );
+ if ( horIndex < 0 || verIndex.isEmpty() && ver2Index.isEmpty() ) /* no curves can be created */
return;
/* Try table of integer */
tblIntAttr = anAttr;
if ( tblIntAttr ) {
try {
- int nbCols = tblIntAttr->GetNbColumns() ;
- vector<string> rowTitles = tblIntAttr->GetRowTitles();
- vector<string> rowUnits = tblIntAttr->GetRowUnits();
-
- for ( i = 0; i < verIndex.count(); i++ ) {
- SPlot2d_Curve* curve = new SPlot2d_Curve();
- // curve titles
- if ( rowTitles.size() > 0 ) {
- curve->setHorTitle( QString( rowTitles[ horIndex ].c_str() ) );
- curve->setVerTitle( QString( rowTitles[ verIndex[i] ].c_str() ) );
- }
- // curve units
- if ( rowUnits.size() > 0 ) {
- curve->setHorUnits( QString( rowUnits[ horIndex ].c_str() ) );
- curve->setVerUnits( QString( rowUnits[ verIndex[i] ].c_str() ) );
- }
- // curve data
- int nbPoints = 0;
- for ( j = 1; j <= nbCols; j++ ) {
- if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) )
- nbPoints++;
- }
- if ( nbPoints > 0 ) {
- double* xList = new double[ nbPoints ];
- double* yList = new double[ nbPoints ];
- QStringList zList;
- for ( j = 1; j <= nbCols; j++ ) {
- if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) ) {
- xList[j-1] = tblIntAttr->GetValue( horIndex +1, j );
- yList[j-1] = tblIntAttr->GetValue( verIndex[i]+1, j );
- zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( zIndices[i]+1, j ) ) );
- }
- }
- curve->setData( xList, yList, nbPoints, zList );
- }
- // curve attributes
- curve->setLine( (Plot2d::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
- curve->setMarker( (Plot2d::MarkerType)myItems.at( verIndex[i] )->getMarker() );
- curve->setColor( myItems.at( verIndex[i] )->getColor() );
- curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
- // add curve into container
- container.append( curve );
- }
+ int nbCols = tblIntAttr->GetNbColumns() ;
+ std::vector<std::string> rowTitles = tblIntAttr->GetRowTitles();
+ std::vector<std::string> rowUnits = tblIntAttr->GetRowUnits();
+
+ for ( i = 0; i < verIndex.count(); i++ ) {
+ SPlot2d_Curve* curve = new SPlot2d_Curve();
+ // curve titles
+ if ( rowTitles.size() > 0 ) {
+ curve->setHorTitle( QString( rowTitles[ idx(horIndex) ].c_str() ) );
+ curve->setVerTitle( QString( rowTitles[ idx(verIndex[i]) ].c_str() ) );
+ }
+ // curve units
+ if ( rowUnits.size() > 0 ) {
+ curve->setHorUnits( QString( rowUnits[ idx(horIndex) ].c_str() ) );
+ curve->setVerUnits( QString( rowUnits[ idx(verIndex[i]) ].c_str() ) );
+ }
+ // curve data
+ int nbPoints = 0;
+ for ( j = 1; j <= nbCols; j++ ) {
+ if ( tblIntAttr->HasValue( idx(horIndex) + 1, j ) && tblIntAttr->HasValue( idx(verIndex[i])+1, j ) )
+ nbPoints++;
+ }
+ if ( nbPoints > 0 ) {
+ double* xList = new double[ nbPoints ];
+ double* yList = new double[ nbPoints ];
+ QStringList zList;
+ for ( j = 1; j <= nbCols; j++ ) {
+ if ( tblIntAttr->HasValue( idx(horIndex)+1, j ) && tblIntAttr->HasValue( idx(verIndex[i])+1, j ) ) {
+ xList[j-1] = tblIntAttr->GetValue( idx(horIndex) +1, j );
+ yList[j-1] = tblIntAttr->GetValue( idx(verIndex[i])+1, j );
+ zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( idx(zIndices[i])+1, j ) ) );
+ }
+ }
+ curve->setData( xList, yList, nbPoints, zList );
+ }
+ // curve attributes
+ curve->setLine( (Plot2d::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
+ curve->setMarker( (Plot2d::MarkerType)myItems.at( verIndex[i] )->getMarker() );
+ curve->setColor( myItems.at( verIndex[i] )->getColor() );
+ curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
+ // add curve into container
+ container.append( curve );
+ }
}
catch( ... ) {
- MESSAGE("VisuGUI_SetupPlot2dDlg::getCurves : Exception has been caught (int)!!!");
+ MESSAGE("VisuGUI_SetupPlot2dDlg::getCurves : Exception has been caught (int)!!!");
}
}
}
tblRealAttr = anAttr;
if ( tblRealAttr ) {
try {
- int nbCols = tblRealAttr->GetNbColumns() ;
- vector<string> rowTitles = tblRealAttr->GetRowTitles();
- vector<string> rowUnits = tblRealAttr->GetRowUnits();
-
- for ( i = 0; i < verIndex.count(); i++ ) {
- SPlot2d_Curve* curve = new SPlot2d_Curve();
- // curve titles
- if ( rowTitles.size() > 0 ) {
- curve->setHorTitle( QString( rowTitles[ horIndex ].c_str() ) );
- curve->setVerTitle( QString( rowTitles[ verIndex[i] ].c_str() ) );
- }
- // curve units
- if ( rowUnits.size() > 0 ) {
- curve->setHorUnits( QString( rowUnits[ horIndex ].c_str() ) );
- curve->setVerUnits( QString( rowUnits[ verIndex[i] ].c_str() ) );
- }
- // curve data
- int nbPoints = 0;
- for ( j = 1; j <= nbCols; j++ ) {
- if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) )
- nbPoints++;
- }
- if ( nbPoints > 0 ) {
- double* xList = new double[ nbPoints ];
- double* yList = new double[ nbPoints ];
- QStringList zList;
- for ( j = 1; j <= nbCols; j++ ) {
- if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) ) {
- xList[j-1] = tblRealAttr->GetValue( horIndex +1, j );
- yList[j-1] = tblRealAttr->GetValue( verIndex[i]+1, j );
- zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( zIndices[i]+1, j ) ) );
- }
- }
- curve->setData( xList, yList, nbPoints, zList );
- }
- // curve attributes
- curve->setLine( (Plot2d::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
- curve->setMarker( (Plot2d::MarkerType)myItems.at( verIndex[i] )->getMarker() );
- curve->setColor( myItems.at( verIndex[i] )->getColor() );
- curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
- // add curve into container
- container.append( curve );
- }
+ int nbCols = tblRealAttr->GetNbColumns() ;
+ std::vector<std::string> rowTitles = tblRealAttr->GetRowTitles();
+ std::vector<std::string> rowUnits = tblRealAttr->GetRowUnits();
+
+ for ( i = 0; i < verIndex.count(); i++ ) {
+ SPlot2d_Curve* curve = new SPlot2d_Curve();
+ // curve titles
+ if ( rowTitles.size() > 0 ) {
+ curve->setHorTitle( QString( rowTitles[ idx(horIndex) ].c_str() ) );
+ curve->setVerTitle( QString( rowTitles[ idx(verIndex[i]) ].c_str() ) );
+ }
+ // curve units
+ if ( rowUnits.size() > 0 ) {
+ curve->setHorUnits( QString( rowUnits[ idx(horIndex) ].c_str() ) );
+ curve->setVerUnits( QString( rowUnits[ idx(verIndex[i]) ].c_str() ) );
+ }
+ // curve data
+ int nbPoints = 0;
+ for ( j = 1; j <= nbCols; j++ ) {
+ if ( tblRealAttr->HasValue( idx(horIndex)+1, j ) && tblRealAttr->HasValue( idx(verIndex[i])+1, j ) )
+ nbPoints++;
+ }
+ if ( nbPoints > 0 ) {
+ double* xList = new double[ nbPoints ];
+ double* yList = new double[ nbPoints ];
+ QStringList zList;
+ for ( j = 1; j <= nbCols; j++ ) {
+ if ( tblRealAttr->HasValue( idx(horIndex)+1, j ) && tblRealAttr->HasValue( idx(verIndex[i])+1, j ) ) {
+ xList[j-1] = tblRealAttr->GetValue( idx(horIndex) +1, j );
+ yList[j-1] = tblRealAttr->GetValue( idx(verIndex[i])+1, j );
+ zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( idx(zIndices[i])+1, j ) ) );
+ }
+ }
+ curve->setData( xList, yList, nbPoints, zList );
+ }
+ // curve attributes
+ curve->setLine( (Plot2d::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
+ curve->setMarker( (Plot2d::MarkerType)myItems.at( verIndex[i] )->getMarker() );
+ curve->setColor( myItems.at( verIndex[i] )->getColor() );
+ curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
+ // add curve into container
+ container.append( curve );
+ }
}
catch( ... ) {
- MESSAGE("VisuGUI_SetupPlot2dDlg::getCurves : Exception has been caught (real)!!!");
+ MESSAGE("VisuGUI_SetupPlot2dDlg::getCurves : Exception has been caught (real)!!!");
}
}
}
if ( on ) {
for ( int i = 0; i < myItems.count(); i++ ) {
if ( myItems.at( i ) != item )
- myItems.at( i )->setHorizontalOn( false );
+ myItems.at( i )->setHorizontalOn( false );
}
}
enableControls();
int totalOn = 0;
for ( i = 0; i < myItems.count(); i++ ) {
if ( myItems.at( i ) != item && !myItems.at( i )->isHorizontalOn() ) {
- if ( myItems.at( i )->myUnitLab->text() == item->myUnitLab->text() ) {
- if ( myItems.at( i )->isVerticalOn() )
- totalOn++;
- else
- itemList.append( myItems.at( i ) );
- }
- else {
- myItems.at( i )->setVerticalOn( false );
- }
+ if ( myItems.at( i )->myUnitLab->text() == item->myUnitLab->text() ) {
+ if ( myItems.at( i )->isVerticalOn() )
+ totalOn++;
+ else
+ itemList.append( myItems.at( i ) );
+ }
+ else {
+ myItems.at( i )->setVerticalOn( false );
+ }
}
}
if ( totalOn == 0 && !itemList.isEmpty() &&
- SUIT_MessageBox::information( this,
+ SUIT_MessageBox::information( this,
this->windowTitle(),
tr( "QUE_WANT_SAME_UNITS" ),
tr( "BUT_YES" ),
1, 1 ) == 0 )
{
for ( i = 0; i < itemList.count(); i++ ) {
- itemList.at( i )->blockSignals( true );
- itemList.at( i )->setVerticalOn( true );
- itemList.at( i )->blockSignals( false );
+ itemList.at( i )->blockSignals( true );
+ itemList.at( i )->setVerticalOn( true );
+ itemList.at( i )->blockSignals( false );
+ }
+ }
+ }
+ enableControls();
+}
+/*!
+ Slot, called when any <V2> button is clicked
+*/
+void VisuGUI_SetupPlot2dDlg::onV2BtnToggled( bool on )
+{
+ VisuGUI_ItemContainer* item = ( VisuGUI_ItemContainer* )sender();
+ QList<VisuGUI_ItemContainer*> itemList;
+ //itemList.setAutoDelete( false );
+ item->myAssigned->setEnabled( on );
+ int i;
+ if ( on ) {
+ int totalOn = 0;
+ for ( i = 0; i < myItems.count(); i++ ) {
+ if ( myItems.at( i ) != item && !myItems.at( i )->isHorizontalOn() ) {
+ if ( myItems.at( i )->myUnitLab->text() == item->myUnitLab->text() ) {
+ if ( myItems.at( i )->isVertical2On() )
+ totalOn++;
+ else
+ itemList.append( myItems.at( i ) );
+ }
+ else {
+ myItems.at( i )->setVertical2On( false );
+ }
+ }
+ }
+ if ( totalOn == 0 && !itemList.isEmpty() &&
+ SUIT_MessageBox::information( this,
+ this->windowTitle(),
+ tr( "QUE_WANT_SAME_UNITS" ),
+ tr( "BUT_YES" ),
+ tr( "BUT_NO" ),
+ 1, 1 ) == 0 )
+ {
+ for ( i = 0; i < itemList.count(); i++ ) {
+ itemList.at( i )->blockSignals( true );
+ itemList.at( i )->setVertical2On( true );
+ itemList.at( i )->blockSignals( false );
}
}
}
*/
void VisuGUI_SetupPlot2dDlg::onHelp()
{
- QString aHelpFileName = "plot2d_viewer_page.html";
+ QString aHelpFileName = "creating_curves_page.html";
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
if (app) {
VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
}
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(0, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
break;
}
}
-#ifndef WNT
for ( int i = 0; i < myItems.count(); i++ ) {
-#else
- for ( i = 0; i < myItems.count(); i++ ) {
-#endif
- if ( myItems.at( i )->isVerticalOn() )
+ bool isVOn = myItems.at( i )->isVerticalOn() || myItems.at( i )->isVertical2On();
+ if ( isVOn )
bVSet = true;
- myItems.at( i )->enableWidgets( bHSet && myItems.at( i )->isVerticalOn() );
+ myItems.at( i )->enableWidgets( bHSet && isVOn );
}
myOkBtn->setEnabled( bHSet && bVSet );
}
myVBtn->setCheckable( true );
myVBtn->setChecked( false );
+ myV2Btn = new QToolButton( parentWidget );
+ myV2Btn->setText( tr( "V2" ) );
+ myV2Btn->setCheckable( true );
+ myV2Btn->setChecked( false );
+
myTitleLab = new QLabel( parentWidget );
myUnitLab = new QLabel( parentWidget );
myUnitLab->setAlignment( Qt::AlignCenter);
+
+ myDvtnLab = new QLabel( parentWidget );
+ myDvtnLab->setAlignment( Qt::AlignCenter);
myAutoCheck = new QCheckBox( tr( "AUTO_CHECK_LBL" ), parentWidget );
myAutoCheck->setChecked( true );
myLineCombo->addItem( tr( "DAHSDOTDOT_LINE_LBL" ) );
myLineCombo->setCurrentIndex( 1 ); // SOLID by default
- myLineSpin = new QSpinBox( parentWidget );
+ myLineSpin = new SalomeApp_IntSpinBox( parentWidget );
+ myLineSpin->setAcceptNames( false );
myLineSpin->setMinimum( 0 );
myLineSpin->setMaximum( MAX_LINE_WIDTH );
myLineSpin->setSingleStep( 1 );
//connect( myColorBtn, SIGNAL( clicked() ), this, SLOT( onColorChanged() ) );
connect( myHBtn, SIGNAL( toggled( bool ) ), this, SLOT( onHVToggled( bool ) ) );
connect( myVBtn, SIGNAL( toggled( bool ) ), this, SLOT( onHVToggled( bool ) ) );
+ connect( myV2Btn, SIGNAL( toggled( bool ) ), this, SLOT( onHVToggled( bool ) ) );
setColor( QColor( 0, 0, 0 ) );
updateState();
}
return myHBtn->isChecked();
}
/*!
- Sets vertical button's state on
+ Sets first vertical button's state on
*/
void VisuGUI_ItemContainer::setVerticalOn( bool on )
{
myVBtn->setChecked( on );
}
/*!
- Gets vertical button's state
+ Gets first vertical button's state
*/
bool VisuGUI_ItemContainer::isVerticalOn() const
{
return myVBtn->isChecked();
}
+/*!
+ Sets second vertical button's state on
+*/
+void VisuGUI_ItemContainer::setVertical2On( bool on )
+{
+ myV2Btn->setChecked( on );
+}
+/*!
+ Gets second vertical button's state
+*/
+bool VisuGUI_ItemContainer::isVertical2On() const
+{
+ return myV2Btn->isChecked();
+}
/*!
Sets item AutoAssign flag state
*/
if ( snd == myHBtn ) {
if ( on ) {
if ( myVBtn->isChecked() ) {
-// blockSignals( true );
- myVBtn->setChecked( false );
-// blockSignals( false );
+// blockSignals( true );
+ myVBtn->setChecked( false );
+// blockSignals( false );
+ }
+ else if ( myV2Btn->isChecked() ) {
+// blockSignals( true );
+ myV2Btn->setChecked( false );
+// blockSignals( false );
}
}
emit horToggled( on );
}
- else {
+ else if ( snd == myVBtn ) {
if ( on ) {
if ( myHBtn->isChecked() ) {
-// blockSignals( true );
- myHBtn->setChecked( false );
-// blockSignals( false );
+// blockSignals( true );
+ myHBtn->setChecked( false );
+// blockSignals( false );
+ }
+ else if ( myV2Btn->isChecked() ) {
+// blockSignals( true );
+ myV2Btn->setChecked( false );
+// blockSignals( false );
}
}
emit verToggled( on );
}
+ else {
+ if ( on ) {
+ if ( myHBtn->isChecked() ) {
+// blockSignals( true );
+ myHBtn->setChecked( false );
+// blockSignals( false );
+ }
+ else if ( myVBtn->isChecked() ) {
+// blockSignals( true );
+ myVBtn->setChecked( false );
+// blockSignals( false );
+ }
+ }
+ emit ver2Toggled( on );
+ }
}
/*!
*/
int VisuGUI_ItemContainer::assigned() const
{
- if( isVerticalOn() )
+ if( isVerticalOn() || isVertical2On() )
return myAssigned->currentIndex()-1;
else
return -1;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_SetupPlot2dDlg.h
// Author : Vadim SANDLER
// Module : SALOME
#include <SALOMEDSClient_SObject.hxx>
+#include <VISU_Table_i.hh>
+
#include <QDialog>
#include <QList>
class QLabel;
class QCheckBox;
class QComboBox;
-class QSpinBox;
+class SalomeApp_IntSpinBox;
class QToolButton;
class VisuGUI_ItemContainer;
class QtxColorButton;
Q_OBJECT
public:
- VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, QWidget* parent = 0 );
+ VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, VISU::Table_i* table ,QWidget* parent = 0 );
~VisuGUI_SetupPlot2dDlg();
void getCurves( QList<Plot2d_Curve*>& container );
- void getCurvesSource( int& horIndex, QList<int>& verIndexes, QList<int>& zIndexes );
+ void getCurvesSource( int& horIndex, QList<int>& verIndexes, QList<int>& ver2Indexes, QList<int>& zIndexes );
bool getCurveAttributes( const int vIndex, bool& isAuto, int& marker, int& line, int& lineWidth, QColor& color);
+ int idx(const int i) const {return myIdxMap[i];}
private:
void keyPressEvent( QKeyEvent* e );
private slots:
void onHBtnToggled( bool );
void onVBtnToggled( bool );
+ void onV2BtnToggled( bool );
void onHelp();
void enableControls();
QPushButton* myCancelBtn;
QPushButton* myHelpBtn;
QList<VisuGUI_ItemContainer*> myItems;
+ QMap<int,int> myIdxMap;
_PTR(SObject) myObject;
+ VISU::Table_i* myTable;
};
class VisuGUI_ItemContainer : public QObject
bool isHorizontalOn() const;
void setVerticalOn( bool on );
bool isVerticalOn() const;
+ void setVertical2On( bool on );
+ bool isVertical2On() const;
bool isAutoAssign() const;
void setAutoAssign( bool on );
void setLine( const int line, const int width );
void autoClicked();
void horToggled( bool );
void verToggled( bool );
+ void ver2Toggled( bool );
public slots:
void onAutoChanged();
bool myEnabled;
QToolButton* myHBtn;
QToolButton* myVBtn;
+ QToolButton* myV2Btn;
QLabel* myTitleLab;
QLabel* myUnitLab;
+ QLabel* myDvtnLab;
QCheckBox* myAutoCheck;
QComboBox* myLineCombo;
- QSpinBox* myLineSpin;
+ SalomeApp_IntSpinBox* myLineSpin;
QComboBox* myMarkerCombo, *myAssigned;
QtxColorButton* myColorBtn;
};
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VisuGUI_ShrinkFactorDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#include "VisuGUI_ShrinkFactorDlg.h"
+
+#include "VisuGUI.h"
+#include "VisuGUI_ViewTools.h"
+#include "VisuGUI_Tools.h"
+#include "VISU_Actor.h"
+
+#include "SUIT_Desktop.h"
+#include "SUIT_OverrideCursor.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
+
+#include "SALOME_ListIO.hxx"
+#include "SALOME_ListIteratorOfListIO.hxx"
+#include "SALOME_InteractiveObject.hxx"
+
+#include <SalomeApp_IntSpinBox.h>
+
+#include "LightApp_Study.h"
+#include "LightApp_SelectionMgr.h"
+#include "LightApp_Application.h"
+
+#include "SVTK_ViewWindow.h"
+
+// QT Includes
+#include <QLabel>
+#include <QPushButton>
+#include <QLayout>
+#include <QGroupBox>
+#include <QKeyEvent>
+
+const int DEFAULT_SHRINK = 80;
+const int UNDEF_SHRINK = -1;
+
+//=================================================================================
+// class : VisuGUI_ShrinkFactorDlg()
+// purpose :
+//
+//=================================================================================
+VisuGUI_ShrinkFactorDlg::VisuGUI_ShrinkFactorDlg( VisuGUI* theModule, bool modal )
+ : QDialog( VISU::GetDesktop( theModule ), Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+ myModule(theModule),
+ mySelectionMgr( VISU::GetSelectionMgr( theModule ) ),
+ myViewWindow( VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule) )
+{
+ setModal( modal );
+ setAttribute( Qt::WA_DeleteOnClose );
+
+ setWindowTitle( tr( "SHRINKFACTOR_TITLE" ) );
+ setSizeGripEnabled( true );
+ QVBoxLayout* topLayout = new QVBoxLayout( this );
+ topLayout->setSpacing( 6 );
+ topLayout->setMargin( 11 );
+
+ /*************************************************************************/
+ GroupC1 = new QGroupBox( this );
+ QHBoxLayout* GroupC1Layout = new QHBoxLayout( GroupC1 );
+ GroupC1Layout->setSpacing( 6 );
+ GroupC1Layout->setMargin( 11 );
+
+ ValueLab = new QLabel( tr( "SHRINKFACTOR_VALUE" ), GroupC1 );
+ ValueSpin = new SalomeApp_IntSpinBox( GroupC1 );
+ ValueSpin->setAcceptNames( false );
+ ValueSpin->setRange( 20, 100 );
+ ValueSpin->setSingleStep( 10 );
+ ValueSpin->setMinimumWidth( 70 );
+
+ GroupC1Layout->addWidget( ValueLab );
+ GroupC1Layout->addWidget( ValueSpin );
+
+ /*************************************************************************/
+ QGroupBox* GroupButtons = new QGroupBox( this );
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons );
+ GroupButtonsLayout->setSpacing( 6 );
+ GroupButtonsLayout->setMargin( 11 );
+
+ buttonOk = new QPushButton( tr( "BUT_CLOSE" ), GroupButtons );
+ buttonOk->setAutoDefault( true );
+ buttonOk->setDefault( true );
+
+ buttonHelp = new QPushButton( tr( "BUT_HELP" ), GroupButtons);
+ buttonHelp->setAutoDefault( true );
+
+ GroupButtonsLayout->addWidget( buttonOk );
+ GroupButtonsLayout->addSpacing( 10 );
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget( buttonHelp );
+
+ topLayout->addWidget( GroupC1 );
+ topLayout->addWidget( GroupButtons );
+
+ // Initial state
+ onSelectionChanged();
+
+ // signals and slots connections : after ValueHasChanged()
+ connect(buttonOk, SIGNAL( clicked() ), this, SLOT( close() ) );
+ connect(buttonHelp, SIGNAL( clicked() ), this, SLOT( help() ) );
+ connect(ValueSpin, SIGNAL( valueChanged( int ) ), this, SLOT( setShrinkFactor() ) );
+ connect(mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
+}
+
+//=================================================================================
+// function : ~VisuGUI_ShrinkFactorDlg()
+// purpose :
+//=================================================================================
+VisuGUI_ShrinkFactorDlg::~VisuGUI_ShrinkFactorDlg()
+{
+}
+
+//=======================================================================
+// function : help()
+// purpose :
+//=======================================================================
+void VisuGUI_ShrinkFactorDlg::help()
+{
+ QString aHelpFileName = "viewing_3d_presentations_page.html#width_shrink_factor_anchor";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+ app->onHelpContextModule( aVisuGUI ? app->moduleName( aVisuGUI->moduleName() ) : QString(""), aHelpFileName );
+ }
+ else {
+ QString platform;
+#ifdef WIN32
+ platform = "winapplication";
+#else
+ platform = "application";
+#endif
+ SUIT_MessageBox::warning( this,
+ tr( "WRN_WARNING" ),
+ tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( aHelpFileName ),
+ tr( "BUT_OK" ) );
+ }
+}
+
+//=================================================================================
+// function : setShrinkFactor()
+// purpose : Called when value of spin box is changed
+// : or the first time as initilisation
+//=================================================================================
+void VisuGUI_ShrinkFactorDlg::setShrinkFactor()
+{
+ if ( myViewWindow ) {
+ SUIT_OverrideCursor wc;
+ float shrink = ValueSpin->value() / 100.;
+
+ SALOME_ListIO aList;
+ mySelectionMgr->selectedObjects( aList );
+
+ SALOME_ListIteratorOfListIO anIter( aList );
+ for ( ; anIter.More(); anIter.Next() ) {
+ Handle(SALOME_InteractiveObject) anIO = anIter.Value();
+ VISU_Actor* anActor = VISU::FindActor( VISU::GetAppStudy( myModule ), myViewWindow, anIO->getEntry() );
+ if ( anActor ) {
+ if ( anActor->IsShrunkable() )
+ anActor->SetShrinkFactor( shrink );
+ }
+ else {
+ VISU_ActorBase* anActor = VISU::FindActorBase(VISU::GetAppStudy(myModule), myViewWindow, anIO->getEntry());
+ if ( anActor ) {
+ if ( anActor->IsShrunkable() )
+ anActor->SetShrinkFactor( shrink );
+ }
+ }
+ }
+ myViewWindow->Repaint();
+ }
+}
+
+//=================================================================================
+// function : onSelectionChanged()
+// purpose : Called when selection is changed
+//=================================================================================
+void VisuGUI_ShrinkFactorDlg::onSelectionChanged()
+{
+ bool shrinkable = false;
+ if ( myViewWindow ) {
+ int shrinkFactor = UNDEF_SHRINK;
+
+ SALOME_ListIO aList;
+ mySelectionMgr->selectedObjects( aList );
+
+ SALOME_ListIteratorOfListIO It( aList );
+ for ( ; It.More(); It.Next() ) {
+ Handle(SALOME_InteractiveObject) IO = It.Value();
+ if (!IO.IsNull()) {
+ bool ashrinkable = false;
+ int shr = UNDEF_SHRINK;
+ VISU_Actor* anActor = VISU::FindActor( VISU::GetAppStudy( myModule ), myViewWindow, IO->getEntry() );
+ if ( anActor ) {
+ ashrinkable = anActor->IsShrunkable();
+ if ( ashrinkable ) shr = int( anActor->GetShrinkFactor() * 100. + 0.5 );
+ }
+ else {
+ VISU_ActorBase* anActor = VISU::FindActorBase(VISU::GetAppStudy(myModule), myViewWindow, IO->getEntry());
+ if ( anActor ) {
+ ashrinkable = anActor->IsShrunkable();
+ if ( ashrinkable ) shr = int( anActor->GetShrinkFactor() * 100. + 0.5 );
+ }
+ }
+ shrinkable = shrinkable || ashrinkable;
+ if ( shr != UNDEF_SHRINK ) {
+ if ( shrinkFactor == UNDEF_SHRINK )
+ shrinkFactor = shr;
+ else if ( shrinkFactor != shr ) {
+ shrinkFactor = DEFAULT_SHRINK;
+ break;
+ }
+ }
+ }
+ }
+ ValueSpin->blockSignals( true );
+ ValueSpin->setValue( shrinkFactor == UNDEF_SHRINK ? DEFAULT_SHRINK : shrinkFactor );
+ ValueSpin->blockSignals( false );
+ }
+ GroupC1->setEnabled( shrinkable );
+}
+
+//=================================================================================
+// function : keyPressEvent()
+// purpose :
+//=================================================================================
+void VisuGUI_ShrinkFactorDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ help();
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VisuGUI_ShrinkFactorDlg.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#ifndef VISUGUI_SHRINKFACTORDLG_H
+#define VISUGUI_SHRINKFACTORDLG_H
+
+// QT Includes
+#include <QDialog>
+
+class QLabel;
+class QPushButton;
+class SalomeApp_IntSpinBox;
+class QGroupBox;
+class LightApp_SelectionMgr;
+class SalomeApp_Module;
+class SVTK_Selector;
+class SVTK_ViewWindow;
+class VisuGUI;
+
+//=================================================================================
+// class : VisuGUI_ShrinkFactorDlg
+// purpose :
+//=================================================================================
+class VisuGUI_ShrinkFactorDlg : public QDialog
+{
+ Q_OBJECT
+
+public:
+ VisuGUI_ShrinkFactorDlg( VisuGUI* = 0,
+ bool modal = false );
+
+ ~VisuGUI_ShrinkFactorDlg();
+
+private:
+ void keyPressEvent( QKeyEvent* );
+
+private :
+ LightApp_SelectionMgr* mySelectionMgr;
+ SVTK_ViewWindow* myViewWindow;
+ const SalomeApp_Module* myModule;
+
+ QGroupBox* GroupC1;
+ QPushButton* buttonOk;
+ QPushButton* buttonHelp;
+ QLabel* ValueLab;
+ SalomeApp_IntSpinBox* ValueSpin;
+
+public slots:
+ void help();
+ void setShrinkFactor();
+ void onSelectionChanged();
+};
+
+#endif // VISUGUI_SHRINKFACTORDLG_H
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// VISU VISUGUI : GUI of VISU component
+// File : VisuGUI_SizeBox.cxx
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#include "VisuGUI_SizeBox.h"
+
+#include "VisuGUI_Tools.h"
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
+#include <SalomeApp_DoubleSpinBox.h>
+#include <SalomeApp_IntSpinBox.h>
+#include <QtxColorButton.h>
+
+#include <QLayout>
+#include <QLabel>
+#include <QLineEdit>
+#include <QCheckBox>
+#include <QGroupBox>
+#include <QButtonGroup>
+#include <QRadioButton>
+#include <QPushButton>
+#include <QColorDialog>
+
+using namespace std;
+
+VisuGUI_SizeBox::VisuGUI_SizeBox( QWidget* parent ) :
+ QWidget( parent )
+{
+ QVBoxLayout* aMainLayout = new QVBoxLayout( this );
+ aMainLayout->setSpacing( 0 );
+ aMainLayout->setMargin( 0 );
+
+ // Size
+ QGroupBox* SizeGroup = new QGroupBox ( tr( "SIZE_TITLE" ), this );
+ //SizeGroup->setColumnLayout(0, Qt::Vertical );
+ //SizeGroup->layout()->setSpacing( 0 );
+ //SizeGroup->layout()->setMargin( 0 );
+
+ QGridLayout* SizeGroupLayout = new QGridLayout (SizeGroup);
+ SizeGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+ SizeGroupLayout->setSpacing(6);
+ SizeGroupLayout->setMargin(11);
+
+ // Outside Size
+ myOutsideSizeLabel = new QLabel( tr( "OUTSIDE_SIZE" ), SizeGroup );
+ myOutsideSizeSpinBox = new SalomeApp_IntSpinBox( SizeGroup );
+ VISU::initSpinBox( myOutsideSizeSpinBox, 0, 100, 1 );
+ myOutsideSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myOutsideSizeLabel, 0, 0 );
+ SizeGroupLayout->addWidget( myOutsideSizeSpinBox, 0, 1 );
+
+ // Geometry Size
+ myGeomSizeLabel = new QLabel( tr( "GEOM_SIZE" ), SizeGroup );
+ myGeomSizeSpinBox = new SalomeApp_IntSpinBox( SizeGroup );
+ VISU::initSpinBox( myGeomSizeSpinBox, 0, 100, 1 );
+ myGeomSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myGeomSizeLabel, 0, 0 );
+ SizeGroupLayout->addWidget( myGeomSizeSpinBox, 0, 1 );
+
+ // Min Size
+ myMinSizeLabel = new QLabel( tr( "MIN_SIZE" ), SizeGroup );
+ myMinSizeSpinBox = new SalomeApp_IntSpinBox( SizeGroup );
+ VISU::initSpinBox( myMinSizeSpinBox, 0, 100, 1 );
+ myMinSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myMinSizeLabel, 1, 0 );
+ SizeGroupLayout->addWidget( myMinSizeSpinBox, 1, 1 );
+
+ // Max Size
+ myMaxSizeLabel = new QLabel( tr( "MAX_SIZE" ), SizeGroup );
+ myMaxSizeSpinBox = new SalomeApp_IntSpinBox( SizeGroup );
+ VISU::initSpinBox( myMaxSizeSpinBox, 0, 100, 1 );
+ myMaxSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myMaxSizeLabel, 1, 2 );
+ SizeGroupLayout->addWidget( myMaxSizeSpinBox, 1, 3 );
+
+ // Magnification
+ myMagnificationLabel = new QLabel( tr( "MAGNIFICATION" ), SizeGroup );
+ myMagnificationSpinBox = new SalomeApp_IntSpinBox( SizeGroup );
+ VISU::initSpinBox( myMagnificationSpinBox, 1, 10000, 10 );
+ myMagnificationSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myMagnificationLabel, 2, 0 );
+ SizeGroupLayout->addWidget( myMagnificationSpinBox, 2, 1 );
+
+ // Increment
+ myIncrementLabel = new QLabel( tr( "INCREMENT" ), SizeGroup );
+ myIncrementSpinBox = new SalomeApp_DoubleSpinBox( SizeGroup );
+ VISU::initSpinBox( myIncrementSpinBox, 0.01, 10, 0.1, "parametric_precision" );
+ myIncrementSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ SizeGroupLayout->addWidget( myIncrementLabel, 2, 2 );
+ SizeGroupLayout->addWidget( myIncrementSpinBox, 2, 3 );
+
+ aMainLayout->addWidget( SizeGroup );
+
+ // Color
+ myColorGroup = new QGroupBox ( tr( "COLOR_TITLE" ), this );
+ //myColorGroup->setColumnLayout(0, Qt::Vertical );
+ //myColorGroup->layout()->setSpacing( 0 );
+ //myColorGroup->layout()->setMargin( 0 );
+
+ QGridLayout* ColorGroupLayout = new QGridLayout ( myColorGroup );
+ ColorGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
+ ColorGroupLayout->setSpacing(6);
+ ColorGroupLayout->setMargin(11);
+
+ myUniformCheckBox = new QCheckBox( tr( "UNIFORM_COLOR" ), myColorGroup );
+
+ myColorLabel = new QLabel( tr( "COLOR" ), myColorGroup );
+ myColorButton = new QtxColorButton( myColorGroup );
+
+ ColorGroupLayout->addWidget( myUniformCheckBox, 0, 0 );
+ ColorGroupLayout->addWidget( myColorLabel, 0, 1 );
+ ColorGroupLayout->addWidget( myColorButton, 0, 2 );
+
+ aMainLayout->addWidget( myColorGroup );
+
+ connect( myUniformCheckBox, SIGNAL( toggled( bool ) ), myColorButton, SLOT( setEnabled( bool ) ) );
+ //connect( myColorButton, SIGNAL( clicked() ), this, SLOT( onColorButtonPressed() ) );
+
+ setType( VisuGUI_SizeBox::Results );
+}
+
+void VisuGUI_SizeBox::onToggleResults()
+{
+ myType = VisuGUI_SizeBox::Results;
+
+ myOutsideSizeLabel->hide();
+ myOutsideSizeSpinBox->hide();
+
+ myGeomSizeLabel->hide();
+ myGeomSizeSpinBox->hide();
+
+ myMinSizeLabel->show();
+ myMinSizeSpinBox->show();
+
+ myMaxSizeLabel->show();
+ myMaxSizeSpinBox->show();
+
+ myMagnificationLabel->show();
+ myMagnificationSpinBox->show();
+
+ myIncrementLabel->show();
+ myIncrementSpinBox->show();
+
+ myColorGroup->hide();
+
+ myUniformCheckBox->hide();
+}
+
+void VisuGUI_SizeBox::onToggleGeometry()
+{
+ myType = VisuGUI_SizeBox::Geometry;
+
+ myOutsideSizeLabel->hide();
+ myOutsideSizeSpinBox->hide();
+
+ myGeomSizeLabel->show();
+ myGeomSizeSpinBox->show();
+
+ myMinSizeLabel->hide();
+ myMinSizeSpinBox->hide();
+
+ myMaxSizeLabel->hide();
+ myMaxSizeSpinBox->hide();
+
+ myMagnificationLabel->show();
+ myMagnificationSpinBox->show();
+
+ myIncrementLabel->show();
+ myIncrementSpinBox->show();
+
+ myColorGroup->show();
+
+ myUniformCheckBox->hide();
+}
+
+void VisuGUI_SizeBox::onToggleInside()
+{
+ myType = VisuGUI_SizeBox::Inside;
+
+ myOutsideSizeLabel->hide();
+ myOutsideSizeSpinBox->hide();
+
+ myGeomSizeLabel->hide();
+ myGeomSizeSpinBox->hide();
+
+ myMinSizeLabel->show();
+ myMinSizeSpinBox->show();
+
+ myMaxSizeLabel->show();
+ myMaxSizeSpinBox->show();
+
+ myMagnificationLabel->hide();
+ myMagnificationSpinBox->hide();
+
+ myIncrementLabel->hide();
+ myIncrementSpinBox->hide();
+
+ myColorGroup->hide();
+
+ myUniformCheckBox->hide();
+}
+
+void VisuGUI_SizeBox::onToggleOutside()
+{
+ myType = VisuGUI_SizeBox::Outside;
+
+ myOutsideSizeLabel->show();
+ myOutsideSizeSpinBox->show();
+
+ myGeomSizeLabel->hide();
+ myGeomSizeSpinBox->hide();
+
+ myMinSizeLabel->hide();
+ myMinSizeSpinBox->hide();
+
+ myMaxSizeLabel->hide();
+ myMaxSizeSpinBox->hide();
+
+ myMagnificationLabel->hide();
+ myMagnificationSpinBox->hide();
+
+ myIncrementLabel->hide();
+ myIncrementSpinBox->hide();
+
+ myColorGroup->show();
+
+ myUniformCheckBox->show();
+}
+
+void VisuGUI_SizeBox::setType( int theType )
+{
+ myType = theType;
+
+ switch( myType )
+ {
+ case VisuGUI_SizeBox::Results : onToggleResults(); break;
+ case VisuGUI_SizeBox::Geometry : onToggleGeometry(); break;
+ case VisuGUI_SizeBox::Inside : onToggleInside(); break;
+ case VisuGUI_SizeBox::Outside : onToggleOutside(); break;
+ default : break;
+ }
+}
+
+float VisuGUI_SizeBox::getOutsideSize() const
+{
+ return myOutsideSizeSpinBox->value() / 100.0;
+}
+
+void VisuGUI_SizeBox::setOutsideSize( float theOutsideSize )
+{
+ myOutsideSizeSpinBox->setValue( ( int ) ( theOutsideSize * 100. + 0.5 ) );
+}
+
+float VisuGUI_SizeBox::getGeomSize() const
+{
+ return myGeomSizeSpinBox->value() / 100.0;
+}
+
+void VisuGUI_SizeBox::setGeomSize( float theGeomSize )
+{
+ myGeomSizeSpinBox->setValue( ( int ) ( theGeomSize * 100. + 0.5 ) );
+}
+
+float VisuGUI_SizeBox::getMinSize() const
+{
+ return myMinSizeSpinBox->value() / 100.0;
+}
+
+void VisuGUI_SizeBox::setMinSize( float theMinSize )
+{
+ myMinSizeSpinBox->setValue( ( int ) ( theMinSize * 100. + 0.5 ) );
+}
+
+float VisuGUI_SizeBox::getMaxSize() const
+{
+ return myMaxSizeSpinBox->value() / 100.0;
+}
+
+void VisuGUI_SizeBox::setMaxSize( float theMaxSize )
+{
+ myMaxSizeSpinBox->setValue( (int) ( theMaxSize * 100. + 0.5 ) );
+}
+
+float VisuGUI_SizeBox::getMagnification() const
+{
+ return myMagnificationSpinBox->value() / 100.0;
+}
+
+void VisuGUI_SizeBox::setMagnification( float theMagnification )
+{
+ myMagnificationSpinBox->setValue( (int) ( theMagnification * 100. + 0.5 ) );
+}
+
+float VisuGUI_SizeBox::getIncrement() const
+{
+ return myIncrementSpinBox->value();
+}
+
+void VisuGUI_SizeBox::setIncrement( float theIncrement )
+{
+ myIncrementSpinBox->setValue( theIncrement );
+}
+
+bool VisuGUI_SizeBox::getUniform() const
+{
+ return myUniformCheckBox->isChecked();
+}
+
+void VisuGUI_SizeBox::setUniform( bool theUniform )
+{
+ myUniformCheckBox->setChecked( theUniform );
+ myColorButton->setEnabled( theUniform );
+}
+
+QColor VisuGUI_SizeBox::getColor() const
+{
+ return myColorButton->color();//palette().color( myColorButton->backgroundRole() );
+ //return myColorButton->paletteBackgroundColor();
+}
+
+void VisuGUI_SizeBox::setColor( const QColor& theColor )
+{
+ if ( theColor.isValid() )
+ {
+ //QPalette aPalette( myColorButton->palette() );
+ //aPalette.setColor( myColorButton->backgroundRole(), theColor );
+ myColorButton->setColor( theColor );
+ }
+ //myColorButton->setPaletteBackgroundColor( theColor );
+}
+
+void VisuGUI_SizeBox::enableSizeControls( bool enabled )
+{
+ myMagnificationSpinBox->setEnabled( enabled );
+ myMaxSizeSpinBox->setEnabled( enabled );
+ myMinSizeSpinBox->setEnabled( enabled );
+ myIncrementSpinBox->setEnabled( enabled );
+ myGeomSizeSpinBox->setEnabled( enabled );
+}
+
+/*void VisuGUI_SizeBox::onColorButtonPressed()
+{
+ QPalette aPalette( myColorButton->palette() );
+ QColor aColor = QColorDialog::
+ getColor( aPalette.color(myColorButton->backgroundRole() ), this );
+
+ if( aColor.isValid() )
+ {
+ aPalette.setColor( myColorButton->backgroundRole(), aColor );
+ myColorButton->setPalette( aPalette );
+ }
+}*/
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// VISU VISUGUI : GUI of VISU component
+// File : VisuGUI_SizeBox.h
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#ifndef VISUGUI_SIZEBOX_H
+#define VISUGUI_SIZEBOX_H
+
+#include <QWidget>
+
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QCheckBox;
+class QGroupBox;
+
+class SalomeApp_DoubleSpinBox;
+class SalomeApp_IntSpinBox;
+class QtxColorButton;
+
+class VisuGUI_SizeBox : public QWidget
+{
+ Q_OBJECT
+
+public:
+ enum { Results = 0, Geometry, Inside, Outside };
+
+public:
+ VisuGUI_SizeBox( QWidget* );
+ ~VisuGUI_SizeBox() {}
+
+public:
+ int getType() const { return myType; }
+ void setType( int );
+
+ float getOutsideSize() const;
+ void setOutsideSize( float );
+
+ float getGeomSize() const;
+ void setGeomSize( float );
+
+ float getMinSize() const;
+ void setMinSize( float );
+
+ float getMaxSize() const;
+ void setMaxSize( float );
+
+ float getMagnification() const;
+ void setMagnification( float );
+
+ float getIncrement() const;
+ void setIncrement( float );
+
+ bool getUniform() const;
+ void setUniform( bool );
+
+ QColor getColor() const;
+ void setColor( const QColor& );
+
+ void enableSizeControls( bool enabled );
+
+protected slots:
+ void onToggleResults();
+ void onToggleGeometry();
+ void onToggleInside();
+ void onToggleOutside();
+
+ //void onColorButtonPressed();
+
+private:
+ int myType;
+
+ QLabel* myOutsideSizeLabel;
+ SalomeApp_IntSpinBox* myOutsideSizeSpinBox;
+
+ QLabel* myGeomSizeLabel;
+ SalomeApp_IntSpinBox* myGeomSizeSpinBox;
+
+ QLabel* myMinSizeLabel;
+ SalomeApp_IntSpinBox* myMinSizeSpinBox;
+
+ QLabel* myMaxSizeLabel;
+ SalomeApp_IntSpinBox* myMaxSizeSpinBox;
+
+ QLabel* myMagnificationLabel;
+ SalomeApp_IntSpinBox* myMagnificationSpinBox;
+
+ QLabel* myIncrementLabel;
+ SalomeApp_DoubleSpinBox* myIncrementSpinBox;
+
+ QCheckBox* myUniformCheckBox;
+
+ QGroupBox* myColorGroup;
+ QLabel* myColorLabel;
+ QtxColorButton* myColorButton;
+};
+
+
+
+#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Slider.cxx
// Author : Oleg UVAROV
// Module : VISU
//
#include "VisuGUI_Slider.h"
+#include "VisuGUI_Tools.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_Session.h"
#include "SalomeApp_Application.h"
#include "SalomeApp_Study.h"
+#include <SalomeApp_DoubleSpinBox.h>
#include "LightApp_SelectionMgr.h"
#include "SVTK_Functor.h"
#include "QtxDockWidget.h"
-#include "QtxDoubleSpinBox.h"
#include <vtkActorCollection.h>
#include <vtkRenderer.h>
Constructor
*/
VisuGUI_Slider::VisuGUI_Slider( VisuGUI* theModule,
- QMainWindow* theParent,
- LightApp_SelectionMgr* theSelectionMgr )
+ QMainWindow* theParent,
+ LightApp_SelectionMgr* theSelectionMgr )
: QWidget( theParent )
, myViewManager( VISU::GetVisuGen( theModule )->GetViewManager() )
, mySelectionMgr( theSelectionMgr )
{
QGridLayout* aGridLayout = new QGridLayout( aParent );
{
- myFirstTimeStamp = new QLabel( aParent );
- myFirstTimeStamp->setAlignment( Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter );
- myFirstTimeStamp->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
- aGridLayout->addWidget( myFirstTimeStamp, 0, 0, 1, 1 );
-
- mySlider = new QSlider( aParent );
- mySlider->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- mySlider->setFocusPolicy( Qt::StrongFocus );
- mySlider->setOrientation( Qt::Horizontal );
- mySlider->setTracking( false );
- mySlider->setMinimum( 0 );
- aGridLayout->addWidget( mySlider, 0, 1, 1, 3 );
-
- myLastTimeStamp = new QLabel( aParent );
- aGridLayout->addWidget( myLastTimeStamp, 0, 4, 1, 1 );
+ myFirstTimeStamp = new QLabel( aParent );
+ myFirstTimeStamp->setAlignment( Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter );
+ myFirstTimeStamp->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+ aGridLayout->addWidget( myFirstTimeStamp, 0, 0, 1, 1 );
+
+ mySlider = new QSlider( aParent );
+ mySlider->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ mySlider->setFocusPolicy( Qt::StrongFocus );
+ mySlider->setOrientation( Qt::Horizontal );
+ mySlider->setTracking( false );
+ mySlider->setMinimum( 0 );
+ aGridLayout->addWidget( mySlider, 0, 1, 1, 3 );
+
+ myLastTimeStamp = new QLabel( aParent );
+ aGridLayout->addWidget( myLastTimeStamp, 0, 4, 1, 1 );
}
{
- myFirstButton = new QToolButton( aParent );
- myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) );
- myFirstButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- aGridLayout->addWidget( myFirstButton, 1, 0, 1, 1 );
-
- myPreviousButton = new QToolButton( aParent );
- myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) );
- myPreviousButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- aGridLayout->addWidget( myPreviousButton, 1, 1, 1, 1 );
-
- myPlayButton = new QToolButton( aParent );
- myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
- myPlayButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- myPlayButton->setCheckable( true );
- aGridLayout->addWidget( myPlayButton, 1, 2, 1, 1 );
-
- myNextButton = new QToolButton( aParent );
- myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) );
- myNextButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- aGridLayout->addWidget( myNextButton, 1, 3, 1, 1 );
-
- myLastButton = new QToolButton( aParent );
- myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) );
- myLastButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- aGridLayout->addWidget( myLastButton, 1, 4, 1, 1 );
+ myFirstButton = new QToolButton( aParent );
+ myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) );
+ myFirstButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ aGridLayout->addWidget( myFirstButton, 1, 0, 1, 1 );
+
+ myPreviousButton = new QToolButton( aParent );
+ myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) );
+ myPreviousButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ aGridLayout->addWidget( myPreviousButton, 1, 1, 1, 1 );
+
+ myPlayButton = new QToolButton( aParent );
+ myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
+ myPlayButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myPlayButton->setCheckable( true );
+ aGridLayout->addWidget( myPlayButton, 1, 2, 1, 1 );
+
+ myNextButton = new QToolButton( aParent );
+ myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) );
+ myNextButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ aGridLayout->addWidget( myNextButton, 1, 3, 1, 1 );
+
+ myLastButton = new QToolButton( aParent );
+ myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) );
+ myLastButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ aGridLayout->addWidget( myLastButton, 1, 4, 1, 1 );
}
{
- myTimeStampIndexes = new QComboBox( aParent );
- myTimeStampIndexes->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- myTimeStampIndexes->setFocusPolicy( Qt::StrongFocus );
- aGridLayout->addWidget( myTimeStampIndexes, 2, 0, 1, 2 );
-
- myIsCycled = new QToolButton( aParent );
- myIsCycled->setText( tr( "IS_CYCLED" ) );
- myIsCycled->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- myIsCycled->setLayoutDirection( Qt::LeftToRight );
- myIsCycled->setCheckable( true );
- //myIsCycled->setEnabled( false );
- aGridLayout->addWidget( myIsCycled, 2, 2, 1, 1 );
-
- myTimeStampStrings = new QComboBox( aParent );
- myTimeStampStrings->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- myTimeStampStrings->setFocusPolicy( Qt::StrongFocus );
- aGridLayout->addWidget( myTimeStampStrings, 2, 3, 1, 2 );
+ myTimeStampIndexes = new QComboBox( aParent );
+ myTimeStampIndexes->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myTimeStampIndexes->setFocusPolicy( Qt::StrongFocus );
+ aGridLayout->addWidget( myTimeStampIndexes, 2, 0, 1, 2 );
+
+ myIsCycled = new QToolButton( aParent );
+ myIsCycled->setText( tr( "IS_CYCLED" ) );
+ myIsCycled->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myIsCycled->setLayoutDirection( Qt::LeftToRight );
+ myIsCycled->setCheckable( true );
+ //myIsCycled->setEnabled( false );
+ aGridLayout->addWidget( myIsCycled, 2, 2, 1, 1 );
+
+ myTimeStampStrings = new QComboBox( aParent );
+ myTimeStampStrings->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myTimeStampStrings->setFocusPolicy( Qt::StrongFocus );
+ aGridLayout->addWidget( myTimeStampStrings, 2, 3, 1, 2 );
}
}
{
QVBoxLayout* aVBoxLayout = new QVBoxLayout( aParent );
{
- QHBoxLayout* aHBoxLayout = new QHBoxLayout();
-
- myMinimalMemoryButton = new QRadioButton( tr( "MINIMAL_MEMORY" ), aParent );
- aHBoxLayout->addWidget( myMinimalMemoryButton );
-
- QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
- aHBoxLayout->addItem( aSpacerItem );
-
- myLimitedMemoryButton = new QRadioButton( tr( "LIMITED_MEMORY" ), aParent );
- myLimitedMemoryButton->setChecked( true );
- aHBoxLayout->addWidget( myLimitedMemoryButton );
-
- myLimitedMemory = new QtxDoubleSpinBox( aParent );
- myLimitedMemory->setMaximum( 10000 );
- myLimitedMemory->setValue( 512 );
- aHBoxLayout->addWidget( myLimitedMemory );
-
- QLabel* aMemoryDimensionLabel = new QLabel( aParent );
- aMemoryDimensionLabel->setText( tr( "MEMORY_UNITS" ) );
- aHBoxLayout->addWidget( aMemoryDimensionLabel );
-
- aVBoxLayout->addLayout( aHBoxLayout );
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+
+ myMinimalMemoryButton = new QRadioButton( tr( "MINIMAL_MEMORY" ), aParent );
+ aHBoxLayout->addWidget( myMinimalMemoryButton );
+
+ QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ aHBoxLayout->addItem( aSpacerItem );
+
+ myLimitedMemoryButton = new QRadioButton( tr( "LIMITED_MEMORY" ), aParent );
+ myLimitedMemoryButton->setChecked( true );
+ aHBoxLayout->addWidget( myLimitedMemoryButton );
+
+ myLimitedMemory = new SalomeApp_DoubleSpinBox( aParent );
+ VISU::initSpinBox( myLimitedMemory, 0., 10000., 1., "memory_precision" );
+ myLimitedMemory->setValue( 512 );
+ aHBoxLayout->addWidget( myLimitedMemory );
+
+ QLabel* aMemoryDimensionLabel = new QLabel( aParent );
+ aMemoryDimensionLabel->setText( tr( "MEMORY_UNITS" ) );
+ aHBoxLayout->addWidget( aMemoryDimensionLabel );
+
+ aVBoxLayout->addLayout( aHBoxLayout );
}
{
- QHBoxLayout* aHBoxLayout = new QHBoxLayout();
-
- QLabel* aUsedMemoryLabel = new QLabel( tr( "USED_BY_CACHE" ), aParent );
- aUsedMemoryLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
- aHBoxLayout->addWidget( aUsedMemoryLabel );
-
- myUsedMemory = new QLineEdit( aParent );
- myUsedMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
- //myUsedMemory->setEnabled( false );
- aHBoxLayout->addWidget( myUsedMemory );
-
- QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
- aHBoxLayout->addItem( aSpacerItem );
-
- QLabel* aFreeMemoryLabel = new QLabel( tr( "AVAILABLE_MEMORY" ), aParent );
- aHBoxLayout->addWidget( aFreeMemoryLabel );
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+
+ QLabel* aUsedMemoryLabel = new QLabel( tr( "USED_BY_CACHE" ), aParent );
+ aUsedMemoryLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+ aHBoxLayout->addWidget( aUsedMemoryLabel );
+
+ myUsedMemory = new QLineEdit( aParent );
+ myUsedMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
+ //myUsedMemory->setEnabled( false );
+ aHBoxLayout->addWidget( myUsedMemory );
+
+ QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ aHBoxLayout->addItem( aSpacerItem );
+
+ QLabel* aFreeMemoryLabel = new QLabel( tr( "AVAILABLE_MEMORY" ), aParent );
+ aHBoxLayout->addWidget( aFreeMemoryLabel );
- myFreeMemory = new QLineEdit( aParent );
- myFreeMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
- //myFreeMemory->setEnabled( false );
- aHBoxLayout->addWidget( myFreeMemory );
+ myFreeMemory = new QLineEdit( aParent );
+ myFreeMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
+ //myFreeMemory->setEnabled( false );
+ aHBoxLayout->addWidget( myFreeMemory );
- aVBoxLayout->addLayout( aHBoxLayout );
+ aVBoxLayout->addLayout( aHBoxLayout );
}
{
- QHBoxLayout* aHBoxLayout = new QHBoxLayout();
-
- QLabel* aLabel = new QLabel( tr( "SPEED" ), aParent );
- aLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
- aHBoxLayout->addWidget( aLabel );
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+
+ QLabel* aLabel = new QLabel( tr( "SPEED" ), aParent );
+ aLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+ aHBoxLayout->addWidget( aLabel );
- mySpeedSlider = new QSlider( aParent );
- mySpeedSlider->setMinimum( 1 );
- mySpeedSlider->setMaximum( 100 );
- mySpeedSlider->setValue( mySpeedSlider->maximum() / 2 );
- mySpeedSlider->setPageStep( mySpeedSlider->maximum() / 5 );
- mySpeedSlider->setTickInterval( mySpeedSlider->pageStep() );
- mySpeedSlider->setOrientation( Qt::Horizontal );
- mySpeedSlider->setTickPosition( QSlider::TicksBelow );
- aHBoxLayout->addWidget( mySpeedSlider );
-
- aVBoxLayout->addLayout( aHBoxLayout );
+ mySpeedSlider = new QSlider( aParent );
+ mySpeedSlider->setMinimum( 1 );
+ mySpeedSlider->setMaximum( 100 );
+ mySpeedSlider->setValue( mySpeedSlider->maximum() / 2 );
+ mySpeedSlider->setPageStep( mySpeedSlider->maximum() / 5 );
+ mySpeedSlider->setTickInterval( mySpeedSlider->pageStep() );
+ mySpeedSlider->setOrientation( Qt::Horizontal );
+ mySpeedSlider->setTickPosition( QSlider::TicksBelow );
+ aHBoxLayout->addWidget( mySpeedSlider );
+
+ aVBoxLayout->addLayout( aHBoxLayout );
}
aTabWidget->addTab( aParent, tr( "PROPERTIES_TAB" ) );
myTimeStampIndexes->addItem( QString::number( aNumber ) );
if( aNumber == aTimeStampNumber )
- a_current_index = an_index;
+ a_current_index = an_index;
}
// work around - to update controls' sizes
myTimeStampStrings->setFont(myTimeStampStrings->font());
aSObject = aStudy->FindObjectID(anIO->getEntry());
if (aSObject) {
- CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
+ CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
if (!CORBA::is_nil(anObject)) {
- VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
+ VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
- if(!CORBA::is_nil(aHolder))
- {
- //cout << "ColoredPrs3dHolder" << endl;
- myHolderList.push_back(aHolder);
- }
+ if(!CORBA::is_nil(aHolder))
+ {
+ //cout << "ColoredPrs3dHolder" << endl;
+ myHolderList.push_back(aHolder);
+ }
}
}
}
QApplication::restoreOverrideCursor();
}
- aView3D->Destroy();
+ aView3D->UnRegister();
updateMemoryState();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Slider.h
// Author : Oleg UVAROV
class QLineEdit;
class QToolButton;
class QSlider;
-class QSpinBox;
class QCheckBox;
class QRadioButton;
class QMainWindow;
class QTimer;
class QAction;
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class LightApp_SelectionMgr;
class VisuGUI;
public:
VisuGUI_Slider( VisuGUI* theModule,
- QMainWindow* theParent,
- LightApp_SelectionMgr* theSelectionMgr );
+ QMainWindow* theParent,
+ LightApp_SelectionMgr* theSelectionMgr );
virtual ~VisuGUI_Slider();
QRadioButton* myMinimalMemoryButton;
QRadioButton* myLimitedMemoryButton;
- QtxDoubleSpinBox* myLimitedMemory;
+ SalomeApp_DoubleSpinBox* myLimitedMemory;
QLineEdit* myUsedMemory;
QLineEdit* myFreeMemory;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_StreamLinesDlg.cxx
// Author : Vitaly SMETANNIKOV
// Module : VISU
#include "VISU_StreamLinesPL.hxx"
#include "VISU_Actor.h"
+#include <SalomeApp_DoubleSpinBox.h>
#include "SalomeApp_Application.h"
#include "LightApp_Application.h"
#include "LightApp_SelectionMgr.h"
#include <SALOMEDSClient_SObject.hxx>
-#include <QtxDoubleSpinBox.h>
#include <QtxColorButton.h>
-#include <limits.h>
+#include <limits>
#include <QLayout>
#include <QLabel>
#include <QFrame>
-using namespace std;
-
VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule)
: VisuGUI_ScalarBarBaseDlg(theModule),
- myVisuGUI(theModule)
+ myVisuGUI(theModule),
+ myStatus(false)
{
setWindowTitle(tr("DLG_TITLE"));
setSizeGripEnabled(TRUE);
myUseSrcCombo = new QComboBox(aSourceBox);
QStringList aChoise;
- aChoise.append( "None" );
- aChoise.append( "Entity" );
- aChoise.append( "Family" );
- aChoise.append( "Group" );
- aChoise.append( "Presentation" );
+ aChoise.append( tr("None") );
+ aChoise.append( tr("Entity") );
+ aChoise.append( tr("Family") );
+ aChoise.append( tr("Group") );
+ aChoise.append( tr("Presentation") );
myUseSrcCombo->addItems(aChoise);
aSrcLayout->addWidget(myUseSrcCombo, 0, 1);
VISU::VISUType aType = VISU::Storable::SObject2Type(aSObject);
switch (aType) {
case VISU::TTIMESTAMP: {
- aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
- break;
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+ break;
}
case VISU::TFIELD: {
- _PTR(SObject) newSObject;
- if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
- aSObject = aSObject->GetFather();
- break;
+ _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;
+ _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();
mySelectionObj = aSObject;
CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
if (CORBA::is_nil(anObject)) {
- mySelectionObj = mySelectionObj->GetFather();
+ mySelectionObj = mySelectionObj->GetFather();
}
}
}
VISU::VISUType aType = VISU::Storable::SObject2Type(aChildSObj);
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;
+ _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;
}
}
}
QLabel* aPercentLbl = new QLabel (tr("LBL_USED_POINTS"), aSourceBox);
aSrcLayout->addWidget(aPercentLbl, 2, 0);
- myPntPercent = new QtxDoubleSpinBox( aSourceBox );
- VISU::initSpinBox(myPntPercent, 0, 1);
+ myPntPercent = new SalomeApp_DoubleSpinBox( aSourceBox );
+ VISU::initSpinBox( myPntPercent, 0., 1., .1, "parametric_precision" );
aSrcLayout->addWidget(myPntPercent, 2, 1);
TopLayout->addWidget(aSourceBox, 0, 0, 1, 2);
QLabel* aStepLenLbl = new QLabel (tr("LBL_STEP_LENGTH"), aTopBox);
TopLayout->addWidget(aStepLenLbl, 1, 0);
- myStepLen = new QtxDoubleSpinBox( aTopBox );
- VISU::initSpinBox(myStepLen, DBL_MIN, DBL_MAX);
+ myStepLen = new SalomeApp_DoubleSpinBox( aTopBox );
+ VISU::initSpinBox( myStepLen,
+ std::numeric_limits<double>::min(),
+ std::numeric_limits<double>::max(),
+ .1,
+ "parametric_precision" );
myStepLen->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
TopLayout->addWidget(myStepLen, 1, 1);
connect(myStepLen, SIGNAL(valueChanged(double)), this, SLOT(StepLengthChanged(double)));
QLabel* aIntegStepLenLbl = new QLabel (tr("LBL_INTEGRATION_STEP"), aTopBox);
TopLayout->addWidget(aIntegStepLenLbl, 2, 0);
- myIntegStepLen = new QtxDoubleSpinBox( aTopBox );
- VISU::initSpinBox(myIntegStepLen, DBL_MIN, DBL_MAX);
+ myIntegStepLen = new SalomeApp_DoubleSpinBox( aTopBox );
+ VISU::initSpinBox( myIntegStepLen,
+ std::numeric_limits<double>::min(),
+ std::numeric_limits<double>::max(),
+ .1,
+ "parametric_precision" );
myIntegStepLen->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
TopLayout->addWidget(myIntegStepLen, 2, 1);
connect(myIntegStepLen, SIGNAL(valueChanged(double)), this, SLOT(IntegrationStepChanged(double)));
QLabel* aPropagationLbl = new QLabel (tr("LBL_PROPAGATION_TIME"), aTopBox);
TopLayout->addWidget(aPropagationLbl, 3, 0);
- myPropTime = new QtxDoubleSpinBox( aTopBox );
- VISU::initSpinBox(myPropTime, DBL_MIN, DBL_MAX);
+ myPropTime = new SalomeApp_DoubleSpinBox( aTopBox );
+ VISU::initSpinBox( myPropTime,
+ std::numeric_limits<double>::min(),
+ std::numeric_limits<double>::max(),
+ .1,
+ "parametric_precision" );
myPropTime->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
TopLayout->addWidget(myPropTime, 3, 1);
connect(myPropTime, SIGNAL(valueChanged(double)), this, SLOT(PropagationTimeChanged(double)));
QLabel* aDirLbl = new QLabel (tr("LBL_DIRECTION"),aTopBox);
TopLayout->addWidget(aDirLbl, 4, 0);
myDirCombo = new QComboBox(aTopBox);
- myDirCombo->addItem("Forward");
- myDirCombo->addItem("Backward");
- myDirCombo->addItem("Both");
+ myDirCombo->addItem(tr("Forward"));
+ myDirCombo->addItem(tr("Backward"));
+ myDirCombo->addItem(tr("Both"));
TopLayout->addWidget(myDirCombo, 4, 1);
myUseScalar = new QCheckBox (tr("MAGNITUDE_COLORING_CHK"), aTopBox);
//connect( SelColor, SIGNAL( clicked() ), this, SLOT( setVColor() ) );
TopLayout->addWidget( SelColor, 5, 1);
- myTabBox->addTab(aTopBox, "Stream Lines");
+ myTabBox->addTab(aTopBox, tr("Stream Lines"));
myInputPane = new VisuGUI_InputPane(VISU::TSTREAMLINES, theModule, this);
- myTabBox->addTab(GetScalarPane(), "Scalar Bar");
- myTabBox->addTab(myInputPane, "Input");
+ myTabBox->addTab(GetScalarPane(), tr("Scalar Bar"));
+ myTabBox->addTab(myInputPane, tr("Input"));
aBoxLayout->addWidget(myTabBox);
{}
void VisuGUI_StreamLinesDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TSTREAMLINES>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
if (aPrs == NULL) continue; \
if (aSrcEntry == aPrs->GetEntry().c_str()) { \
onSourceTypeChange(PRSNUM); \
- myUseSrcCombo->setCurrentIndex(PRSNUM); \
- mySrcCombo->setEnabled(true); \
- mySrcCombo->setCurrentIndex(i); \
- return; \
+ myUseSrcCombo->setCurrentIndex(PRSNUM); \
+ mySrcCombo->setEnabled(true); \
+ mySrcCombo->setCurrentIndex(i); \
+ return; \
} \
}
}
int VisuGUI_StreamLinesDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs)
-{
- if(!myInputPane->check() || !GetScalarPane()->check())
- return 0;
-
- int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
- anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
-
- if (anIsOk) {
- myPrsCopy->ShowColored(myUseScalar->isChecked());
- if (!myPrsCopy->IsColored()) {
- SALOMEDS::Color aColor;
- aColor.R = SelColor->color().red()/255.;
- aColor.G = SelColor->color().green()/255.;
- aColor.B = SelColor->color().blue()/255.;
- myPrsCopy->SetColor(aColor);
- }
-
- VISU::StreamLines::Direction aDirection = VISU::StreamLines::BOTH;
- switch (myDirCombo->currentIndex()) {
- case 0:
- aDirection = VISU::StreamLines::FORWARD;
- break;
- case 1:
- aDirection = VISU::StreamLines::BACKWARD;
- break;
- case 2:
- aDirection = VISU::StreamLines::BOTH;
- }
-
- VISU::Prs3d_var aPrs;
- int aSrcSelection = myUseSrcCombo->currentIndex();
- int aSrcItem = (mySrcCombo->count() > 0)? mySrcCombo->currentIndex() : -1;
- if ((aSrcSelection > 0) && (aSrcItem > -1)) {
- VISU::VISUType aType;
- QString aName;
- switch (aSrcSelection) {
- case 1: // Entity
- aPrs = myEntityList[aSrcItem];
- aType = VISU::TENTITY;
- aName = myEntitiesLst[aSrcItem];
- break;
- case 2: // Family
- aPrs = myFamilyList[aSrcItem];
- aType = VISU::TFAMILY;
- aName = myFamilisLst[aSrcItem];
- break;
- case 3: // Group
- aPrs = myGroupList[aSrcItem];
- aType = VISU::TGROUP;
- aName = myGroupsLst[aSrcItem];
- break;
- case 4: // Presentation
- aPrs = myPrsList[aSrcItem];
- break;
- }
- if (CORBA::is_nil(aPrs) && aSrcSelection != 4) {
- aPrs = createMesh(aType, aName);
- }
- }
- anIsOk &= myPrsCopy->SetParams(myIntegStepLen->value(),
- myPropTime->value(),
- myStepLen->value(),
- aPrs,
- myPntPercent->value(),
- aDirection);
- }
-
+{
VISU::TSameAsFactory<VISU::TSTREAMLINES>().Copy(myPrsCopy, thePrs);
-
- return anIsOk;
+ return myStatus;
}
/*!
}
+void VisuGUI_StreamLinesDlg::storeToPrsCopy() {
+
+ if(!myInputPane->check() || !GetScalarPane()->check()) {
+ myStatus = false;
+ return;
+ }
+
+ myStatus = myInputPane->storeToPrsObject( myPrsCopy );
+ myStatus &= GetScalarPane()->storeToPrsObject( myPrsCopy );
+
+ if (myStatus) {
+ myPrsCopy->ShowColored(myUseScalar->isChecked());
+ if (!myPrsCopy->IsColored()) {
+ SALOMEDS::Color aColor;
+ aColor.R = SelColor->color().red()/255.;
+ aColor.G = SelColor->color().green()/255.;
+ aColor.B = SelColor->color().blue()/255.;
+ myPrsCopy->SetColor(aColor);
+ }
+
+ VISU::StreamLines::Direction aDirection = VISU::StreamLines::BOTH;
+ switch (myDirCombo->currentIndex()) {
+ case 0:
+ aDirection = VISU::StreamLines::FORWARD;
+ break;
+ case 1:
+ aDirection = VISU::StreamLines::BACKWARD;
+ break;
+ case 2:
+ aDirection = VISU::StreamLines::BOTH;
+ }
+
+ VISU::Prs3d_var aPrs;
+ int aSrcSelection = myUseSrcCombo->currentIndex();
+ int aSrcItem = (mySrcCombo->count() > 0)? mySrcCombo->currentIndex() : -1;
+ if ((aSrcSelection > 0) && (aSrcItem > -1)) {
+ VISU::VISUType aType;
+ QString aName;
+ switch (aSrcSelection) {
+ case 1: // Entity
+ aPrs = myEntityList[aSrcItem];
+ aType = VISU::TENTITY;
+ aName = myEntitiesLst[aSrcItem];
+ break;
+ case 2: // Family
+ aPrs = myFamilyList[aSrcItem];
+ aType = VISU::TFAMILY;
+ aName = myFamilisLst[aSrcItem];
+ break;
+ case 3: // Group
+ aPrs = myGroupList[aSrcItem];
+ aType = VISU::TGROUP;
+ aName = myGroupsLst[aSrcItem];
+ break;
+ case 4: // Presentation
+ aPrs = myPrsList[aSrcItem];
+ break;
+ }
+ if (CORBA::is_nil(aPrs) && aSrcSelection != 4) {
+ aPrs = createMesh(aType, aName);
+ }
+ }
+ myStatus &= myPrsCopy->SetParams(myIntegStepLen->value(),
+ myPropTime->value(),
+ myStepLen->value(),
+ aPrs,
+ myPntPercent->value(),
+ aDirection);
+ }
+}
+
+
VISU::Mesh_ptr VisuGUI_StreamLinesDlg::createMesh (VISU::VISUType theType, QString theName)
{
return VISU::Mesh::_nil();
void VisuGUI_StreamLinesDlg::accept()
{
+
+ //rnv: To fix the IPAL21920: WinTC5.1.4: parameters of StreamLines are not taken in account.
+ //rnv: Show confirmation message in case if 'Used points' and 'Step length' were re-calculated.
+ //1. Store parameters to the myPrsCopy
+ storeToPrsCopy();
+
+ //2. Check 'Used points' and 'Step length' parameters
+ if( myStepLen->value() > myPrsCopy->GetStepLength() ||
+ myPntPercent->value() > myPrsCopy->GetUsedPoints() ) {
+ QString aWarning = tr("STREAM_MEMORY_ALERT");
+ if( SUIT_MessageBox::warning( this, tr( "WRN_VISU_WARNING" ), aWarning, tr( "BUT_OK" ), tr( "CANCEL" ) ) == 1 ) {
+ // Set re-calculated values
+ myStepLen->setValue(myPrsCopy->GetStepLength());
+ myPntPercent->setValue(myPrsCopy->GetUsedPoints());
+ return;
+ }
+ }
+
VisuGUI_ScalarBarBaseDlg::accept();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_StreamLinesDlg.h
// Author : Vitaly SMETANNIKOV
// Module : VISU
class SalomeApp_Module;
class VisuGUI_InputPane;
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class QtxColorButton;
namespace VISU
~VisuGUI_StreamLinesDlg();
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
protected:
virtual QString GetContextHelpFilePath();
+ void storeToPrsCopy();
protected slots:
void accept();
private:
VISU::Mesh_ptr createMesh(VISU::VISUType theType, QString theName);
- QtxDoubleSpinBox* myStepLen;
- QtxDoubleSpinBox* myIntegStepLen;
- QtxDoubleSpinBox* myPropTime;
+ SalomeApp_DoubleSpinBox* myStepLen;
+ SalomeApp_DoubleSpinBox* myIntegStepLen;
+ SalomeApp_DoubleSpinBox* myPropTime;
QComboBox* myDirCombo;
QCheckBox* myUseScalar;
QtxColorButton* SelColor;
//QCheckBox* myUseSrcChk;
QComboBox* myUseSrcCombo;
- QtxDoubleSpinBox* myPntPercent;
+ SalomeApp_DoubleSpinBox* myPntPercent;
QComboBox* mySrcCombo;
QTabWidget* myTabBox;
_PTR(SObject) mySelectionObj;
SALOME::GenericObjPtr<VISU::StreamLines_i> myPrsCopy;
SalomeApp_Module* myVisuGUI;
+ bool myStatus;
private slots:
//void setVColor();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Slider.cxx
// Author : Oleg UVAROV
// Module : VISU
//
#include "VisuGUI_Sweep.h"
+#include "VisuGUI_Tools.h"
#include "SUIT_ResourceMgr.h"
#include "LightApp_SelectionMgr.h"
+#include <SalomeApp_IntSpinBox.h>
+#include <SalomeApp_DoubleSpinBox.h>
+
#include "VISU_Actor.h"
#include "VisuGUI.h"
#include "VISU_Actor.h"
#include "QtxDockWidget.h"
-#include "QtxIntSpinBox.h"
-#include "QtxDoubleSpinBox.h"
#include <QMainWindow>
#include <QComboBox>
Constructor
*/
VisuGUI_Sweep::VisuGUI_Sweep( VisuGUI* theModule,
- QMainWindow* theParent,
- LightApp_SelectionMgr* theSelectionMgr )
+ QMainWindow* theParent,
+ LightApp_SelectionMgr* theSelectionMgr )
: QWidget( theParent )
, myModule( theModule )
, myViewWindow( NULL )
{
QVBoxLayout* aVBoxLayout = new QVBoxLayout( aNavigationTab );
{
- QHBoxLayout* aHBoxLayout = new QHBoxLayout();
-
- QLabel* aStartSweepPosition = new QLabel( aNavigationTab );
- aStartSweepPosition->setText( tr( "START_SWEEP_POSITION" ) );
- aHBoxLayout->addWidget( aStartSweepPosition );
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+
+ QLabel* aStartSweepPosition = new QLabel( aNavigationTab );
+ aStartSweepPosition->setText( tr( "START_SWEEP_POSITION" ) );
+ aHBoxLayout->addWidget( aStartSweepPosition );
- mySweepSlider = new QSlider( aNavigationTab );
- mySweepSlider->setOrientation( Qt::Horizontal );
- mySweepSlider->setMinimum( 0 );
- aHBoxLayout->addWidget( mySweepSlider );
-
- QLabel* anEndSweepPosition = new QLabel( aNavigationTab );
- anEndSweepPosition->setText( tr( "END_SWEEP_POSITION" ) );
- aHBoxLayout->addWidget( anEndSweepPosition );
-
- aVBoxLayout->addLayout( aHBoxLayout );
+ mySweepSlider = new QSlider( aNavigationTab );
+ mySweepSlider->setOrientation( Qt::Horizontal );
+ mySweepSlider->setMinimum( 0 );
+ aHBoxLayout->addWidget( mySweepSlider );
+
+ QLabel* anEndSweepPosition = new QLabel( aNavigationTab );
+ anEndSweepPosition->setText( tr( "END_SWEEP_POSITION" ) );
+ aHBoxLayout->addWidget( anEndSweepPosition );
+
+ aVBoxLayout->addLayout( aHBoxLayout );
}
{
- QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
- myFirstButton = new QToolButton( aNavigationTab );
- myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) );
- myFirstButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- connect( myFirstButton, SIGNAL( clicked() ), SLOT( onFirst() ) );
- aHBoxLayout->addWidget( myFirstButton );
-
- myPreviousButton = new QToolButton( aNavigationTab );
- myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) );
- myPreviousButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- connect( myPreviousButton, SIGNAL( clicked() ), SLOT( onPrevious() ) );
- aHBoxLayout->addWidget( myPreviousButton );
-
- myPlayButton = new QToolButton( aNavigationTab );
- myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
- myPlayButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- myPlayButton->setCheckable( true );
- aHBoxLayout->addWidget( myPlayButton );
-
- myNextButton = new QToolButton( aNavigationTab );
- myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) );
- myNextButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- connect( myNextButton, SIGNAL( clicked() ), SLOT( onNext() ) );
- aHBoxLayout->addWidget( myNextButton );
-
- myLastButton = new QToolButton( aNavigationTab );
- myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) );
- myLastButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- connect( myLastButton, SIGNAL( clicked() ), SLOT( onLast() ) );
- aHBoxLayout->addWidget( myLastButton );
-
- aVBoxLayout->addLayout( aHBoxLayout );
+ myFirstButton = new QToolButton( aNavigationTab );
+ myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) );
+ myFirstButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ connect( myFirstButton, SIGNAL( clicked() ), SLOT( onFirst() ) );
+ aHBoxLayout->addWidget( myFirstButton );
+
+ myPreviousButton = new QToolButton( aNavigationTab );
+ myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) );
+ myPreviousButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ connect( myPreviousButton, SIGNAL( clicked() ), SLOT( onPrevious() ) );
+ aHBoxLayout->addWidget( myPreviousButton );
+
+ myPlayButton = new QToolButton( aNavigationTab );
+ myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
+ myPlayButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myPlayButton->setCheckable( true );
+ aHBoxLayout->addWidget( myPlayButton );
+
+ myNextButton = new QToolButton( aNavigationTab );
+ myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) );
+ myNextButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ connect( myNextButton, SIGNAL( clicked() ), SLOT( onNext() ) );
+ aHBoxLayout->addWidget( myNextButton );
+
+ myLastButton = new QToolButton( aNavigationTab );
+ myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) );
+ myLastButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ connect( myLastButton, SIGNAL( clicked() ), SLOT( onLast() ) );
+ aHBoxLayout->addWidget( myLastButton );
+
+ aVBoxLayout->addLayout( aHBoxLayout );
}
{
- QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
- QToolButton* aStopButton = new QToolButton( aNavigationTab );
- aStopButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SWEEP_STOP" ) ) );
- aStopButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- aStopButton->setCheckable( false );
- connect( aStopButton, SIGNAL( clicked( ) ), SLOT( onStop( ) ) );
- aHBoxLayout->addWidget( aStopButton );
-
- myIsCycled = new QCheckBox( aNavigationTab );
- myIsCycled->setText( tr( "IS_CYCLED" ) );
- myIsCycled->setChecked( false );
- aHBoxLayout->addWidget( myIsCycled );
-
- aVBoxLayout->addLayout( aHBoxLayout );
+ QToolButton* aStopButton = new QToolButton( aNavigationTab );
+ aStopButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SWEEP_STOP" ) ) );
+ aStopButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ aStopButton->setCheckable( false );
+ connect( aStopButton, SIGNAL( clicked( ) ), SLOT( onStop( ) ) );
+ aHBoxLayout->addWidget( aStopButton );
+
+ myIsCycled = new QCheckBox( aNavigationTab );
+ myIsCycled->setText( tr( "IS_CYCLED" ) );
+ myIsCycled->setChecked( false );
+ aHBoxLayout->addWidget( myIsCycled );
+
+ aVBoxLayout->addLayout( aHBoxLayout );
}
aTabWidget->addTab( aNavigationTab, tr( "NAVIGATION_TAB" ) );
{
QGridLayout* aGridLayout = new QGridLayout( aPropertiesTab );
{
- QHBoxLayout* aHBoxLayout = new QHBoxLayout();
-
- QLabel* aModeAnnotation = new QLabel( aPropertiesTab );
- aModeAnnotation->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
- aModeAnnotation->setText( tr( "MODE" ) );
- aHBoxLayout->addWidget( aModeAnnotation );
-
- mySweepMode = new QComboBox( aPropertiesTab );
- mySweepMode->insertItems( 0, QStringList()
- << tr( "LINEAR" )
- << tr( "COSINUSOIDAL" )
- << tr( "SINUSOIDAL" ) );
- mySweepMode->setCurrentIndex( aResourceMgr->integerValue( "VISU", "sweeping_modes", 0 ) );
- aHBoxLayout->addWidget( mySweepMode );
-
- myIntervals = new QComboBox( aPropertiesTab );
- myIntervals->insertItems( 0, QStringList()
- << tr( "[ 0, +PI ]" )
- << tr( "[ -PI, +PI ]" ) );
- myIntervals->setCurrentIndex( aResourceMgr->integerValue( "VISU", "sweeping_is2PI", 0 ) );
- aHBoxLayout->addWidget( myIntervals );
-
- aGridLayout->addLayout( aHBoxLayout, 0, 0, 1, 2 );
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+
+ QLabel* aModeAnnotation = new QLabel( aPropertiesTab );
+ aModeAnnotation->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
+ aModeAnnotation->setText( tr( "MODE" ) );
+ aHBoxLayout->addWidget( aModeAnnotation );
+
+ mySweepMode = new QComboBox( aPropertiesTab );
+ mySweepMode->insertItems( 0, QStringList()
+ << tr( "LINEAR" )
+ << tr( "COSINUSOIDAL" )
+ << tr( "SINUSOIDAL" ) );
+ mySweepMode->setCurrentIndex( aResourceMgr->integerValue( "VISU", "sweeping_modes", 0 ) );
+ aHBoxLayout->addWidget( mySweepMode );
+
+ myIntervals = new QComboBox( aPropertiesTab );
+ myIntervals->insertItems( 0, QStringList()
+ << tr( "[ 0, +PI ]" )
+ << tr( "[ -PI, +PI ]" ) );
+ myIntervals->setCurrentIndex( aResourceMgr->integerValue( "VISU", "sweeping_is2PI", 0 ) );
+ aHBoxLayout->addWidget( myIntervals );
+
+ aGridLayout->addLayout( aHBoxLayout, 0, 0, 1, 2 );
}
QLabel* aNumberOfStepsAnnotation = new QLabel( aPropertiesTab );
aNumberOfStepsAnnotation->setText( tr( "NUMBER_OF_STEPS" ) );
aGridLayout->addWidget( aNumberOfStepsAnnotation, 1, 0, 1, 1 );
- myNumberOfSteps = new QtxIntSpinBox( aPropertiesTab );
+ myNumberOfSteps = new SalomeApp_IntSpinBox( aPropertiesTab );
+ myNumberOfSteps->setAcceptNames( false );
connect( myNumberOfSteps, SIGNAL( valueChanged( int ) ), SLOT( onNumberOfStepsChanged( int ) ) );
myNumberOfSteps->setValue( aResourceMgr->integerValue( "VISU", "sweeping_number_steps", 40 ) );
aGridLayout->addWidget( myNumberOfSteps, 1, 1, 1, 1 );
aStepDelayAnnotation->setText( tr( "DELAY_BETWEEN_STEPS" ) );
aGridLayout->addWidget( aStepDelayAnnotation, 2, 0, 1, 1 );
- myStepDelay = new QtxDoubleSpinBox( aPropertiesTab );
+ myStepDelay = new SalomeApp_DoubleSpinBox( aPropertiesTab );
+ VISU::initSpinBox( myStepDelay, 0., 99.99, .1, "parametric_precision" );
myStepDelay->setValue( aResourceMgr->doubleValue("VISU", "sweeping_time_step", 0.1) );
aGridLayout->addWidget( myStepDelay, 2, 1, 1, 1 );
}
VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast< VISU::ColoredPrs3d_i* >( aPrs3d );
anIsValidSelection &= ( aColoredPrs3d && aColoredPrs3d->IsTimeStampFixed() );
+ myColoredPrs3d = aColoredPrs3d;
+
if ( myColoredPrs3d ) {
myColoredPrs3d->SetMapScale( 1.0 );
myColoredPrs3d->UpdateActors();
}
- myColoredPrs3d = aColoredPrs3d;
-
anIsValidSelection &= ( anActor && anActor->GetVisibility() );
myActor = anActor;
//----------------------------------------------------------------------------
void VisuGUI_Sweep::onValueChanged( int value )
{
- bool anIsValidSelection = ( myColoredPrs3d != NULL )
- && (myActor.GetPointer() != NULL );
+ bool anIsValidSelection = ( myColoredPrs3d != 0 ) && ( myActor != 0 );
if ( !anIsValidSelection )
return;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Sweep.h
// Author : Oleg UVAROV
class QComboBox;
class QToolButton;
class QSlider;
-class QSpinBox;
class QCheckBox;
class QMainWindow;
class QTimer;
class QAction;
-class QtxIntSpinBox;
-class QtxDoubleSpinBox;
+class SalomeApp_IntSpinBox;
+class SalomeApp_DoubleSpinBox;
class LightApp_SelectionMgr;
class SVTK_ViewWindow;
public:
VisuGUI_Sweep( VisuGUI* theModule,
- QMainWindow* theParent,
- LightApp_SelectionMgr* theSelectionMgr );
+ QMainWindow* theParent,
+ LightApp_SelectionMgr* theSelectionMgr );
virtual ~VisuGUI_Sweep();
QCheckBox* myIsCycled;
QComboBox* mySweepMode;
- QtxIntSpinBox* myNumberOfSteps;
+ SalomeApp_IntSpinBox* myNumberOfSteps;
QComboBox* myIntervals;
- QtxDoubleSpinBox* myStepDelay;
+ SalomeApp_DoubleSpinBox* myStepDelay;
QTimer* myTimer;
QPixmap myPlayPixmap;
VisuGUI* myModule;
SVTK_ViewWindow* myViewWindow;
- vtkSmartPointer< VISU_Actor > myActor;
+ VISU_Actor* myActor;
SALOME::GenericObjPtr< VISU::ColoredPrs3d_i > myColoredPrs3d;
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Table3dDlg.cxx
// Author : Laurent CORNABE & Hubert ROLLAND
#include <SUIT_MessageBox.h>
#include <SUIT_ResourceMgr.h>
#include <LightApp_Application.h>
+#include <SalomeApp_IntSpinBox.h>
+#include <SalomeApp_DoubleSpinBox.h>
#include <SVTK_FontWidget.h>
-#include <QtxDoubleSpinBox.h>
#include <QGridLayout>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QTabWidget>
#include <QRadioButton>
-#include <QSpinBox>
#include <QCheckBox>
#include <QLabel>
#include <QPushButton>
// scale
QLabel* scaleLabel = new QLabel( tr( "SCALE" ), this );
- ScaleSpn = new QtxDoubleSpinBox( -1.e6, 1.e6, 0.1, this );
+ ScaleSpn = new SalomeApp_DoubleSpinBox( this );
+ VISU::initSpinBox( ScaleSpn, -1.e6, 1.e6, 0.1, "parametric_precision" );
// Presentation type
GBPrsTypeBox = new QGroupBox( tr( "PRESENTATION_TYPE" ), this );
GBPrsType = new QButtonGroup( GBPrsTypeBox );
// nb Contours
QLabel* nbContLabel = new QLabel( tr( "NUMBER_CONTOURS" ), this );
- NbContoursSpn = new QSpinBox( this );
+ NbContoursSpn = new SalomeApp_IntSpinBox( this );
NbContoursSpn->setMinimum( 1 );
NbContoursSpn->setMaximum( 999 );
NbContoursSpn->setSingleStep( 1 );
ColLabGroupLayout->setMargin( 11 );
QLabel* ColorLabel = new QLabel( tr( "LBL_NB_COLORS" ), ColLabGroup );
- ColorSpin = new QSpinBox( ColLabGroup );
+ ColorSpin = new SalomeApp_IntSpinBox( ColLabGroup );
ColorSpin->setMinimum( 2 );
ColorSpin->setMaximum( 256 );
ColorSpin->setSingleStep( 1 );
ColorSpin->setValue( 64 );
QLabel* LabelLabel = new QLabel( tr( "LBL_NB_LABELS" ), ColLabGroup );
- LabelSpin = new QSpinBox( ColLabGroup );
+ LabelSpin = new SalomeApp_IntSpinBox( ColLabGroup );
LabelSpin->setMinimum( 2 );
LabelSpin->setMaximum( 65 );
LabelSpin->setSingleStep( 1 );
OriginGroupLayout->setMargin( 11 );
QLabel* XLabel = new QLabel( tr( "LBL_X" ), OriginGroup );
- XSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, OriginGroup );
+ XSpin = new SalomeApp_DoubleSpinBox( OriginGroup );
+ VISU::initSpinBox( XSpin, 0.0, 1.0, 0.1, "parametric_precision" );
XSpin->setMinimumWidth( 70 );
XSpin->setValue( 0.01 );
QLabel* YLabel = new QLabel( tr( "LBL_Y" ), OriginGroup );
- YSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, OriginGroup );
+ YSpin = new SalomeApp_DoubleSpinBox( OriginGroup );
+ VISU::initSpinBox( YSpin, 0.0, 1.0, 0.1, "parametric_precision" );
YSpin->setMinimumWidth( 70 );
YSpin->setValue( 0.1 );
DimGroupLayout->setMargin( 11 );
QLabel* WidthLabel = new QLabel( tr( "LBL_WIDTH" ), DimGroup );
- WidthSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, DimGroup );
+ WidthSpin = new SalomeApp_DoubleSpinBox( DimGroup );
+ VISU::initSpinBox( WidthSpin, 0.0, 1.0, 0.1, "parametric_precision" );
WidthSpin->setMinimumWidth( 70 );
WidthSpin->setValue( 0.1 );
QLabel* HeightLabel = new QLabel( tr( "LBL_HEIGHT" ), DimGroup );
- HeightSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, DimGroup );
+ HeightSpin = new SalomeApp_DoubleSpinBox( DimGroup );
+ VISU::initSpinBox( HeightSpin, 0.0, 1.0, 0.1, "parametric_precision" );
HeightSpin->setMinimumWidth( 70 );
HeightSpin->setValue( 0.8 );
myBarPrs->GetTitleColor( R, G, B );
setPosAndSize( myBarPrs->GetPosX(),
- myBarPrs->GetPosY(),
- myBarPrs->GetWidth(),
- myBarPrs->GetHeight(),
- myBarPrs->GetBarOrientation() );
+ myBarPrs->GetPosY(),
+ myBarPrs->GetWidth(),
+ myBarPrs->GetHeight(),
+ myBarPrs->GetBarOrientation() );
myVerTS = myBarPrs->GetTitleSize();
myVerLS = myBarPrs->GetLabelSize();
myBarDlg->setUnitsVisible( myBarPrs->IsUnitsVisible() );
myTextDlg->myTitleFont->SetData( QColor( (int)(R*255.), (int)(G*255.), (int)(B*255.) ),
- myBarPrs->GetTitFontType(),
- myBarPrs->IsBoldTitle(),
- myBarPrs->IsItalicTitle(),
- myBarPrs->IsShadowTitle() );
+ myBarPrs->GetTitFontType(),
+ myBarPrs->IsBoldTitle(),
+ myBarPrs->IsItalicTitle(),
+ myBarPrs->IsShadowTitle() );
// "Labels"
myBarPrs->GetLabelColor( R, G, B );
myTextDlg->myLabelFont->SetData( QColor( (int)(R*255.), (int)(G*255.), (int)(B*255.) ),
myBarPrs->GetLblFontType(),
- myBarPrs->IsBoldLabel(),
- myBarPrs->IsItalicLabel(),
- myBarPrs->IsShadowLabel() );
+ myBarPrs->IsBoldLabel(),
+ myBarPrs->IsItalicLabel(),
+ myBarPrs->IsShadowLabel() );
}
//----------------------------------------------------------------------------
myBarPrs->SetShadowTitle( isTitleShadow );
myBarPrs->SetTitFontType( aTitleFontFamily );
myBarPrs->SetTitleColor( aTitColor.red()/255.,
- aTitColor.green()/255.,
- aTitColor.blue()/255. );
+ aTitColor.green()/255.,
+ aTitColor.blue()/255. );
// "Label"
QColor aLblColor( 255, 255, 255 );
myBarPrs->SetShadowLabel( isLabelShadow );
myBarPrs->SetLblFontType( aLabelFontFamily );
myBarPrs->SetLabelColor( aLblColor.red()/255.,
- aLblColor.green()/255.,
- aLblColor.blue()/255. );
+ aLblColor.green()/255.,
+ aLblColor.blue()/255. );
// myIsStoreTextProp = false;
}
return 1;
*/
void VisuGUI_TableScalarBarPane::XYChanged( double )
{
- QtxDoubleSpinBox* snd = (QtxDoubleSpinBox*)sender();
+ SalomeApp_DoubleSpinBox* snd = (SalomeApp_DoubleSpinBox*)sender();
if ( snd == XSpin ) {
WidthSpin->setMaximum( 1.0 - XSpin->value() );
}
if ( RBIrange->isChecked() ) {
if (minVal >= maxVal) {
SUIT_MessageBox::warning( this,tr("WRN_VISU"),
- tr("MSG_MINMAX_VALUES") );
+ tr("MSG_MINMAX_VALUES") );
return false;
}
}
if ( CBLog->isChecked() ) {
if ( minVal <= 0.0 || maxVal <= 0.0) {
if ( RBIrange->isChecked() ) {
- SUIT_MessageBox::warning( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_RANGE") );
+ SUIT_MessageBox::warning( this,
+ tr("WRN_VISU"),
+ tr("WRN_LOGARITHMIC_RANGE") );
} else {
- if ( minVal == 0)
- SUIT_MessageBox::warning( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_RANGE") );
- else
- SUIT_MessageBox::warning( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_FIELD_RANGE") );
- RBIrange->setChecked(true);
- changeRange(1);
+ if ( minVal == 0)
+ SUIT_MessageBox::warning( this,
+ tr("WRN_VISU"),
+ tr("WRN_LOGARITHMIC_RANGE") );
+ else
+ SUIT_MessageBox::warning( this,
+ tr("WRN_VISU"),
+ tr("WRN_LOGARITHMIC_FIELD_RANGE") );
+ RBIrange->setChecked(true);
+ changeRange(1);
}
return false;
}
platform = "application";
#endif
SUIT_MessageBox::warning( this, QObject::tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Table3dDlg.h
// Author : Laurent CORNABE & Hubert ROLLAND
class QLineEdit;
class QRadioButton;
class QPushButton;
-class QSpinBox;
-class QtxDoubleSpinBox;
+class SalomeApp_IntSpinBox;
+class SalomeApp_DoubleSpinBox;
class VisuGUI_TextPrefDlg;
class VisuGUI_BarPrefDlg;
class SVTK_ViewWindow;
SVTK_ViewWindow* myViewWindow;
VISU::PointMap3d_i* myPrs;
- QtxDoubleSpinBox* ScaleSpn;
+ SalomeApp_DoubleSpinBox* ScaleSpn;
QGroupBox* GBPrsTypeBox;
QButtonGroup* GBPrsType;
- QSpinBox* NbContoursSpn;
+ SalomeApp_IntSpinBox* NbContoursSpn;
};
class VisuGUI_TableScalarBarPane : public QWidget
QRadioButton* RBhori;
QRadioButton* RBvert;
- QtxDoubleSpinBox* XSpin;
- QtxDoubleSpinBox* YSpin;
+ SalomeApp_DoubleSpinBox* XSpin;
+ SalomeApp_DoubleSpinBox* YSpin;
- QtxDoubleSpinBox* WidthSpin;
- QtxDoubleSpinBox* HeightSpin;
+ SalomeApp_DoubleSpinBox* WidthSpin;
+ SalomeApp_DoubleSpinBox* HeightSpin;
- QSpinBox* ColorSpin;
- QSpinBox* LabelSpin;
+ SalomeApp_IntSpinBox* ColorSpin;
+ SalomeApp_IntSpinBox* LabelSpin;
QCheckBox* CBSave;
QCheckBox* CBLog;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_TimeAnimation.cxx
// Author : Vitaly SMETANNIKOV
// Module : VISU
#include "VisuGUI_DeformedShapeDlg.h"
#include "VisuGUI_CutPlanesDlg.h"
#include "VisuGUI_CutLinesDlg.h"
+#include "VisuGUI_CutSegmentDlg.h"
#include "VisuGUI_Plot3DDlg.h"
#include "VisuGUI_VectorsDlg.h"
#include "VisuGUI_IsoSurfacesDlg.h"
#include "VISU_CutPlanes_i.hh"
#include "VISU_Plot3D_i.hh"
#include "VISU_CutLines_i.hh"
+#include "VISU_CutSegment_i.hh"
#include "VISU_Vectors_i.hh"
#include "VISU_StreamLines_i.hh"
#include "VISU_DeformedShapeAndScalarMap_i.hh"
#include "VISU_ScalarBarActor.hxx"
#include "VISU_Actor.h"
+#include <SalomeApp_DoubleSpinBox.h>
+#include <SalomeApp_IntSpinBox.h>
#include "SalomeApp_Study.h"
#include "LightApp_Application.h"
#include "SVTK_ViewWindow.h"
+#include "VTKViewer_Algorithm.h"
+
#include "SUIT_OverrideCursor.h"
#include "SUIT_MessageBox.h"
#include "SUIT_ResourceMgr.h"
if(theAnimator->getNbFields() == 0)
return;
+ int aRefFieldId = ( theAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) ? theFieldId : 0;
+
+ VISU::ColoredPrs3d_i* aInitialPrs3d = 0;
+ if (theAnimator->getFieldData(aRefFieldId).myPrs.size() > 0)
+ aInitialPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(theAnimator->getFieldData(aRefFieldId).myPrs[0]);
+
theAnimator->generatePresentations(theFieldId);
- FieldData& aFieldData = theAnimator->getFieldData(theFieldId);
+ if (!aInitialPrs3d)
+ aInitialPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(theAnimator->getFieldData(aRefFieldId).myPrs[0]);
- int aRefFieldId = ( theAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) ? theFieldId : 0;
- if(VISU::ColoredPrs3d_i* aInitialPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(theAnimator->getFieldData(aRefFieldId).myPrs[0])){
+ if (aInitialPrs3d) {
+ FieldData& aFieldData = theAnimator->getFieldData(theFieldId);
for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId];
if(aDeformedAndScalPrs){
aTimeStampNum = aDeformedAndScalPrs->GetScalarTimeStampNumber();
}
+
aColoredPrs3d->SameAs(aInitialPrs3d);
+
+ // rnv: fix for the 20870: EDF 1410 VISU: Anomaly in the Gauss point representation.
+ // special case for the "Gauss Points" presentation,
+ // update the LookupTable in the mapper, after assign properties of the presentation
+ // using SameAs(...) method.
+ if(aFieldData.myPrsType == VISU::TGAUSSPOINTS) {
+ aColoredPrs3d->UpdateMapperLookupTable();
+ }
if(aDeformedAndScalPrs){
aDeformedAndScalPrs->SetScalarField(aDeformedAndScalPrs->GetScalarEntity(),
}
ArrangeDlg::ArrangeDlg(QWidget* theParent,
- const SalomeApp_Module* theModule,
- SVTK_ViewWindow* theViewWindow)
+ const SalomeApp_Module* theModule,
+ SVTK_ViewWindow* theViewWindow)
: QDialog(theParent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
myAnimator(NULL),
myViewWindow(theViewWindow)
myCurrent = 0;
init();
QStringList aPrsNames;
- vtkActorCollection *aCollection = myViewWindow->getRenderer()->GetActors();
+ VTK::ActorCollectionCopy aCopy(myViewWindow->getRenderer()->GetActors());
+ vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor* anActor = aCollection->GetNextActor()){
if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor)) {
if(anVISUActor->GetVisibility() != 0){
- if (VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d()){
- if(!myPrsMap.contains(aPrs)){
- Handle(SALOME_InteractiveObject) anIO = aPrs->GetIO();
- if(!anIO->hasEntry())
- continue;
- SalomeApp_Study* aStudy = VISU::GetAppStudy(theModule);
- VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anIO->getEntry());
- if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
- _PTR(GenericAttribute) anAttr;
- if (aSObject->FindAttribute(anAttr, "AttributeName")) {
- _PTR(AttributeName) aName(anAttr);
- QString strIn(aName->Value().c_str());
- aPrsNames.append(strIn);
- myPrsMap[aPrs] = myOffsets.count();
- Offset aOffs;
- anVISUActor->GetPosition(aOffs.myOffset);
- myOffsets.append(aOffs);
- }
- }
- }
- }
+ if (VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d()){
+ if(!myPrsMap.contains(aPrs)){
+ Handle(SALOME_InteractiveObject) anIO = aPrs->GetIO();
+ if(!anIO->hasEntry())
+ continue;
+ SalomeApp_Study* aStudy = VISU::GetAppStudy(theModule);
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anIO->getEntry());
+ if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
+ _PTR(GenericAttribute) anAttr;
+ if (aSObject->FindAttribute(anAttr, "AttributeName")) {
+ _PTR(AttributeName) aName(anAttr);
+ QString strIn(aName->Value().c_str());
+ aPrsNames.append(strIn);
+ myPrsMap[aPrs] = myOffsets.count();
+ Offset aOffs;
+ anVISUActor->GetPosition(aOffs.myOffset);
+ myOffsets.append(aOffs);
+ }
+ }
+ }
+ }
}
} else { //if PointMap3d Actor
if (VISU_ActorBase* anActorBase = dynamic_cast<VISU_ActorBase*>(anActor))
- if(anActorBase->GetVisibility() != 0)
- if (VISU::PointMap3d_i* aPrs = dynamic_cast<VISU::PointMap3d_i*>(anActorBase->GetFactory())) {
- if(!myPointMapPrsMap.contains(aPrs)){
- Handle(SALOME_InteractiveObject) anIO = aPrs->GetIO();
- if(!anIO->hasEntry())
- continue;
- SalomeApp_Study* aStudy = VISU::GetAppStudy(theModule);
- VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anIO->getEntry());
- if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
- _PTR(GenericAttribute) anAttr;
- if (aSObject->FindAttribute(anAttr, "AttributeName")) {
- _PTR(AttributeName) aName(anAttr);
- QString strIn(aName->Value().c_str());
- aPrsNames.append(strIn);
- myPointMapPrsMap[aPrs] = myOffsets.count();
- Offset aOffs;
- anActorBase->GetPosition(aOffs.myOffset);
- myOffsets.append(aOffs);
- }
- }
- }
- }
+ if(anActorBase->GetVisibility() != 0)
+ if (VISU::PointMap3d_i* aPrs = dynamic_cast<VISU::PointMap3d_i*>(anActorBase->GetFactory())) {
+ if(!myPointMapPrsMap.contains(aPrs)){
+ Handle(SALOME_InteractiveObject) anIO = aPrs->GetIO();
+ if(!anIO->hasEntry())
+ continue;
+ SalomeApp_Study* aStudy = VISU::GetAppStudy(theModule);
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anIO->getEntry());
+ if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
+ _PTR(GenericAttribute) anAttr;
+ if (aSObject->FindAttribute(anAttr, "AttributeName")) {
+ _PTR(AttributeName) aName(anAttr);
+ QString strIn(aName->Value().c_str());
+ aPrsNames.append(strIn);
+ myPointMapPrsMap[aPrs] = myOffsets.count();
+ Offset aOffs;
+ anActorBase->GetPosition(aOffs.myOffset);
+ myOffsets.append(aOffs);
+ }
+ }
+ }
+ }
}
}
myFieldLst->addItems(aPrsNames);
QHBoxLayout* aHLay = new QHBoxLayout( aDistPane );
aHLay->setSpacing(5);
aHLay->addWidget( new QLabel("Relative Distance", aDistPane) );
- myDistVal = new QtxDoubleSpinBox (-10,10, 0.5, aDistPane);
+ myDistVal = new SalomeApp_DoubleSpinBox( aDistPane );
+ VISU::initSpinBox( myDistVal, -10., 10., 0.5, "length_precision" );
myDistVal->setValue(1);
aHLay->addWidget( myDistVal );
myFieldLst = new QListWidget(aManualPane);
aHLay->addWidget( myFieldLst );
connect( myFieldLst, SIGNAL( currentRowChanged(int) ),
- this, SLOT( onFieldChange(int) ) );
+ this, SLOT( onFieldChange(int) ) );
QWidget* aCoordPane = new QWidget( aManualPane);
aHLay->addWidget( aCoordPane );
aCoordLayout->setSpacing(5);
aCoordLayout->addWidget( new QLabel("X", aCoordPane), 0, 0 );
- myCoord[0] = new QtxDoubleSpinBox(aCoordPane);
- myCoord[0]->setRange(-MAXVAL, MAXVAL);
+ myCoord[0] = new SalomeApp_DoubleSpinBox(aCoordPane);
+ VISU::initSpinBox( myCoord[0], -MAXVAL, MAXVAL, 1., "length_precision" );
aCoordLayout->addWidget( myCoord[0], 0, 1 );
aCoordLayout->addWidget( new QLabel("Y", aCoordPane), 1, 0 );
- myCoord[1] = new QtxDoubleSpinBox(aCoordPane);
- myCoord[1]->setRange(-MAXVAL, MAXVAL);
+ myCoord[1] = new SalomeApp_DoubleSpinBox(aCoordPane);
+ VISU::initSpinBox( myCoord[1], -MAXVAL, MAXVAL, 1., "length_precision" );
aCoordLayout->addWidget( myCoord[1], 1, 1 );
aCoordLayout->addWidget( new QLabel("Z", aCoordPane), 2, 0 );
- myCoord[2] = new QtxDoubleSpinBox(aCoordPane);
- myCoord[2]->setRange(-MAXVAL, MAXVAL);
+ myCoord[2] = new SalomeApp_DoubleSpinBox(aCoordPane);
+ VISU::initSpinBox( myCoord[2], -MAXVAL, MAXVAL, 1., "length_precision" );
aCoordLayout->addWidget( myCoord[2], 2, 1 );
myStackWgt->insertWidget(ManualMode, aManualPane );
if (VISU_Actor* anActor = VISU::FindActor(myViewWindow, aPrs))
anActor->SetPosition(aOffs.myOffset);
if (mySaveChk)
- if (mySaveChk->isChecked())
- aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]);
+ if (mySaveChk->isChecked())
+ aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]);
}
QMap<VISU::PointMap3d_i*, int>::Iterator itt;
for (itt = myPointMapPrsMap.begin(); itt != myPointMapPrsMap.end(); ++itt) {
if (VISU_ActorBase* anActor = VISU::FindActorBase(myViewWindow, aPrs))
anActor->SetPosition(aOffs.myOffset);
if (mySaveChk)
- if (mySaveChk->isChecked())
- aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]);
+ if (mySaveChk->isChecked())
+ aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]);
}
} else {
vtkFloatingPointType aDist = 0;
for (it = myPrsMap.begin(); it != myPrsMap.end(); ++it, i++) {
VISU::Prs3d_i* aPrs = it.key();
if (VISU_Actor* aActor = VISU::FindActor(myViewWindow, aPrs)) {
- int aAxis = getAxis();
+ int aAxis = getAxis();
- vtkFloatingPointType aZeroOffset[3];
+ vtkFloatingPointType aZeroOffset[3];
aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0;
- aActor->SetPosition(aZeroOffset);
+ aActor->SetPosition(aZeroOffset);
aActor->GetMapper()->Update();
- vtkFloatingPointType aBounds[6];
- aActor->GetBounds(aBounds);
- switch (aAxis) {
- case XAxis:
- aDist = fabs(aBounds[1] - aBounds[0]);
- break;
- case YAxis:
- aDist = fabs(aBounds[3] - aBounds[2]);
- break;
- case ZAxis:
- aDist = fabs(aBounds[5] - aBounds[4]);
- }
- vtkFloatingPointType aOffset[3];
+ vtkFloatingPointType aBounds[6];
+ aActor->GetBounds(aBounds);
+ switch (aAxis) {
+ case XAxis:
+ aDist = fabs(aBounds[1] - aBounds[0]);
+ break;
+ case YAxis:
+ aDist = fabs(aBounds[3] - aBounds[2]);
+ break;
+ case ZAxis:
+ aDist = fabs(aBounds[5] - aBounds[4]);
+ }
+ vtkFloatingPointType aOffset[3];
aOffset[0] = aOffset[1] = aOffset[2] = 0;
aOffset[aAxis] =
(aBounds[2*aAxis+1] < aBounds[2*aAxis]) ? -aBounds[2*aAxis+1] : -aBounds[2*aAxis];
aShift = aPrevShift + aPrevDist/2.0 + aCCDist*getDistance() - aDist/2.0;
}
- aOffset[aAxis] += aShift;
- aActor->SetPosition(aOffset);
- if (mySaveChk)
- if (mySaveChk->isChecked())
- aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]);
+ aOffset[aAxis] += aShift;
+ aActor->SetPosition(aOffset);
+ if (mySaveChk)
+ if (mySaveChk->isChecked())
+ aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]);
- aPrevDist = aDist;
- aPrevShift = aShift;
+ aPrevDist = aDist;
+ aPrevShift = aShift;
}
} // end of myPrsMap loop
// Loop in PointMap3D the same as previous loop
for (itt = myPointMapPrsMap.begin(); itt != myPointMapPrsMap.end(); ++itt, i++) {
VISU::PointMap3d_i* aPrs = itt.key();
if (VISU_ActorBase* aActor = VISU::FindActorBase(myViewWindow, aPrs)) {
- int aAxis = getAxis();
+ int aAxis = getAxis();
- vtkFloatingPointType aZeroOffset[3];
- aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0;
- aActor->SetPosition(aZeroOffset);
+ vtkFloatingPointType aZeroOffset[3];
+ aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0;
+ aActor->SetPosition(aZeroOffset);
aActor->GetMapper()->Update();
- vtkFloatingPointType aBounds[6];
- aActor->GetBounds(aBounds);
- switch (aAxis) {
- case XAxis:
- aDist = fabs(aBounds[1] - aBounds[0]);
- break;
- case YAxis:
- aDist = fabs(aBounds[3] - aBounds[2]);
- break;
- case ZAxis:
- aDist = fabs(aBounds[5] - aBounds[4]);
- }
- vtkFloatingPointType aOffset[3];
+ vtkFloatingPointType aBounds[6];
+ aActor->GetBounds(aBounds);
+ switch (aAxis) {
+ case XAxis:
+ aDist = fabs(aBounds[1] - aBounds[0]);
+ break;
+ case YAxis:
+ aDist = fabs(aBounds[3] - aBounds[2]);
+ break;
+ case ZAxis:
+ aDist = fabs(aBounds[5] - aBounds[4]);
+ }
+ vtkFloatingPointType aOffset[3];
aOffset[0] = aOffset[1] = aOffset[2] = 0;
aOffset[aAxis] =
(aBounds[2*aAxis+1] < aBounds[2*aAxis]) ? -aBounds[2*aAxis+1] : -aBounds[2*aAxis];
aShift = aPrevShift + aPrevDist/2.0 + aCCDist*getDistance() - aDist/2.0;
}
- aOffset[aAxis] += aShift;
- aActor->SetPosition(aOffset);
- if (mySaveChk)
- if (mySaveChk->isChecked())
- aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]);
+ aOffset[aAxis] += aShift;
+ aActor->SetPosition(aOffset);
+ if (mySaveChk)
+ if (mySaveChk->isChecked())
+ aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]);
- aPrevDist = aDist;
- aPrevShift = aShift;
+ aPrevDist = aDist;
+ aPrevShift = aShift;
}
} // end of myPointMapPrsMap loop
}
//------------------------------------------------------------------------
SetupDlg::SetupDlg (QWidget* theParent,
- VisuGUI* theModule,
- VISU_TimeAnimation* theAnimator) :
+ VisuGUI* theModule,
+ VISU_TimeAnimation* theAnimator) :
QDialog(theParent,
- Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
+ Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
myAnimator(theAnimator),
myModule(theModule),
myIsRegenerate( false )
{
setModal( true );
- setWindowTitle("Setup Animation");
+ setWindowTitle(tr("Setup Animation"));
setSizeGripEnabled( TRUE );
QVBoxLayout* aMainLayout = new QVBoxLayout(this);
aMainLayout->setSpacing(5);
// Range of time stamps
- myUseRangeBox = new QGroupBox("Use range of time stamps", this);
+ myUseRangeBox = new QGroupBox(tr("Use range of time stamps"), this);
myUseRangeBox->setCheckable( true );
myUseRangeBox->setChecked(myAnimator->isRangeDefined());
aStep = (aMaxTime - aMinTime) / (myAnimator->getFieldData(0).myNbTimes - 1);
else { // successive animation mode
std::pair<int,long> aLastFieldFrame(myAnimator->getNbFields() - 1,
- myAnimator->getFieldData(myAnimator->getNbFields() - 1).myNbTimes - 1);
+ myAnimator->getFieldData(myAnimator->getNbFields() - 1).myNbTimes - 1);
aStep = (aMaxTime - aMinTime) / myAnimator->getAbsoluteFrameNumber(aLastFieldFrame);
}
}
- QLabel* aMinLbl = new QLabel("From", myUseRangeBox);
+ QLabel* aMinLbl = new QLabel(tr("From"), myUseRangeBox);
aRangeLayout->addWidget(aMinLbl);
- //myMinVal = new QtxDoubleSpinBox( aMinTime, aMaxTime, aStep, myUseRangeBox );
+ //myMinVal = new SalomeApp_DoubleSpinBox( aMinTime, aMaxTime, aStep, myUseRangeBox );
+ //VISU::initSpinBox( myMinVal, aMinTime, aMaxTime, aStep, "visual_data_precision" );
myMinVal = new LineEdit( myUseRangeBox );
myMinVal->setValidator( new QDoubleValidator( myMinVal ) );
if ( myUseRangeBox->isChecked() )
myMinVal->setText( QString::number( aMinTime ) );
// connect(myMinVal, SIGNAL( valueChanged(double)),
- // this, SLOT( onMinValue(double) ));
+ // this, SLOT( onMinValue(double) ));
connect( myMinVal, SIGNAL( returnPressed() ), this, SLOT( onMinValue() ) );
connect( myMinVal, SIGNAL( editingFinished() ), this, SLOT( onMinValue() ) );
// connect( myMinVal, SIGNAL( textChanged(const QString&)),
-// this, SLOT( onMinValueEdit(const QString&) ));
+// this, SLOT( onMinValueEdit(const QString&) ));
aRangeLayout->addWidget(myMinVal);
- QLabel* aMaxLbl = new QLabel("To", myUseRangeBox);
+ QLabel* aMaxLbl = new QLabel(tr("To"), myUseRangeBox);
aRangeLayout->addWidget(aMaxLbl);
- //myMaxVal = new QtxDoubleSpinBox( aMinTime, aMaxTime, aStep, myUseRangeBox );
+ //myMaxVal = new SalomeApp_DoubleSpinBox( aMinTime, aMaxTime, aStep, myUseRangeBox );
+ //VISU::initSpinBox( myMaxVal, aMinTime, aMaxTime, aStep, "visual_data_precision" );
myMaxVal = new LineEdit( myUseRangeBox );
myMaxVal->setValidator( new QDoubleValidator( myMaxVal ) );
if ( myUseRangeBox->isChecked() )
myMaxVal->setText( QString::number( aMaxTime ) );
// connect(myMaxVal, SIGNAL( valueChanged(double)),
- // this, SLOT( onMaxValue(double) ));
+ // this, SLOT( onMaxValue(double) ));
connect( myMaxVal, SIGNAL( returnPressed() ), this, SLOT( onMaxValue() ) );
connect( myMaxVal, SIGNAL( editingFinished() ), this, SLOT( onMaxValue() ) );
// connect(myMaxVal, SIGNAL( textChanged(const QString&)),
-// this, SLOT( onMaxValueEdit(const QString&) ));
+// this, SLOT( onMaxValueEdit(const QString&) ));
aRangeLayout->addWidget(myMaxVal);
connect(myUseRangeBox, SIGNAL( toggled(bool)),
- this, SLOT( onRangeCheck(bool) ));
+ this, SLOT( onRangeCheck(bool) ));
aMainLayout->addWidget(myUseRangeBox);
// Sequence of time stamps
- myUseSequenceBox = new QGroupBox("Use sequence of time stamps", this);
+ myUseSequenceBox = new QGroupBox(tr("Use sequence of time stamps"), this);
myUseSequenceBox->setCheckable( true );
myUseSequenceBox->setChecked( myAnimator->isSequenceDefined() );
aUseSequenceLayout->setSpacing( 6 );
aUseSequenceLayout->setMargin( 11 );
- QLabel* anIndicesLbl = new QLabel("Indices", myUseSequenceBox);
+ QLabel* anIndicesLbl = new QLabel(tr("Indices"), myUseSequenceBox);
myIndices = new QLineEdit( myUseSequenceBox );
myValues = new QListWidget( myUseSequenceBox );
myValues->setSelectionMode( QAbstractItemView::ExtendedSelection );
connect(myIndices, SIGNAL( textChanged(const QString&)),
- this, SLOT( onIndicesChanged(const QString&) ));
+ this, SLOT( onIndicesChanged(const QString&) ));
connect(myValues, SIGNAL( itemSelectionChanged() ),
- this, SLOT( onValuesChanged() ) );
+ this, SLOT( onValuesChanged() ) );
connect(myUseSequenceBox, SIGNAL( toggled(bool)),
- this, SLOT( onSequenceCheck(bool) ));
+ this, SLOT( onSequenceCheck(bool) ));
aUseSequenceLayout->addWidget( anIndicesLbl, 0, 0 );
aUseSequenceLayout->addWidget( myIndices, 0, 1 );
aHPropLayout->setSpacing(5);
aHPropLayout->setMargin(0);
- QGroupBox* aNamesBox = new QGroupBox("Fields",aPropFrame);
+ QGroupBox* aNamesBox = new QGroupBox(tr("Fields"),aPropFrame);
aHPropLayout->addWidget( aNamesBox );
QVBoxLayout* aVBoxLayout = new QVBoxLayout( aNamesBox );
if ( myAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) {
myFieldLst->setCurrentRow(0);
connect( myFieldLst, SIGNAL( currentRowChanged(int) ),
- this, SLOT( onFieldChange(int) ) );
+ this, SLOT( onFieldChange(int) ) );
}
else if ( myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE )
myFieldLst->setSelectionMode(QAbstractItemView::NoSelection);
aVBoxLayout->setSpacing(5);
aVBoxLayout->setMargin(0);
- QGroupBox* aPropBox = new QGroupBox("Properties", aSetupBox);
+ QGroupBox* aPropBox = new QGroupBox(tr("Properties"), aSetupBox);
aVBoxLayout->addWidget( aPropBox );
QVBoxLayout* aPropVBLay = new QVBoxLayout( aPropBox );
myTypeCombo = new QComboBox(aPropBox);
aPropVBLay->addWidget( myTypeCombo );
connect( myTypeCombo, SIGNAL( activated(int) ),
- this, SLOT( onTypeChanged(int) ) );
+ this, SLOT( onTypeChanged(int) ) );
// QPushButton* aBarBtn = new QPushButton("Scalar Bar...", aPropBox);
//connect( aBarBtn, SIGNAL( clicked() ),
- // this, SLOT( onScalarBarDlg() ) );
+ // this, SLOT( onScalarBarDlg() ) );
- myPropBtn = new QPushButton("Properties...", aPropBox);
+ myPropBtn = new QPushButton(tr("Properties..."), aPropBox);
myPropBtn->setAutoDefault( false );
aPropVBLay->addWidget( myPropBtn );
// myPropBtn->setEnabled(myAnimator->getFieldData(0).myPrsType != VISU::TSCALARMAP);
connect( myPropBtn, SIGNAL( clicked() ),
- this, SLOT( onPreferencesDlg() ) );
+ this, SLOT( onPreferencesDlg() ) );
if (myAnimator->getNbFields() > 1 ) {
if( myAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) {
- myArrangeBtn = new QPushButton("Arrange...", aSetupBox);
+ myArrangeBtn = new QPushButton(tr("Arrange..."), aSetupBox);
aVBoxLayout->addWidget( myArrangeBtn );
connect( myArrangeBtn, SIGNAL( clicked() ), this, SLOT( onArrangeDlg() ) );
}
TISOSURFACES_ITEM = 1, // VISU::TISOSURFACES
TCUTPLANES_ITEM = 2, // VISU::TCUTPLANES
TCUTLINES_ITEM = 3, // VISU::TCUTLINES
- TPLOT3D_ITEM = 4, // VISU::TPLOT3D
- TDEFORMEDSHAPE_ITEM = 5, // VISU::TDEFORMEDSHAPE
- TVECTORS_ITEM = 6, // VISU::TVECTORS
- TSTREAMLINES_ITEM = 7, // VISU::TSTREAMLINES
- TGAUSSPOINTS_ITEM = 8, // VISU::TGAUSSPOINTS
- TDEFORMEDSHAPEANDSCALARMAP_ITEM = 9 // VISU::TDEFORMEDSHAPEANDSCALARMAP
+ TCUTSEGMENT_ITEM = 4, // VISU::TCUTSEGMENT
+ TPLOT3D_ITEM = 5, // VISU::TPLOT3D
+ TDEFORMEDSHAPE_ITEM = 6, // VISU::TDEFORMEDSHAPE
+ TVECTORS_ITEM = 7, // VISU::TVECTORS
+ TSTREAMLINES_ITEM = 8, // VISU::TSTREAMLINES
+ TGAUSSPOINTS_ITEM = 9, // VISU::TGAUSSPOINTS
+ TDEFORMEDSHAPEANDSCALARMAP_ITEM = 10 // VISU::TDEFORMEDSHAPEANDSCALARMAP
};
//------------------------------------------------------------------------
return;
// ATTENTION: append items in the same order like it is done in the PrsComboItem enumeration
- myTypeCombo->addItem("Scalar Map"); // item 0
+ myTypeCombo->addItem(tr("VISU_SCALAR_MAP")); // item 0
myTypeId2ComboId[TSCALARMAP_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TSCALARMAP_ITEM);;
- myTypeCombo->addItem("Iso Surfaces"); // item 1
+ myTypeCombo->addItem(tr("VISU_ISO_SURFACES")); // item 1
myTypeId2ComboId[TISOSURFACES_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TISOSURFACES_ITEM);;
- myTypeCombo->addItem("Cut Planes"); // item 2
+ myTypeCombo->addItem(tr("VISU_CUT_PLANES")); // item 2
myTypeId2ComboId[TCUTPLANES_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TCUTPLANES_ITEM);;
- myTypeCombo->addItem("Cut Lines"); // item 3
+ myTypeCombo->addItem(tr("VISU_CUT_LINES")); // item 3
myTypeId2ComboId[TCUTLINES_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TCUTLINES_ITEM);;
- myTypeCombo->addItem("Plot 3D"); // item 4
+ myTypeCombo->addItem(tr("VISU_CUT_SEGMENT")); // item 4
+ myTypeId2ComboId[TCUTSEGMENT_ITEM] = myComboId2TypeId.size();
+ myComboId2TypeId.push_back(TCUTSEGMENT_ITEM);;
+
+ myTypeCombo->addItem(tr("VISU_PLOT3D")); // item 5
myTypeId2ComboId[TPLOT3D_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TPLOT3D_ITEM);;
}
if (anEnableItems) {
- myTypeCombo->addItem("Deformed Shape"); // item 5
+ myTypeCombo->addItem(tr("VISU_DEFORMED_SHAPE")); // item 6
myTypeId2ComboId[TDEFORMEDSHAPE_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TDEFORMEDSHAPE_ITEM);;
- myTypeCombo->addItem("Vectors"); // item 6
+ myTypeCombo->addItem(tr("VISU_VECTORS")); // item 7
myTypeId2ComboId[TVECTORS_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TVECTORS_ITEM);;
- myTypeCombo->addItem("Stream Lines"); // item 7
+ myTypeCombo->addItem(tr("VISU_STREAM_LINES")); // item 8
myTypeId2ComboId[TSTREAMLINES_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TSTREAMLINES_ITEM);;
- myTypeCombo->addItem("Deformed shape and Scalar map"); // item 9
+ myTypeCombo->addItem(tr("VISU_DEFORMED_SHAPE_AND_SCALAR_MAP")); // item 10
myTypeId2ComboId[TDEFORMEDSHAPEANDSCALARMAP_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TDEFORMEDSHAPEANDSCALARMAP_ITEM);;
}
if(anEnableGP){
- myTypeCombo->addItem("Gauss Points"); // item 8
+ myTypeCombo->addItem(tr("VISU_GAUSS_POINT")); // item 9
myTypeId2ComboId[TGAUSSPOINTS_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TGAUSSPOINTS_ITEM);;
}
case VISU::TCUTLINES: //Cut Lines
myTypeCombo->setCurrentIndex(myTypeId2ComboId[TCUTLINES_ITEM]);
break;
+ case VISU::TCUTSEGMENT: //Cut Segment
+ myTypeCombo->setCurrentIndex(myTypeId2ComboId[TCUTSEGMENT_ITEM]);
+ break;
case VISU::TPLOT3D: //Plot 3D
myTypeCombo->setCurrentIndex(myTypeId2ComboId[TPLOT3D_ITEM]);
break;
case TCUTLINES_ITEM: //Cut Lines
aData.myPrsType = VISU::TCUTLINES;
break;
+ case TCUTSEGMENT_ITEM: //Cut Segment
+ aData.myPrsType = VISU::TCUTSEGMENT;
+ break;
case TPLOT3D_ITEM: //Plot 3D
aData.myPrsType = VISU::TPLOT3D;
break;
template<class TPrs3d, class TDialog>
void
EditPrs(VisuGUI* theModule,
- FieldData& theData,
- VISU_TimeAnimation* theAnimator)
+ FieldData& theData,
+ VISU_TimeAnimation* theAnimator)
{
TDialog* aDlg = new TDialog(theModule);
TPrs3d* aPrs3d = dynamic_cast<TPrs3d*>(theData.myPrs[0]);
if (aDlg->exec() && aDlg->storeToPrsObject(dynamic_cast<TPrs3d*>(aPrs3d))) {
for (long aFrameId = 1; aFrameId < theData.myNbFrames; aFrameId++){
- VISU::ColoredPrs3d_i* aColoredPrs3d = theData.myPrs[aFrameId];
- aColoredPrs3d->SameAs(aPrs3d);
+ VISU::ColoredPrs3d_i* aColoredPrs3d = theData.myPrs[aFrameId];
+ aColoredPrs3d->SameAs(aPrs3d);
+ // rnv: fix for the 20870: EDF 1410 VISU: Anomaly in the Gauss point representation.
+ // special case for the "Gauss Points" presentation,
+ // update the LookupTable in the mapper, after assign properties of the presentation
+ // using SameAs(...) method.
+ if(theData.myPrsType == VISU::TGAUSSPOINTS) {
+ aColoredPrs3d->UpdateMapperLookupTable();
+ }
}
if ( theAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) {
- for (int aFieldId = 1; aFieldId < theAnimator->getNbFields(); aFieldId++) {
- FieldData& aFieldData = theAnimator->getFieldData(aFieldId);
- for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
- VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId];
- std::string aTitle = aColoredPrs3d->GetCTitle();
- aColoredPrs3d->SameAs(aPrs3d);
- aColoredPrs3d->SetTitle(aTitle.c_str());
- }
- }
+ for (int aFieldId = 1; aFieldId < theAnimator->getNbFields(); aFieldId++) {
+ FieldData& aFieldData = theAnimator->getFieldData(aFieldId);
+ for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
+ VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId];
+ std::string aTitle = aColoredPrs3d->GetCTitle();
+ aColoredPrs3d->SameAs(aPrs3d);
+ // rnv: fix for the 20870: EDF 1410 VISU: Anomaly in the Gauss point representation.
+ // special case for the "Gauss Points" presentation,
+ // update the LookupTable in the mapper, after assign properties of the presentation
+ // using SameAs(...) method.
+ if(theData.myPrsType == VISU::TGAUSSPOINTS) {
+ aColoredPrs3d->UpdateMapperLookupTable();
+ }
+
+ aColoredPrs3d->SetTitle(aTitle.c_str());
+ }
+ }
}
}
delete aDlg;
if ( myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) {
for (int i = 0; i < myAnimator->getNbFields(); i++) {
if ( i != aRefFieldId && myAnimator->getFieldData(i).myPrs.empty() )
- myAnimator->generatePresentations(i);
+ myAnimator->generatePresentations(i);
}
}
c.suspend();
EditPrs<VISU::CutLines_i,VisuGUI_CutLinesDlg>(myModule,aData,myAnimator);
break;
+ case TCUTSEGMENT_ITEM: //Cut Segment
+ c.suspend();
+ EditPrs<VISU::CutSegment_i,VisuGUI_CutSegmentDlg>(myModule,aData,myAnimator);
+ break;
case TPLOT3D_ITEM: //Plot 3D
c.suspend();
EditPrs<VISU::Plot3D_i,VisuGUI_Plot3DDlg>(myModule,aData,myAnimator);
aVal = qMax( qMin( aVal, myAnimator->getMaxRange() ), myAnimator->getMinTime() );
myAnimator->setAnimationRange( aVal, myAnimator->getMaxRange() );
myMinVal->setText( QString::number( aVal ) );
- myMinVal->setFocus();
+ // myMinVal->setFocus();
setIsRegenerate( true );
}
aVal = qMin( qMax( aVal, myAnimator->getMinRange() ), myAnimator->getMaxTime() );
myAnimator->setAnimationRange( myAnimator->getMinRange(), aVal );
myMaxVal->setText( QString::number( aVal ) );
- myMaxVal->setFocus();
+ // myMaxVal->setFocus();
setIsRegenerate( true );
}
if( aPrevSelected )
{
if( aNextSelected )
- aString = "";
+ aString = "";
else
- aString += ",";
+ aString += ",";
}
else
{
if( aNextSelected )
- aString += "-";
+ aString += "-";
else
- aString += ",";
+ aString += ",";
}
anIndices += aString;
//------------------------------------------------------------------------
static const char * firstIco[] = {
"18 10 2 1",
-" g None",
-". g #000000",
+" g None",
+". g #000000",
" . . ",
" .. .. .. ",
" .. ... ... ",
static const char * lastIco[] = {
"18 10 2 1",
-" g None",
-". g #000000",
+" g None",
+". g #000000",
" . . ",
" .. .. .. ",
" ... ... .. ",
static const char * leftIco[] = {
"11 10 2 1",
-" g None",
-". g #000000",
+" g None",
+". g #000000",
" . .",
" .. ..",
" ... ...",
static const char * playIco[] = {
"14 14 2 1",
-" g None",
-". g #000000",
+" g None",
+". g #000000",
" ",
" ",
" .. ",
static const char * rightIco[] = {
"11 10 2 1",
-" g None",
-". g #000000",
+" g None",
+". g #000000",
". . ",
".. .. ",
"... ... ",
static const char * pauseIco[] = {
"14 14 2 1",
-" g None",
-". g #000000",
+" g None",
+". g #000000",
" ",
" ",
" .. .. ",
VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule,
- _PTR(Study) theStudy,
- VISU::Animation::AnimationMode theMode) :
+ _PTR(Study) theStudy,
+ VISU::Animation::AnimationMode theMode) :
QDialog(VISU::GetDesktop(theModule),
- Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+ Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
myModule(theModule),
mySetupDlg(NULL)
{
myAnimator = new VISU_TimeAnimation (theStudy);
myAnimator->setViewer(VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule));
connect(myAnimator, SIGNAL(frameChanged(long, double)), this, SLOT(onExecution(long, double)));
- connect(myAnimator, SIGNAL(stopped()), this, SLOT(onStop()));
+ connect(myAnimator, SIGNAL(stopped()), this, SLOT(onStop()));
myAnimator->setAnimationMode(theMode);
QVBoxLayout* aMainLayout = new QVBoxLayout(this);
aMainLayout->setMargin( 7 );
aMainLayout->setSpacing(5);
- mySetupBtn = new QPushButton("Setup Animation...", this);
+ mySetupBtn = new QPushButton(tr("Setup Animation..."), this);
connect( mySetupBtn, SIGNAL( clicked() ),
- this, SLOT( onSetupDlg() ) );
+ this, SLOT( onSetupDlg() ) );
aMainLayout->addWidget(mySetupBtn);
- myGenBtn = new QPushButton("Generate frames", this);
+ myGenBtn = new QPushButton(tr("Generate frames"), this);
connect( myGenBtn, SIGNAL( clicked() ),
- this, SLOT( createFrames() ) );
+ this, SLOT( createFrames() ) );
aMainLayout->addWidget(myGenBtn);
myPlayFrame = new QFrame(this);
//mySlider->setTickmarks(QSlider::Below);
mySlider->setTracking(false);
connect( mySlider, SIGNAL( sliderMoved(int) ),
- this, SLOT( onWindowChanged(int) ) );
+ this, SLOT( onWindowChanged(int) ) );
TopLayout->addWidget(mySlider, 1, 0, 1, 3);
myPlayBtn = new QPushButton(myPlayFrame);
myPlayBtn->setIcon(MYplayPixmap);
myPlayBtn->setCheckable(true);
connect( myPlayBtn, SIGNAL( clicked() ),
- this, SLOT( onPlayPressed() ) );
+ this, SLOT( onPlayPressed() ) );
TopLayout->addWidget(myPlayBtn, 2, 0, 1, 2);
QPushButton* aBackBtn = new QPushButton(myPlayFrame);
aBackBtn->setIcon(QPixmap(leftIco));
connect( aBackBtn, SIGNAL( clicked() ),
- this, SLOT( onBackPressed() ) );
+ this, SLOT( onBackPressed() ) );
TopLayout->addWidget(aBackBtn, 3, 0);
QPushButton* aForvardBtn = new QPushButton(myPlayFrame);
aForvardBtn->setIcon(QPixmap(rightIco));
connect( aForvardBtn, SIGNAL( clicked() ),
- this, SLOT( onForvardPressed() ) );
+ this, SLOT( onForvardPressed() ) );
TopLayout->addWidget(aForvardBtn, 3, 1);
QPushButton* aFirstBtn = new QPushButton(myPlayFrame);
aFirstBtn->setIcon(QPixmap(firstIco));
connect( aFirstBtn, SIGNAL( clicked() ),
- this, SLOT( onFirstPressed() ) );
+ this, SLOT( onFirstPressed() ) );
TopLayout->addWidget(aFirstBtn, 4, 0);
QPushButton* aLastBtn = new QPushButton(myPlayFrame);
aLastBtn->setIcon(QPixmap(lastIco));
connect( aLastBtn, SIGNAL( clicked() ),
- this, SLOT( onLastPressed() ) );
+ this, SLOT( onLastPressed() ) );
TopLayout->addWidget(aLastBtn, 4, 1);
- QLabel* aSpeedLbl = new QLabel("Speed", myPlayFrame);
+ QLabel* aSpeedLbl = new QLabel(tr("Speed"), myPlayFrame);
TopLayout->addWidget(aSpeedLbl, 4, 2, Qt::AlignRight);
QLCDNumber* aSpeedNum = new QLCDNumber( 2, myPlayFrame );
aWheel->setRange(1, 99, 1);
aWheel->setValue((int)myAnimator->getSpeed());
connect( aWheel, SIGNAL(valueChanged(double)),
- aSpeedNum, SLOT(display(double)) );
+ aSpeedNum, SLOT(display(double)) );
connect( aWheel, SIGNAL(valueChanged(double)),
- this, SLOT(onSpeedChange(double)) );
+ this, SLOT(onSpeedChange(double)) );
TopLayout->addWidget(aWheel, 1, 3, 3, 1, Qt::AlignRight);
- QCheckBox* aCycleCheck = new QCheckBox("Cycled animation",myPlayFrame);
+ QCheckBox* aCycleCheck = new QCheckBox(tr("Cycled animation"),myPlayFrame);
aCycleCheck->setChecked(myAnimator->isCycling());
connect(aCycleCheck, SIGNAL(toggled(bool)), myAnimator, SLOT(setCyclingSlot(bool)));
TopLayout->addWidget(aCycleCheck, 5, 0, 1, 4);
- QCheckBox* aPropCheck = new QCheckBox("Use proportional timing",myPlayFrame);
+ QCheckBox* aPropCheck = new QCheckBox(tr("Use proportional timing"),myPlayFrame);
aPropCheck->setChecked(myAnimator->isProportional());
connect(aPropCheck, SIGNAL(toggled(bool)), myAnimator, SLOT(setProportionalSlot(bool)));
TopLayout->addWidget(aPropCheck, 6, 0, 1, 4);
// Pictures saving on disk
- QGroupBox* aSaveBox = new QGroupBox( "Saving", myPlayFrame );
+ QGroupBox* aSaveBox = new QGroupBox( tr("Saving"), myPlayFrame );
//aSaveBox->setColumnLayout(0, Qt::Horizontal );
QGridLayout* aSaveLay = new QGridLayout(aSaveBox);
aSaveLay->setSpacing( 5 );
aSaveLay->setMargin( 5 );
- mySaveCheck = new QCheckBox("Save pictures to directory", aSaveBox);
+ mySaveCheck = new QCheckBox(tr("Save pictures to directory"), aSaveBox);
connect(mySaveCheck, SIGNAL( toggled(bool)),
this, SLOT( onCheckDump(bool) ));
aSaveLay->addWidget(mySaveCheck, 0, 0, 1, 3);
- QLabel* aFormatLbl = new QLabel("Saving format:", aSaveBox);
+ QLabel* aFormatLbl = new QLabel(tr("Saving format:"), aSaveBox);
aFormatLbl->setEnabled(false);
connect(mySaveCheck, SIGNAL( toggled(bool)),
aFormatLbl, SLOT( setEnabled(bool) ));
connect(mySaveCheck, SIGNAL( toggled(bool)),
myPicsFormat, SLOT( setEnabled(bool) ));
connect(myPicsFormat, SIGNAL( activated (int)),
- this, SLOT( onPicsFormatChanged()));
+ this, SLOT( onPicsFormatChanged()));
- QLabel* aPathLbl = new QLabel("Path:", aSaveBox);
+ QLabel* aPathLbl = new QLabel(tr("Path:"), aSaveBox);
aPathLbl->setEnabled(false);
connect(mySaveCheck, SIGNAL( toggled(bool)),
aPathLbl, SLOT( setEnabled(bool) ));
myPathEdit, SLOT( setEnabled(bool) ));
aSaveLay->addWidget(myPathEdit, 2, 1);
- QPushButton* aBrowseBtn = new QPushButton("Browse...", aSaveBox);
+ QPushButton* aBrowseBtn = new QPushButton(tr("Browse..."), aSaveBox);
aBrowseBtn->setEnabled(false);
connect(mySaveCheck, SIGNAL( toggled(bool)),
- aBrowseBtn, SLOT( setEnabled(bool) ));
+ aBrowseBtn, SLOT( setEnabled(bool) ));
connect(aBrowseBtn, SIGNAL( clicked()),
- this, SLOT( onBrowse() ));
+ this, SLOT( onBrowse() ));
mySaveCheck->setChecked(false);
aSaveLay->addWidget(aBrowseBtn, 2, 2);
- mySaveAVICheck = new QCheckBox("Save animation to AVI file", aSaveBox);
+ mySaveAVICheck = new QCheckBox(tr("Save animation to AVI file"), aSaveBox);
connect(mySaveAVICheck, SIGNAL( toggled(bool)),
this, SLOT( onCheckDump(bool) ));
aSaveLay->addWidget(mySaveAVICheck, 3, 0, 1, 3);
- myPathAVILbl = new QLabel("Path:", aSaveBox);
+ myPathAVILbl = new QLabel(tr("Path:"), aSaveBox);
myPathAVILbl->setEnabled(false);
//connect(mySaveAVICheck, SIGNAL( toggled(bool)),
// myPathAVILbl, SLOT( setEnabled(bool) ));
// myPathAVIEdit, SLOT( setEnabled(bool) ));
aSaveLay->addWidget(myPathAVIEdit, 4, 1);
- myBrowseAVIBtn = new QPushButton("Browse...", aSaveBox);
+ myBrowseAVIBtn = new QPushButton(tr("Browse..."), aSaveBox);
myBrowseAVIBtn->setEnabled(false);
//connect(mySaveAVICheck, SIGNAL( toggled(bool)),
// myBrowseAVIBtn, SLOT( setEnabled(bool) ));
connect(myBrowseAVIBtn, SIGNAL( clicked()),
- this, SLOT( onBrowseAVI() ));
+ this, SLOT( onBrowseAVI() ));
aSaveLay->addWidget(myBrowseAVIBtn, 4, 2);
+ myFrequencyLbl = new QLabel(tr("Time stamp frequency:"), aSaveBox);
+ myFrequencyLbl->setEnabled(false);
+ aSaveLay->addWidget(myFrequencyLbl, 5, 0, 1, 2);
+
+ myFrequencySpin = new SalomeApp_IntSpinBox(aSaveBox);
+ VISU::initSpinBox(myFrequencySpin, 1, 100, 1);
+ myFrequencySpin->setValue(myAnimator->getTimeStampFrequency());
+ myFrequencySpin->setEnabled(false);
+ aSaveLay->addWidget(myFrequencySpin, 5, 2);
+
mySaveAVICheck->setChecked(false);
//mySaveAVICheck->setEnabled(myAnimator->checkAVIMaker());
+ int aDumpMode = myAnimator->getDumpMode();
+ if(aDumpMode == VISU_TimeAnimation::DM_Picture)
+ mySaveCheck->setChecked(true);
+ else if(aDumpMode == VISU_TimeAnimation::DM_Video && myAnimator->checkAVIMaker())
+ mySaveAVICheck->setChecked(true);
+
TopLayout->addWidget(aSaveBox, 7, 0, 1, 4);
- QCheckBox* aCleanMemCheck = new QCheckBox("Clean memory at each frame",myPlayFrame);
+ QCheckBox* aCleanMemCheck = new QCheckBox(tr("Clean memory at each frame"),myPlayFrame);
aCleanMemCheck->setChecked(myAnimator->isCleaningMemoryAtEachFrame());
connect(aCleanMemCheck, SIGNAL(toggled(bool)), myAnimator, SLOT(setCleaningMemoryAtEachFrameSlot(bool)));
TopLayout->addWidget(aCleanMemCheck, 8, 0, 1, 4);
QHBoxLayout* aPubHBLay = new QHBoxLayout( aPublishBox );
aPubHBLay->setMargin( 0 );
- myPublishBtn = new QPushButton("Publish to study", aPublishBox);
+ myPublishBtn = new QPushButton(tr("Publish to study"), aPublishBox);
aPubHBLay->addWidget( myPublishBtn );
connect(myPublishBtn, SIGNAL(clicked()), this, SLOT(publishToStudy()));
- mySaveBtn = new QPushButton("Save Animation", aPublishBox);
+ mySaveBtn = new QPushButton(tr("Save Animation"), aPublishBox);
mySaveBtn->setEnabled(myAnimator->isSavedInStudy());
aPubHBLay->addWidget( mySaveBtn );
connect(mySaveBtn, SIGNAL(clicked()), this, SLOT(saveToStudy()));
/*
VISU::ColoredPrs3d_i* aPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(aFieldData.myPrs[0]);
if( !aPrs3d )
- continue;
+ continue;
myAnimator->generatePresentations(i);
aFieldData = myAnimator->getFieldData(i);
for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
- VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId];
- std::string aTitle = aColoredPrs3d->GetCTitle();
- aColoredPrs3d->SameAs(aPrs3d);
- if ( aFrameId != 0 && myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) {
- aColoredPrs3d->SetTitle(aTitle.c_str());
- }
+ VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId];
+ std::string aTitle = aColoredPrs3d->GetCTitle();
+ aColoredPrs3d->SameAs(aPrs3d);
+ if ( aFrameId != 0 && myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) {
+ aColoredPrs3d->SetTitle(aTitle.c_str());
+ }
}
*/
}
} else if (mySaveAVICheck->isChecked()) {
myAnimator->setDumpFormat("AVI");
myAnimator->dumpTo(myPathAVIEdit->text().toLatin1().data());
+ myAnimator->setTimeStampFrequency(myFrequencySpin->value());
} else {
myAnimator->dumpTo("");
}
//------------------------------------------------------------------------
void VisuGUI_TimeAnimationDlg::onBackPressed()
{
- //stopAnimation();
+ stopAnimation();
myAnimator->prevFrame();
}
//------------------------------------------------------------------------
void VisuGUI_TimeAnimationDlg::onForvardPressed()
{
+ stopAnimation();
myAnimator->nextFrame();
}
//------------------------------------------------------------------------
void VisuGUI_TimeAnimationDlg::onLastPressed()
{
+ stopAnimation();
myAnimator->lastFrame();
}
//------------------------------------------------------------------------
void VisuGUI_TimeAnimationDlg::onFirstPressed()
{
+ stopAnimation();
myAnimator->firstFrame();
}
aDir = getenv("HOME");
else
aDir = myPathEdit->text();
- QString aPath = SUIT_FileDlg::getExistingDirectory(this, aDir, "Select path");
+ QString aPath = SUIT_FileDlg::getExistingDirectory(this, aDir, tr("Select path"));
if (!aPath.isEmpty())
myPathEdit->setText(Qtx::addSlash(aPath));
onPathChanged();
QFileInfo aFile(myPathAVIEdit->text());
aDir = aFile.absoluteDir().absolutePath();
}
- QString aPath = SUIT_FileDlg::getFileName(this, aDir, aFilter, "Select file", false);
+ QString aPath = SUIT_FileDlg::getFileName(this, aDir, aFilter, tr("Select file"), false);
if (!aPath.isEmpty())
myPathAVIEdit->setText(aPath);
}
onPicsFormatChanged();
onPathChanged();
if (mySaveAVICheck->isChecked())
- mySaveAVICheck->setChecked(false);
+ mySaveAVICheck->setChecked(false);
} else {
myAnimator->dumpTo("");
}
myPathAVILbl->setEnabled(true);
myPathAVIEdit->setEnabled(true);
myBrowseAVIBtn->setEnabled(true);
+ myFrequencyLbl->setEnabled(true);
+ myFrequencySpin->setEnabled(true);
}
}
else {
myPathAVILbl->setEnabled(false);
myPathAVIEdit->setEnabled(false);
myBrowseAVIBtn->setEnabled(false);
+ myFrequencyLbl->setEnabled(false);
+ myFrequencySpin->setEnabled(false);
}
mySaveCheck->setEnabled(!mySaveAVICheck->isChecked());
}
if (app)
app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
- QObject::tr("BUT_OK"));
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_TimeAnimation.h
// Author : Vitaly SMETANNIKOV
// Module : VISU
#ifndef VISUGUI_TIMEANIMATION_H
#define VISUGUI_TIMEANIMATION_H
-#include "QtxDoubleSpinBox.h"
+#include <SalomeApp_DoubleSpinBox.h>
#include "SALOMEDSClient_Study.hxx"
#include "VTKViewer.h"
class VisuGUI;
class SalomeApp_Module;
+class SalomeApp_IntSpinBox;
class VISU_TimeAnimation;
namespace VISU
class SVTK_ViewWindow;
-//class QtxDoubleSpinBox;
-
class QLabel;
class QSlider;
class QListWidget;
enum { XAxis, YAxis, ZAxis };
ArrangeDlg(QWidget* theParent,
- VISU_TimeAnimation* theAnimator);
+ VISU_TimeAnimation* theAnimator);
ArrangeDlg(QWidget* theParent,
- const SalomeApp_Module* theModule,
- SVTK_ViewWindow* theViewWindow);
+ const SalomeApp_Module* theModule,
+ SVTK_ViewWindow* theViewWindow);
~ArrangeDlg() {};
VISU_TimeAnimation* myAnimator;
SVTK_ViewWindow * myViewWindow;
- QStackedWidget* myStackWgt;
+ QStackedWidget* myStackWgt;
QButtonGroup* myAxisGrp;
- QtxDoubleSpinBox* myDistVal;
- QListWidget* myFieldLst;
- QtxDoubleSpinBox* myCoord[3];
- QList<Offset> myOffsets;
+ SalomeApp_DoubleSpinBox* myDistVal;
+ QListWidget* myFieldLst;
+ SalomeApp_DoubleSpinBox* myCoord[3];
+ QList<Offset> myOffsets;
QCheckBox* mySaveChk;
public:
SetupDlg( QWidget* theParent, VisuGUI* theModule,
- VISU_TimeAnimation* theAnimator );
+ VISU_TimeAnimation* theAnimator );
~SetupDlg() {};
public:
QPushButton* myPropBtn;
QPushButton* myArrangeBtn;
QGroupBox* myUseRangeBox;
- // QtxDoubleSpinBox* myMinVal;
- // QtxDoubleSpinBox* myMaxVal;
+ // SalomeApp_DoubleSpinBox* myMinVal;
+ // SalomeApp_DoubleSpinBox* myMaxVal;
QLineEdit* myMinVal;
QLineEdit* myMaxVal;
Q_OBJECT
public:
VisuGUI_TimeAnimationDlg(VisuGUI* theModule,
- _PTR(Study) theStudy,
- VISU::Animation::AnimationMode theMode = VISU::Animation::PARALLEL);
+ _PTR(Study) theStudy,
+ VISU::Animation::AnimationMode theMode = VISU::Animation::PARALLEL);
~VisuGUI_TimeAnimationDlg();
bool addField(_PTR(SObject) theField);
QLineEdit* myPathAVIEdit;
QLabel* myPathAVILbl;
QPushButton* myBrowseAVIBtn;
+ QLabel* myFrequencyLbl;
+ SalomeApp_IntSpinBox* myFrequencySpin;
QPushButton* myPublishBtn;
QPushButton* mySaveBtn;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Timer.cxx
// Module : SALOME
SYSTEMTIME st;
GetSystemTime(&st);
SystemTimeToFileTime(&st, RefToInitialTMS);
- time(RefToCurrentTimeB);
+ time(RefToCurrentTimeB);
#endif
}
}
GetSystemTime(&st);
SystemTimeToFileTime(&st, RefToCurrentTMS);
Cumul_user += (int)(((ULARGE_INTEGER*)(RefToCurrentTMS))->QuadPart - ((ULARGE_INTEGER*)(RefToInitialTMS))->QuadPart) / 10000000;
- Cumul_sys = Cumul_user;
- time(RefToCurrentTimeB);
+ Cumul_sys = Cumul_user;
+ time(RefToCurrentTimeB);
#endif
Stopped = 1;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Timer.h
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Tools.cxx
// Author : Sergey Anikin
// Module : VISU
-//
+
#include "VisuGUI_Tools.h"
#include "VisuGUI_ViewTools.h"
#include "VisuGUI_Prs3dTools.h"
#include "VisuGUI.h"
+#include "VISU_Tools.h"
+
+#include "VISU_ColoredPrs3dHolder_i.hh"
#include "VISU_Gen_i.hh"
#include "VISU_Prs3d_i.hh"
#include "VISU_Result_i.hh"
#include "SalomeApp_Module.h"
#include "SalomeApp_Study.h"
#include "SalomeApp_Application.h"
+#include "SalomeApp_IntSpinBox.h"
+#include "SalomeApp_DoubleSpinBox.h"
#include "LightApp_DataObject.h"
#include "LightApp_SelectionMgr.h"
#include "SUIT_MessageBox.h"
#include "SUIT_Desktop.h"
#include "SUIT_ViewWindow.h"
+#include "SUIT_ResourceMgr.h"
#include "CAM_DataModel.h"
#include <QString>
#include <QSpinBox>
#include <QDoubleSpinBox>
+#include <QVariant>
using namespace std;
SUIT_Desktop*
GetDesktop(const CAM_Module* theModule)
{
- return theModule->application()->desktop();
+ return theModule && theModule->application() ? theModule->application()->desktop() : 0;
}
//------------------------------------------------------------
LightApp_SelectionMgr*
GetSelectionMgr(const SalomeApp_Module* theModule)
{
- return theModule->getApp()->selectionMgr();
+ return theModule && theModule->getApp() ? theModule->getApp()->selectionMgr() : 0;
}
//------------------------------------------------------------
SalomeApp_Study*
GetAppStudy(const CAM_Module* theModule)
{
- return
- dynamic_cast<SalomeApp_Study*>(theModule->application()->activeStudy());
+ return theModule && theModule->application() ?
+ dynamic_cast<SalomeApp_Study*>(theModule->application()->activeStudy()) : 0;
}
//------------------------------------------------------------
_PTR(Study)
GetCStudy(const SalomeApp_Study* theStudy)
{
- return theStudy->studyDS();
+ return theStudy ? theStudy->studyDS() : _PTR(Study)();
}
//------------------------------------------------------------
bool
IsStudyLocked( _PTR(Study) theStudy )
{
- if( theStudy )
- return theStudy->GetProperties()->IsLocked();
- return true;
+ return theStudy ? theStudy->GetProperties()->IsLocked() : true;
}
//------------------------------------------------------------
bool
CheckLock( _PTR(Study) theStudy,
- QWidget* theWidget )
+ QWidget* theWidget )
{
if(IsStudyLocked(theStudy)){
SUIT_MessageBox::warning(theWidget,
QObject::tr("WRN_VISU_WARNING"),
QObject::tr("WRN_STUDY_LOCKED") );
- return true;
+ return true;
}
return false;
}
//------------------------------------------------------------
LightApp_DataObject*
FindDataObject(SUIT_DataObject* theDataObject,
- const QString& theEntry,
- int theLevel)
+ const QString& theEntry,
+ int theLevel)
{
int aLevel = theDataObject->level() + 2;
QString aSourceEntry = theEntry.section(':',0,aLevel);
DataObjectList::Iterator aDataObjectIter = aList.begin();
while( aDataObjectIter!= aList.end() ) {
if(LightApp_DataObject* aChildDataObject = dynamic_cast<LightApp_DataObject*>(*aDataObjectIter)){
- QString anEntry = aChildDataObject->entry();
- QString aCurrentEntry = anEntry.section(':',0,aLevel);
- if(aSourceEntry == aCurrentEntry){
- if(theLevel == aLevel){
- return aChildDataObject;
- }else{
- return FindDataObject(aChildDataObject,theEntry,theLevel);
- }
- }
+ QString anEntry = aChildDataObject->entry();
+ QString aCurrentEntry = anEntry.section(':',0,aLevel);
+ if(aSourceEntry == aCurrentEntry){
+ if(theLevel == aLevel){
+ return aChildDataObject;
+ }else{
+ return FindDataObject(aChildDataObject,theEntry,theLevel);
+ }
+ }
}
aDataObjectIter++;
}
//------------------------------------------------------------
LightApp_DataObject*
FindDataObject(CAM_Module* theModule,
- _PTR(SObject) theSObject)
+ _PTR(SObject) theSObject)
{
CAM_DataModel* aDataModel = theModule->dataModel();
CAM_DataObject* aRootDataObject = aDataModel->root();
//------------------------------------------------------------
void
UpdateObjBrowser(SalomeApp_Module* theModule,
- bool theIsUpdateDataModel,
- _PTR(SObject) theSObject)
+ bool theIsUpdateDataModel,
+ _PTR(SObject) theSObject)
{
LightApp_DataObject* aDataObject = NULL;
if(theSObject)
if ( theSObject ) {
_PTR(GenericAttribute) anAttr;
if (theSObject->FindAttribute( anAttr, "AttributeTableOfInteger" ))
- return true;
+ return true;
if (theSObject->FindAttribute( anAttr, "AttributeTableOfReal" ))
- return true;
+ return true;
}
return false;
}
VISU_Gen_i*
GetVisuGen(const CAM_Module* theModule)
{
- static VISU_Gen_i* aGen = NULL;
+ static VISU_Gen_i* aGen = 0;
if(!aGen){
SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService());
- Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","VISU");
+ Engines::EngineComponent_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","VISU");
VISU_Gen_var aVISU = VISU_Gen::_narrow(aComponent);
- if(!CORBA::is_nil(aVISU)){
- if((aGen = VISU_Gen_i::GetVisuGenImpl()))
- aGen->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(theModule))));
- }
+ if(!CORBA::is_nil(aVISU))
+ aGen = VISU_Gen_i::GetVisuGenImpl();
}
- if(!aGen)
+
+ if(aGen)
+ aGen->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(theModule))));
+ else
throw std::runtime_error(QObject::tr("ERR_CANT_FIND_VISU_COMPONENT").toLatin1().data());
return aGen;
}
static SALOME_MED::MED_Gen_var aGen;
if(CORBA::is_nil(aGen)){
SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService());
- Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","MED");
+ Engines::EngineComponent_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","MED");
aGen = SALOME_MED::MED_Gen::_narrow(aComponent);
}
if(CORBA::is_nil(aGen))
TSelectionInfo aSelectionInfo;
const SalomeApp_Study* aStudy = GetAppStudy(theModule);
LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(theModule);
- SALOME_ListIO aListIO;
- aSelectionMgr->selectedObjects(aListIO);
- SALOME_ListIteratorOfListIO anIter(aListIO);
- while(anIter.More())
- {
- Handle(SALOME_InteractiveObject) anIO = anIter.Value();
- if(anIO->hasEntry())
+ if ( aStudy && aSelectionMgr ) {
+ SALOME_ListIO aListIO;
+ aSelectionMgr->selectedObjects(aListIO);
+ SALOME_ListIteratorOfListIO anIter(aListIO);
+ while(anIter.More())
{
- TObjectInfo anObjectInfo = GetObjectByEntry(aStudy, anIO->getEntry());
- if(anObjectInfo.mySObject){
- TSelectionItem aSelectionItem;
- aSelectionItem.myObjectInfo = anObjectInfo;
- aSelectionItem.myIO = anIO;
- aSelectionInfo.push_back(aSelectionItem);
- }
+ Handle(SALOME_InteractiveObject) anIO = anIter.Value();
+ if(anIO->hasEntry())
+ {
+ TObjectInfo anObjectInfo = GetObjectByEntry(aStudy, anIO->getEntry());
+ if(anObjectInfo.mySObject){
+ TSelectionItem aSelectionItem;
+ aSelectionItem.myObjectInfo = anObjectInfo;
+ aSelectionItem.myIO = anIO;
+ aSelectionInfo.push_back(aSelectionItem);
+ }
+ }
+ anIter.Next(); // MULTIPR fixed
}
- anIter.Next(); // MULTIPR fixed
}
return aSelectionInfo;
}
//----------------------------------------------------------------------------
TObjectInfo
GetObjectByEntry(const SalomeApp_Study* theStudy,
- const std::string& theEntry)
+ const std::string& theEntry)
{
TObjectInfo anObjectInfo;
if(!theStudy || theEntry == "")
anObjectInfo.mySObject = aSObject;
CORBA::Object_var anObject = ClientSObjectToObject(aSObject);
if(VISU::Base_i* aBase = GetServantInterface<VISU::Base_i>(anObject))
- anObjectInfo.myBase = aBase;
+ anObjectInfo.myBase = aBase;
}
-
+
return anObjectInfo;
}
//----------------------------------------------------------------------------
VISU::Prs3d_i*
GetPrs3dToModify(const SalomeApp_Module* theModule,
- Base_i* theBase)
+ Base_i* theBase)
{
if (CheckLock(GetCStudy(GetAppStudy(theModule)), GetDesktop(theModule)))
return NULL;
//----------------------------------------------------------------------------
bool
GetPrs3dSelectionInfo(const SalomeApp_Module* theModule,
- VISU::Prs3d_i*& thePrs3d,
- SVTK_ViewWindow*& theViewWindow,
- VISU_Actor*& thenActor)
+ VISU::Prs3d_i*& thePrs3d,
+ SVTK_ViewWindow*& theViewWindow,
+ VISU_Actor*& thenActor)
{
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
if(aSelectionInfo.empty())
return false;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
thePrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
if(!thePrs3d)
return false;
-
+
theViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
if(!theViewWindow)
return false;
-
+
thenActor = FindActor(theViewWindow, thePrs3d);
if(!thenActor)
return false;
-
+
return true;
}
//------------------------------------------------------------
void
Remove(LightApp_SelectionMgr* theSelectionMgr,
- const Handle(SALOME_InteractiveObject)& theIO)
+ const Handle(SALOME_InteractiveObject)& theIO)
{
if (theIO.IsNull()) return;
SALOME_ListIO aListIO, aNewListIO;
for (; anIter.More(); anIter.Next()) {
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
if (!anIO->isSame(theIO)) {
- aNewListIO.Append(theIO);
+ aNewListIO.Append(theIO);
}
}
theSelectionMgr->setSelectedObjects(aNewListIO);
_PTR(GenericAttribute) anAttr;
_PTR(AttributeString) aComment;
- _PTR(SObject) aRefSObject;
- if (aSObject->ReferencedObject(aRefSObject)) {
- // It can be a reference on curve, published under a container. IPAL 20317
- VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(theModule), aRefSObject->GetID());
- VISU::Base_i* aRefBase = aRefObjectInfo.myBase;
- if( (aRefBase && aRefBase->GetType() == VISU::TCURVE) || (aRefBase && aRefBase->GetType() == VISU::TMESH) )
- return true;
- }
+ _PTR(SObject) aRefSObject;
+ if (aSObject->ReferencedObject(aRefSObject)) {
+ // It can be a reference on curve, published under a container. IPAL 20317
+ VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(theModule), aRefSObject->GetID());
+ VISU::Base_i* aRefBase = aRefObjectInfo.myBase;
+ if( (aRefBase && aRefBase->GetType() == VISU::TCURVE) || (aRefBase && aRefBase->GetType() == VISU::TMESH) )
+ return true;
+ }
bool isUnderVISU = false;
_PTR(SObject) aFatherSObject = aSObject->GetFather();
//------------------------------------------------------------
void
DeleteSObject(VisuGUI* theModule,
- _PTR(Study) theStudy,
- _PTR(SObject) theSObject)
+ _PTR(Study) theStudy,
+ _PTR(SObject) theSObject)
{
_PTR(ChildIterator) aChildIter = theStudy->NewChildIterator(theSObject);
for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
// Remove aSObject together with all its sub-objects
VISU::RemoveFromStudy(theSObject,
false, // remove not only IOR attribute, but Object With Children
- false); // not Destroy() sub-objects
+ false); // not UnRegister() sub-objects
}
}
if(VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(thePrs)){
std::string anEntry = aColoredPrs3d->GetHolderEntry();
if(anEntry != ""){
- VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(theModule), anEntry);
- if(VISU::Base_i* aBase = anObjectInfo.myBase){
- if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
- CORBA::Object_var anObject = aBase->_this();
- VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(anObject);
- aRemovableObject->RemoveFromStudy();
- return;
- }
- }
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(theModule), anEntry);
+ if(VISU::Base_i* aBase = anObjectInfo.myBase){
+ if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
+ CORBA::Object_var anObject = aBase->_this();
+ VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(anObject);
+ aRemovableObject->RemoveFromStudy();
+ return;
+ }
+ }
}
- }
-
+ }
+
thePrs->RemoveFromStudy();
-
}
//------------------------------------------------------------
TSelectionItem aSelectionItem = aSelectionInfo.front();
aPrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
if(!aPrs3d) {
- aTable = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);
+ aTable = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);
if(!aTable)
- return;
+ return;
}
SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
if (aPrs3d) {
anActor = FindActor(aViewWindow, aPrs3d);
if(!anActor)
- return;
+ return;
} else {
anActorBase = VISU::FindActorBase(aViewWindow, aTable);
if(!anActorBase)
- return;
+ return;
}
switch (theType) {
case VISU::SHRINK:
if (aPrs3d) {
- if (anActor->IsShrunk())
- anActor->UnShrink();
- else
- anActor->SetShrink();
- if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
- aMesh->SetShrink(true);
- }
+ bool toShrink;
+ if (anActor->IsShrunk()) {
+ anActor->UnShrink();
+ toShrink = false;
+ }
+ else {
+ anActor->SetShrink();
+ toShrink = true;
+ }
+ if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
+ aMesh->SetShrink(toShrink);
+ }
} else if (aTable) {
- if (anActorBase->IsShrunk())
- anActorBase->UnShrink();
- else
- anActorBase->SetShrink();
+ if (anActorBase->IsShrunk())
+ anActorBase->UnShrink();
+ else
+ anActorBase->SetShrink();
}
break;
default:
if (aPrs3d) {
- if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
- aMesh->SetPresentationType(theType);
- RecreateActor(theModule, aMesh);
- } else {
- anActor->SetRepresentation(theType);
- }
+ if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
+ aMesh->SetPresentationType(theType);
+ RecreateActor(theModule, aMesh);
+ } else {
+ anActor->SetRepresentation(theType);
+ }
}
else if (aTable) {
- anActorBase->SetRepresentation(theType);
+ anActorBase->SetRepresentation(theType);
}
}
aViewWindow->Repaint();
}
+
+ void ChangeQuadratic2DRepresentation (const SalomeApp_Module* theModule,
+ VISU::Quadratic2DPresentationType theType)
+ {
+ TSelectionInfo aSelectionInfo = GetSelectedObjects(theModule);
+ if(aSelectionInfo.empty())
+ return;
+
+ TSelectionItem aSelectionItem = aSelectionInfo.front();
+
+ VISU::Prs3d_i* aPrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
+
+ SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+
+ if(!aPrs3d || !aViewWindow)
+ return;
+
+ VISU_Actor *anActor = FindActor(aViewWindow, aPrs3d);
+ if(!anActor)
+ return;
+
+ if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
+ aMesh->SetQuadratic2DPresentationType(theType);
+ RecreateActor(theModule, aMesh);
+ } else {
+ switch(theType){
+ case VISU::LINES:
+ anActor->SetQuadratic2DRepresentation(VISU_Actor::eLines);
+ break;
+ case VISU::ARCS:
+ anActor->SetQuadratic2DRepresentation(VISU_Actor::eArcs);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
//------------------------------------------------------------
void
SetShading ( const SalomeApp_Module* theModule,
- bool theOn )
+ bool theOn )
{
TSelectionInfo aSelectionInfo = GetSelectedObjects(theModule);
if(aSelectionInfo.empty())
CheckTimeStamp(const SalomeApp_Module* theModule,
_PTR(SObject)& theSObject,
Handle(SALOME_InteractiveObject)& theIO,
- ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode)
+ ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode)
{
TSelectionInfo aSelectionInfo = GetSelectedObjects(theModule);
if(!aSelectionInfo.empty()){
theSObject = aSelectionItem.myObjectInfo.mySObject;
VISU::VISUType aType = VISU::Storable::SObject2Type(theSObject);
if (VISU::TTIMESTAMP == aType){
- thePublishInStudyMode = ColoredPrs3d_i::EPublishUnderTimeStamp;
+ thePublishInStudyMode = ColoredPrs3d_i::EPublishUnderTimeStamp;
return true;
}
if (VISU::TFIELD == aType){
- thePublishInStudyMode = ColoredPrs3d_i::EPublishIndependently;
- if(theSObject->FindSubObject(2,theSObject))
- return true;
+ thePublishInStudyMode = ColoredPrs3d_i::EPublishIndependently;
+ if(theSObject->FindSubObject(2,theSObject))
+ return true;
}
}
SUIT_MessageBox::warning(GetDesktop(theModule),
{
if(theSource->Depth() < 3) // Bug of SALOMEDS : can\t get father from root object
return NULL;
-
+
_PTR(SObject) aSObj = theSource->GetFather();
if (!aSObj)
return NULL;
VISU::Prs3d_i* thePrs,
SVTK_ViewWindow* theViewWindow)
{
- VISU_Actor* aActor = NULL;
+ VISU_Actor* anActor = NULL;
if (!thePrs || !theViewWindow)
- return aActor;
+ return anActor;
+
+ SalomeApp_Application *anApp = dynamic_cast<SalomeApp_Application*>(theModule->application());
+ if(!anApp)
+ return anActor;
+
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy());
+
+ if(!aStudy)
+ return anActor;
+
QApplication::setOverrideCursor( Qt::WaitCursor );
try {
- if ((aActor = thePrs->CreateActor()))
- theViewWindow->AddActor(aActor);
+ if ((anActor = thePrs->CreateActor())) {
+ theViewWindow->AddActor(anActor);
+
+ if(anActor->hasIO() && anActor->getIO()->hasEntry())
+ aStudy->setVisibilityState(anActor->getIO()->getEntry(), Qtx::ShownState);
+ }
} catch(std::exception& exc) {
SUIT_MessageBox::warning
(GetDesktop(theModule), QObject::tr("WRN_VISU"),
}
QApplication::restoreOverrideCursor();
- return aActor;
+ return anActor;
}
//------------------------------------------------------------
//------------------------------------------------------------
VISU_Actor*
FindActor(const SalomeApp_Study* theStudy,
- SVTK_ViewWindow* theViewWindow,
- const QString& theEntry)
+ SVTK_ViewWindow* theViewWindow,
+ const QString& theEntry)
{
TObjectInfo anObjectInfo = GetObjectByEntry(theStudy, theEntry.toLatin1().data());
VISU::Prs3d_i* aPrs3d = GetPrs3dFromBase(anObjectInfo.myBase);
//------------------------------------------------------------
VISU_ActorBase*
FindActorBase(const SalomeApp_Study* theStudy,
- SVTK_ViewWindow* theViewWindow,
- const QString& theEntry)
+ SVTK_ViewWindow* theViewWindow,
+ const QString& theEntry)
{
TObjectInfo anObjectInfo = GetObjectByEntry(theStudy, theEntry.toLatin1().constData());
VISU::PointMap3d_i* aTable = dynamic_cast<VISU::PointMap3d_i*>(anObjectInfo.myBase);
{
QApplication::setOverrideCursor(Qt::WaitCursor);
- SALOMEDS::SObject_var aSObject = thePrs->GetSObject();
- CORBA::String_var anEntry = aSObject->GetID();
+ /* SALOMEDS::SObject_var aSObject = thePrs->GetSObject();
+ CORBA::String_var anEntry = aSObject->GetID();*/
try {
thePrs->UpdateActors();
//------------------------------------------------------------
bool
ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow,
- vtkFloatingPointType allBounds[6],
- const char* theActorClassName)
+ vtkFloatingPointType allBounds[6],
+ const char* theActorClassName)
{
vtkRenderer *aRen = theViewWindow->getRenderer();
- vtkActorCollection *anActColl = aRen->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRen->GetActors());
+ vtkActorCollection *anActColl = aCopy.GetActors();
vtkProp *prop;
vtkFloatingPointType *bounds;
int somethingVisible = false;
allBounds[1] = allBounds[3] = allBounds[5] = -VTK_LARGE_FLOAT;
// loop through all props
for (anActColl->InitTraversal(); (prop = anActColl->GetNextProp()); ) {
- // if it's invisible, or has no geometry, we can skip the rest
+ // if it's invisible, or has no geometry, we can skip the rest
if (prop->GetVisibility() && prop->IsA(theActorClassName)) {
bounds = prop->GetBounds();
// make sure we haven't got bogus bounds
bounds[2] > -VTK_LARGE_FLOAT && bounds[3] < VTK_LARGE_FLOAT &&
bounds[4] > -VTK_LARGE_FLOAT && bounds[5] < VTK_LARGE_FLOAT)
{
- somethingVisible = true;
- if (bounds[0] < allBounds[0]) allBounds[0] = bounds[0];
- if (bounds[1] > allBounds[1]) allBounds[1] = bounds[1];
- if (bounds[2] < allBounds[2]) allBounds[2] = bounds[2];
- if (bounds[3] > allBounds[3]) allBounds[3] = bounds[3];
- if (bounds[4] < allBounds[4]) allBounds[4] = bounds[4];
- if (bounds[5] > allBounds[5]) allBounds[5] = bounds[5];
+ somethingVisible = true;
+ if (bounds[0] < allBounds[0]) allBounds[0] = bounds[0];
+ if (bounds[1] > allBounds[1]) allBounds[1] = bounds[1];
+ if (bounds[2] < allBounds[2]) allBounds[2] = bounds[2];
+ if (bounds[3] > allBounds[3]) allBounds[3] = bounds[3];
+ if (bounds[4] < allBounds[4]) allBounds[4] = bounds[4];
+ if (bounds[5] > allBounds[5]) allBounds[5] = bounds[5];
}//not bogus
}
}
return NULL;
}
- //------------------------------------------------------------
- // Internal function used by several public functions below
- void
- UpdateCurve(VISU::Curve_i* theCurve,
- Plot2d_ViewFrame* aPlot,
- SPlot2d_Curve* plotCurve,
- int theDisplaying)
- {
- if ( theDisplaying == VISU::eErase ) {
- if ( plotCurve && aPlot )
- aPlot->eraseCurve( plotCurve, false );
- }
- else if ( theDisplaying == VISU::eDisplay || theDisplaying == VISU::eDisplayOnly ) {
- if ( plotCurve ) {
- plotCurve->setHorTitle( theCurve->GetHorTitle().c_str() );
- //plotCurve->setVerTitle( ( theCurve->GetVerTitle().c_str() ) );
- plotCurve->setVerTitle( theCurve->GetName().c_str() );
- plotCurve->setHorUnits( theCurve->GetHorUnits().c_str() );
- plotCurve->setVerUnits( theCurve->GetVerUnits().c_str() );
- double* xList = 0;
- double* yList = 0;
- QStringList zList;
- int nbPoints = theCurve->GetData( xList, yList, zList );
- if ( nbPoints > 0 && xList && yList ) {
- plotCurve->setData( xList, yList, nbPoints, zList );
- }
- if ( !theCurve->IsAuto() ) {
- plotCurve->setLine( (Plot2d::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
- plotCurve->setMarker( (Plot2d::MarkerType)theCurve->GetMarker() );
- SALOMEDS::Color color = theCurve->GetColor();
- plotCurve->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
- }
- plotCurve->setAutoAssign( theCurve->IsAuto() );
- if( aPlot )
- aPlot->displayCurve( plotCurve, false );
- }
- else {
- Plot2d_Curve* crv = theCurve->CreatePresentation();
- if ( crv ) {
- if( aPlot )
- aPlot->displayCurve( crv, false );
- theCurve->SetLine( (VISU::Curve::LineType)crv->getLine(), crv->getLineWidth() );
- theCurve->SetMarker( (VISU::Curve::MarkerType)crv->getMarker());
- SALOMEDS::Color newColor;
- newColor.R = crv->getColor().red()/255.;
- newColor.G = crv->getColor().green()/255.;
- newColor.B = crv->getColor().blue()/255.;
- theCurve->SetColor( newColor );
- crv->setAutoAssign( theCurve->IsAuto() );
- }
- }
- }
- }
-
//------------------------------------------------------------
void
PlotTable(const SalomeApp_Module* theModule,
VISU::Table_i* table,
int theDisplaying)
{
+ SalomeApp_Study* aStudy = GetAppStudy( theModule );
+ if( !aStudy )
+ return;
+
SPlot2d_Viewer* aView = GetPlot2dViewer( theModule, true ); // create if necessary
if ( !aView )
return;
if ( !aPlot )
return;
- if ( theDisplaying == VISU::eDisplayOnly )
- aPlot->EraseAll();
- QList<Plot2d_Curve*> clist;
- aPlot->getCurves( clist );
- _PTR(Study) aStudy = GetCStudy( GetAppStudy( theModule ) );
- _PTR(SObject) TableSO = aStudy->FindObjectID( table->GetEntry() );
- if ( TableSO ) {
- _PTR(ChildIterator) Iter = aStudy->NewChildIterator( TableSO );
- for ( ; Iter->More(); Iter->Next() ) {
- CORBA::Object_var childObject = VISU::ClientSObjectToObject( Iter->Value() );
- if( !CORBA::is_nil( childObject ) ) {
- CORBA::Object_ptr aCurve = VISU::Curve::_narrow( childObject );
- if( !CORBA::is_nil( aCurve ) ) {
- VISU::Curve_i* theCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
- SPlot2d_Curve* plotCurve = 0;
- SPlot2d_Curve* tmpCurve;
- for ( int i = 0; i < clist.count(); i++ ) {
- tmpCurve = dynamic_cast<SPlot2d_Curve*>( clist.at( i ) );
- if (tmpCurve && tmpCurve->hasIO() &&
- theCurve->GetEntry() == tmpCurve->getIO()->getEntry()) {
- plotCurve = tmpCurve;
- break;
- }
- }
-
- UpdateCurve( theCurve, aPlot, plotCurve, theDisplaying );
-
- if ( theDisplaying == VISU::eErase && plotCurve ) {
- clist.removeAll(plotCurve );
- }
- }
- }
- }
- aPlot->Repaint();
- }
+ // implementation moved to VISU_I package (see VISU_Tools.h)
+ VISU::PlotTable( aStudy, aPlot, table, theDisplaying );
}
//------------------------------------------------------------
if ( !aPlot )
return;
-// if ( theDisplaying == VISU::eDisplayOnly )
-// aPlot->EraseAll();
- QList<Plot2d_Curve*> clist;
- aPlot->getCurves( clist );
- SPlot2d_Curve* plotCurve = 0;
- SPlot2d_Curve* tmpCurve;
- if(theDisplaying == VISU::eErase) {
- // 23.06.2008 skl for IPAL17672
- for (int i = 0; i < clist.count(); i++) {
- tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
- if (tmpCurve && tmpCurve->hasIO() &&
- theCurve->GetEntry() == tmpCurve->getIO()->getEntry()) {
- plotCurve = tmpCurve;
- aPlot->eraseCurve(clist.at(i));
- break;
- }
- }
- UpdateCurve(theCurve, aPlot, plotCurve, theDisplaying);
- }
- else {
- for (int i = 0; i < clist.count(); i++) {
- tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
- if (tmpCurve && tmpCurve->hasIO() &&
- theCurve->GetEntry() == tmpCurve->getIO()->getEntry()) {
- plotCurve = tmpCurve;
- }
- else if (theDisplaying == VISU::eDisplayOnly) {
- aPlot->eraseCurve(clist.at(i));
- }
- }
- UpdateCurve(theCurve, aPlot, plotCurve, theDisplaying);
- }
-
- aPlot->Repaint();
+ // implementation moved to VISU_I package (see VISU_Tools.h)
+ VISU::PlotCurve( aPlot, theCurve, theDisplaying );
}
//------------------------------------------------------------
void
PlotRemoveCurve(const SalomeApp_Module* theModule,
- VISU::Curve_i* pCrv)
+ VISU::Curve_i* pCrv)
{
- QString anEntry = pCrv->GetEntry().c_str();
- ViewManagerList pvm_list;
- theModule->getApp()->viewManagers( SPlot2d_Viewer::Type(), pvm_list );
- ViewManagerList::Iterator pvm_it = pvm_list.begin();
- for( ; pvm_it != pvm_list.end(); pvm_it++ ){
- Plot2d_ViewManager* pvm = dynamic_cast<Plot2d_ViewManager*>( *pvm_it );
- if( pvm ){
- SPlot2d_Viewer* aSPlot2d = dynamic_cast<SPlot2d_Viewer*>( pvm->getViewModel() );
- if( aSPlot2d ){
- Plot2d_ViewFrame* aPlot = aSPlot2d->getActiveViewFrame();
- if(aPlot){
- QList<Plot2d_Curve*> clist;
- aPlot->getCurves( clist );
- for (int i = 0; i < clist.count(); i++) {
- if(SPlot2d_Curve* plotCurve = dynamic_cast<SPlot2d_Curve*>(clist[i]))
- if(plotCurve->hasIO() && (plotCurve->getIO()->getEntry() == anEntry))
- aPlot->eraseCurve(clist[i]);
- }
- }
- }
- }
- }
+ // implementation moved to VISU_I package (see VISU_Tools.h)
+ VISU::PlotRemoveCurve( theModule->getApp(), pCrv );
}
-
+
//------------------------------------------------------------
void
PlotContainer(const SalomeApp_Module* theModule,
if ( !aPlot )
return;
- if ( theDisplaying == VISU::eDisplayOnly )
- aPlot->EraseAll();
- QList<Plot2d_Curve*> clist;
- aPlot->getCurves( clist );
- if ( container->GetNbCurves() > 0 ) {
- int nbCurves = container->GetNbCurves();
- for ( int k = 1; k <= nbCurves; k++ ) {
- VISU::Curve_i* theCurve = container->GetCurve( k );
- if ( theCurve && theCurve->IsValid() ) {
- SPlot2d_Curve* plotCurve = dynamic_cast<SPlot2d_Curve*>
- (aView->getCurveByIO(new SALOME_InteractiveObject(theCurve->GetEntry().c_str(), "", "")));
-
- UpdateCurve( theCurve, aPlot, plotCurve, theDisplaying );
-
- if ( plotCurve && theDisplaying == VISU::eErase ) {
- clist.removeAll( plotCurve );
- }
- }
- }
- }
- aPlot->Repaint();
- if(GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)){
- aPlot->fitAll();
- }
- qApp->processEvents();
+ // implementation moved to VISU_I package (see VISU_Tools.h)
+ VISU::PlotContainer( aPlot, container, theDisplaying );
}
//------------------------------------------------------------
CreatePlot(SalomeApp_Module* theModule,
_PTR(SObject) theTableSO)
{
- if ( IsSObjectTable(theTableSO) ) {
- CORBA::Object_var aTable = VISU::ClientSObjectToObject(theTableSO);
- CORBA::Object_var aContainer = GetVisuGen( theModule )->CreateContainer();
- if ( !CORBA::is_nil( aTable ) && !CORBA::is_nil( aContainer ) ) {
- VISU::Table_i* pTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
- VISU::Container_i* pContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
-
- if ( pContainer && pTable ) {
- for ( int i = 2; i <= pTable->GetNbRows(); i++ ) {
- CORBA::Object_var aNewCurve = GetVisuGen( theModule )->CreateCurve( pTable->_this(), 1, i );
- if( !CORBA::is_nil( aNewCurve ) ) {
- VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>( VISU::GetServant(aNewCurve).in() );
- if ( pCrv ) {
- pContainer->AddCurve( pCrv->_this() );
- }
- }
- }
- PlotContainer( theModule, pContainer, VISU::eDisplay );
+ SPlot2d_Viewer* aView = GetPlot2dViewer( theModule, true );
+ if ( !aView )
+ return;
+ Plot2d_ViewFrame* aPlot = aView->getActiveViewFrame();
+ if ( !aPlot )
+ return;
- QString anEntry = pContainer->GetEntry().c_str();
- _PTR(Study) aStudy = theTableSO->GetStudy();
- _PTR(SObject) aContainerSO = aStudy->FindObjectID(anEntry.toLatin1().data());
- _PTR(SObject) aParentSO = aContainerSO->GetFather();
- UpdateObjBrowser(theModule,true,aParentSO);
- }
- }
- }
+ VISU::VISU_Gen_i* aVisuGen = VISU::GetVisuGen( theModule );
+
+ // implementation moved to VISU_I package (see VISU_Tools.h)
+ VISU::CreatePlot( aVisuGen, aPlot, theTableSO );
}
//************************************************************
// Others
VISU::Mesh_i*
CreateMesh(VisuGUI* theModule,
- const Handle(SALOME_InteractiveObject)& theIO,
- SVTK_ViewWindow* theViewWindow)
- {
- _PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule));
+ const Handle(SALOME_InteractiveObject)& theIO,
+ SVTK_ViewWindow* theViewWindow)
+ {
+ _PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule));
//if (CheckLock(aStudy))
// return;
timer.Start();
#endif
if(GetResourceMgr()->booleanValue("VISU","display_only",false)){
- const VisuGUI* av = dynamic_cast<const VisuGUI*>(theModule);
- if(av)(const_cast<VisuGUI*>(av))->OnEraseAll();
- }
+ const VisuGUI* av = dynamic_cast<const VisuGUI*>(theModule);
+ if(av)(const_cast<VisuGUI*>(av))->OnEraseAll();
+ }
PublishMeshInView(theModule, pPresent, theViewWindow);
if(GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)){
- SetFitAll(theViewWindow);
- }
+ SetFitAll(theViewWindow);
+ }
#ifdef CHECKTIME
timer.Stop();
MESSAGE("VisuGUI::CreateMesh() - DISPLAY MESH");
// GetPrs3dList: find list of presentations for the given object
// ========================================================================================
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
- const Handle(SALOME_InteractiveObject)& theIO)
+ const Handle(SALOME_InteractiveObject)& theIO,
+ bool theGP)
{
std::vector<VISU::Prs3d_i*> aList;
if (!theIO.IsNull() && theIO->hasEntry()) {
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule));
_PTR(SObject) aSObject = aCStudy->FindObjectID(theIO->getEntry());
- aList = GetPrs3dList(theModule, aSObject);
+ aList = GetPrs3dList(theModule, aSObject, theGP);
}
return aList;
}
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
- _PTR(SObject) theObject)
+ _PTR(SObject) theObject,
+ bool theGP)
{
std::vector<VISU::Prs3d_i*> aList; int k = 0;
if (!theObject)
if (!CORBA::is_nil(aVisuObj)) {
VISU::VISUType aType = aVisuObj->GetType();
switch (aType) {
- case VISU::TSCALARMAP:
+ case VISU::TGAUSSPOINTS:
+ if ( !theGP ) break;
+ case VISU::TSCALARMAP:
case VISU::TISOSURFACES:
case VISU::TDEFORMEDSHAPE:
case VISU::TCUTPLANES:
case VISU::TCUTLINES:
+ case VISU::TCUTSEGMENT:
case VISU::TVECTORS:
case VISU::TSTREAMLINES:
case VISU::TPLOT3D:
- case VISU::TSCALARMAPONDEFORMEDSHAPE:
- case VISU::TDEFORMEDSHAPEANDSCALARMAP:
- case VISU::TMESH:
+ case VISU::TSCALARMAPONDEFORMEDSHAPE:
+ case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+ case VISU::TMESH:
{
PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
if (aServant.in()) {
}
}
break;
+ case VISU::TCOLOREDPRS3DHOLDER:
+ {
+ PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+ if (aServant.in()) {
+ VISU::ColoredPrs3dHolder_i* aPrsHolderObject = dynamic_cast<VISU::ColoredPrs3dHolder_i*>(aServant.in());
+ if( aPrsHolderObject ) {
+ VISU::Prs3d_i* aPrsObject = aPrsHolderObject->GetPrs3dDevice();
+ aList.resize(k+1);
+ aList[k] = aPrsObject;
+ k++;
+ }
+ }
+ }
}
}
} else {
VISU::VISUType aType = VISU::Storable::SObject2Type(theObject);
switch (aType) {
case VISU::TFIELD: {
- _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(theObject);
- _PTR(SObject) aTimeStamp;
- anIter->Next(); // First is reference on support
- for (; anIter->More(); anIter->Next()) {
- aTimeStamp = anIter->Value();
- if (!aTimeStamp) continue;
- std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(theModule, aTimeStamp);
- if (!aSubList.empty()) {
- int n = aSubList.size();
- aList.resize(k+n);
- for (int i = 0; i < n; i++) {
- aList[k] = aSubList[i];
- k++;
- }
- }
- }
- break;
+ _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(theObject);
+ _PTR(SObject) aTimeStamp;
+ anIter->Next(); // First is reference on support
+ for (; anIter->More(); anIter->Next()) {
+ aTimeStamp = anIter->Value();
+ if (!aTimeStamp) continue;
+ std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(theModule, aTimeStamp);
+ if (!aSubList.empty()) {
+ int n = aSubList.size();
+ aList.resize(k+n);
+ for (int i = 0; i < n; i++) {
+ aList[k] = aSubList[i];
+ k++;
+ }
+ }
+ }
+ break;
}
case VISU::TTIMESTAMP: {
- _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(theObject);
- _PTR(SObject) aPrs;
- for (; anIter->More(); anIter->Next()) {
- aPrs = anIter->Value();
- if (!aPrs) continue;
- std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(theModule, aPrs);
- if (!aSubList.empty()) {
- int n = aSubList.size();
- aList.resize(k+n);
- for (int i = 0; i < n; i++) {
- aList[k] = aSubList[i];
- k++;
- }
- }
- }
- break;
+ _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(theObject);
+ _PTR(SObject) aPrs;
+ for (; anIter->More(); anIter->Next()) {
+ aPrs = anIter->Value();
+ if (!aPrs) continue;
+ std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(theModule, aPrs);
+ if (!aSubList.empty()) {
+ int n = aSubList.size();
+ aList.resize(k+n);
+ for (int i = 0; i < n; i++) {
+ aList[k] = aSubList[i];
+ k++;
+ }
+ }
+ }
+ break;
}}
}
return aList;
if (aViewToPrsIter != aMap.end()) {
TSetPrs3d::const_iterator aPrsIter = (aViewToPrsIter->second).begin();
for (; aPrsIter != (aViewToPrsIter->second).end(); aPrsIter++) {
- aIndexes.insert((*aPrsIter).second);
+ aIndexes.insert((*aPrsIter).second);
}
}
std::set<int>::const_iterator aIter = aIndexes.begin();
for (int i = 1,length = aIndexes.size(); i <= length; i++) {
std::set<int>::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;
TSetPrs3d::iterator aIter = aMap[theViewWindow].begin();
for (; aIter != aMap[theViewWindow].end(); aIter++)
if ((*aIter).first == thePrs3d) {
- aMap[theViewWindow].erase(*aIter);
- return;
+ aMap[theViewWindow].erase(*aIter);
+ return;
}
}
//------------------------------------------------------------
- void initSpinBox( QSpinBox* spinBox,
- int min, int max, int step )
- {
- spinBox->setRange( min, max );
- spinBox->setSingleStep( step );
- }
- //------------------------------------------------------------
- void initSpinBox( QDoubleSpinBox* spinBox,
- double min, double max,
- double step, int decimals )
- {
- spinBox->setRange( min, max );
- spinBox->setSingleStep( step );
- spinBox->setDecimals( decimals );
- }
- //------------------------------------------------------------
bool getClippingPlanesFolder(_PTR(Study) theStudy, _PTR(SObject)& theSObject)
{
_PTR(SComponent) aVisuSO = theStudy->FindComponent("VISU");
if (!aFolder) {
_PTR(StudyBuilder) aBuilder = theStudy->NewBuilder();
aFolder = aBuilder->NewObject(aVisuSO);
-
+
_PTR(GenericAttribute) anAttr;
anAttr = aBuilder->FindOrCreateAttribute(aFolder,"AttributeName");
_PTR(AttributeName) aName(anAttr);
theSObject = aFolder;
return true;
}
+
+ //------------------------------------------------------------
+ void initSpinBox( SalomeApp_IntSpinBox* sb,
+ const int bottom,
+ const int top,
+ const int step )
+ {
+ sb->setAcceptNames( false );
+ sb->setRange( bottom, top );
+ sb->setSingleStep( step );
+ }
+
+ //------------------------------------------------------------
+ void initSpinBox( SalomeApp_DoubleSpinBox* sb,
+ const double& bottom,
+ const double& top,
+ const double& step,
+ const char* quantity )
+ {
+ // Obtain precision from preferences
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ int precision = resMgr->integerValue( "VISU", quantity, 3 );
+
+ sb->setPrecision ( precision );
+ sb->setDecimals ( qAbs(precision) );
+ sb->setRange ( bottom, top );
+ sb->setSingleStep ( step );
+ sb->setDefaultValue( bottom );
+ sb->setAcceptNames ( false );
+
+ // Add a hint for the user saying how to tune precision
+ QString userPropName = QObject::tr( QString( "VISU_PREF_%1" ).arg( quantity ).toLatin1().constData() );
+ sb->setProperty( "validity_tune_hint",
+ QVariant( QObject::tr( "VISU_PRECISION_HINT" ).arg( userPropName ) ) );
+ }
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Tools.h
// Author : Sergey Anikin
class Plot2d_ViewFrame;
class CAM_Module;
class LightApp_SelectionMgr;
+class SalomeApp_DoubleSpinBox;
+class SalomeApp_IntSpinBox;
class SalomeApp_Module;
class SalomeApp_Study;
class VisuGUI;
bool IsStudyLocked( _PTR(Study) theStudy );
bool CheckLock( _PTR(Study) theStudy,
- QWidget* theWidget );
+ QWidget* theWidget );
//----------------------------------------------------------------------------
int runAndWait( QDialog* dlg, const bool modal );
void UpdateObjBrowser(SalomeApp_Module* theModule,
- bool theIsUpdateDataModel = true,
- _PTR(SObject) theSObject = _PTR(SObject)());
+ bool theIsUpdateDataModel = true,
+ _PTR(SObject) theSObject = _PTR(SObject)());
//----------------------------------------------------------------------------
VISU_Gen_i* GetVisuGen(const CAM_Module* theModule);
TSelectionInfo GetSelectedObjects(const SalomeApp_Module* theModule);
TObjectInfo GetObjectByEntry(const SalomeApp_Study* theStudy,
- const std::string& theEntry);
+ const std::string& theEntry);
VISU::Prs3d_i* GetPrs3dToModify(const SalomeApp_Module* theModule,
- Base_i* theBase);
+ Base_i* theBase);
VISU::Prs3d_i* GetPrs3dFromBase(Base_i* theBase);
bool GetPrs3dSelectionInfo( const SalomeApp_Module* theModule,
- VISU::Prs3d_i*& thePrs3d,
- SVTK_ViewWindow*& theViewWindow,
- VISU_Actor*& thenActor );
+ VISU::Prs3d_i*& thePrs3d,
+ SVTK_ViewWindow*& theViewWindow,
+ VISU_Actor*& thenActor );
//----------------------------------------------------------------------------
void Add(LightApp_SelectionMgr* theSelectionMgr,
- const Handle(SALOME_InteractiveObject)& theIO);
+ const Handle(SALOME_InteractiveObject)& theIO);
void Remove(LightApp_SelectionMgr* theSelectionMgr,
- const Handle(SALOME_InteractiveObject)& theIO);
+ const Handle(SALOME_InteractiveObject)& theIO);
bool IsRemovable (const std::string theEntry,
- const SalomeApp_Module* theModule);
+ const SalomeApp_Module* theModule);
bool IsRemovableSelected(const SalomeApp_Module* theModule);
void DeleteSObject(VisuGUI* theModule,
- _PTR(Study) theStudy,
- _PTR(SObject) theSObject);
+ _PTR(Study) theStudy,
+ _PTR(SObject) theSObject);
void DeletePrs3d(VisuGUI* theModule,
- VISU::Prs3d_i* thePrs);
+ VISU::Prs3d_i* thePrs);
// Presentation management
void ChangeRepresentation (const SalomeApp_Module* theModule,
- VISU::PresentationType theType);
+ VISU::PresentationType theType);
+
+
+ void ChangeQuadratic2DRepresentation (const SalomeApp_Module* theModule,
+ VISU::Quadratic2DPresentationType theType);
+
+
void SetShading ( const SalomeApp_Module* theModule, bool theOn = true );
// SObject type
bool CheckTimeStamp(const SalomeApp_Module* theModule,
- _PTR(SObject)& theSObject,
- Handle(SALOME_InteractiveObject)& theIO,
- ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode);
+ _PTR(SObject)& theSObject,
+ Handle(SALOME_InteractiveObject)& theIO,
+ ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode);
VISU::Result_i* CheckResult(const SalomeApp_Module* theModule,
- _PTR(SObject) theSource,
- VISU::Result_var& theResult);
+ _PTR(SObject) theSource,
+ VISU::Result_var& theResult);
bool IsSObjectTable(_PTR(SObject) theSObject);
/*! Display mesh presentation in given VTK view window
*/
VISU_Actor* PublishMeshInView(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs,
- SVTK_ViewWindow* theViewWindow);
+ VISU::Prs3d_i* thePrs,
+ SVTK_ViewWindow* theViewWindow);
/*!
* \brief Repaint all SVTK view windows, where the given object is displayed.
* \param theIObject - is supposed to be selected (is highlighted in this method).
*/
void RepaintViewWindows(const SalomeApp_Module* theModule,
- const Handle(SALOME_InteractiveObject)& theIObject);
+ const Handle(SALOME_InteractiveObject)& theIObject);
VISU_Actor* FindActor(const SalomeApp_Study* theStudy,
- SVTK_ViewWindow* theViewWindow,
- const QString& theEntry);
+ SVTK_ViewWindow* theViewWindow,
+ const QString& theEntry);
VISU_ActorBase* FindActorBase(const SalomeApp_Study* theStudy,
- SVTK_ViewWindow* theViewWindow,
- const QString& theEntry);
+ SVTK_ViewWindow* theViewWindow,
+ const QString& theEntry);
void RecreateActor(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs);
+ VISU::Prs3d_i* thePrs);
bool ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow,
- vtkFloatingPointType allBounds[6],
- const char* theActorClassName = "VISU_Actor");
+ vtkFloatingPointType allBounds[6],
+ const char* theActorClassName = "VISU_Actor");
/*!
* \brief Advanced FitAll, sets view projection in accordance with current view contents
// Plot2d View
SPlot2d_Viewer* GetPlot2dViewer(const SalomeApp_Module* theModule,
- const bool theCreate = false);
+ const bool theCreate = false);
void PlotTable( const SalomeApp_Module* theModule,
- VISU::Table_i* table,
- int theDisplaying );
+ VISU::Table_i* table,
+ int theDisplaying );
void PlotCurve( const SalomeApp_Module* theModule,
- VISU::Curve_i* curve,
- int theDisplaying );
+ VISU::Curve_i* curve,
+ int theDisplaying );
void PlotRemoveCurve(const SalomeApp_Module* theModule,
- VISU::Curve_i* curve);
+ VISU::Curve_i* curve);
void PlotContainer( const SalomeApp_Module* theModule,
- VISU::Container_i* container,
- int theDisplaying );
+ VISU::Container_i* container,
+ int theDisplaying );
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 );
+ _PTR(SObject) theSobj );
/*! Create mesh presentation and display it in \a theViewWindow.
* If \a theViewWindow is NULL, no displaying will be done.
*/
VISU::Mesh_i* CreateMesh(VisuGUI* theModule,
- const Handle(SALOME_InteractiveObject)& theIO,
- SVTK_ViewWindow* theViewWindow);
+ const Handle(SALOME_InteractiveObject)& theIO,
+ SVTK_ViewWindow* theViewWindow);
// Others
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
- const Handle(SALOME_InteractiveObject)& theIO);
+ const Handle(SALOME_InteractiveObject)& theIO,
+ bool theGP = false);
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
- _PTR(SObject) theObject);
+ _PTR(SObject) theObject,
+ bool theGP = false);
int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow);
void AddScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
- VISU::Prs3d_i* thePrs3d, int pos);
+ VISU::Prs3d_i* thePrs3d, int pos);
void RemoveScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
- VISU::Prs3d_i* thePrs3d);
- void initSpinBox( QSpinBox*, int, int, int = 1 );
- void initSpinBox( QDoubleSpinBox*, double, double, double = 0.1, int = 6 );
+ VISU::Prs3d_i* thePrs3d);
#define CLIP_PLANES_FOLDER "Clipping Planes"
bool getClippingPlanesFolder(_PTR(Study) theStudy, _PTR(SObject)& theSObject);
+
+ void initSpinBox( SalomeApp_IntSpinBox*, const int, const int, const int );
+ void initSpinBox( SalomeApp_DoubleSpinBox*, const double&, const double&, const double&, const char* );
}
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_TransparencyDlg.cxx
// Author : Nicolas REJNERI
#include <QGroupBox>
#include <QKeyEvent>
-using namespace std;
+const int DEFAULT_OPACITY = 100;
+const int UNDEF_OPACITY = -1;
//=================================================================================
// class : VisuGUI_TransparencyDlg()
//=================================================================================
VisuGUI_TransparencyDlg::VisuGUI_TransparencyDlg( VisuGUI* theModule,
bool modal )
- : QDialog( VISU::GetDesktop( theModule ), Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
- myModule(theModule),
- mySelectionMgr( VISU::GetSelectionMgr( theModule ) ),
- myViewWindow( VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule) )
+ : QDialog( VISU::GetDesktop( theModule ), Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+ myModule(theModule),
+ mySelectionMgr( VISU::GetSelectionMgr( theModule ) ),
+ myViewWindow( VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule) )
{
setModal( modal );
setAttribute( Qt::WA_DeleteOnClose );
GroupC1Layout->setMargin(11);
TextLabelTransparent = new QLabel(tr("TRANSPARENCY_TRANSPARENT" ), GroupC1);
- TextLabelTransparent->setAlignment(Qt::AlignLeft);
- GroupC1Layout->addWidget(TextLabelTransparent, 0, 0);
+ TextLabelTransparent->setAlignment(Qt::AlignRight);
+ GroupC1Layout->addWidget(TextLabelTransparent, 0, 2);
ValueLab = new QLabel(GroupC1);
ValueLab->setAlignment(Qt::AlignCenter);
GroupC1Layout->addWidget(ValueLab, 0, 1);
TextLabelOpaque = new QLabel(tr("TRANSPARENCY_OPAQUE" ), GroupC1);
- TextLabelOpaque->setAlignment(Qt::AlignRight);
- GroupC1Layout->addWidget(TextLabelOpaque, 0, 2);
+ TextLabelOpaque->setAlignment(Qt::AlignLeft);
+ GroupC1Layout->addWidget(TextLabelOpaque, 0, 1);
Slider1 = new QSlider( Qt::Horizontal, GroupC1 );
Slider1->setMinimum( 0 );
//=======================================================================
void VisuGUI_TransparencyDlg::ClickOnHelp()
{
- QString aHelpFileName = "viewing_3d_presentations_intro_page.html#width_opacity_anchor";
+ QString aHelpFileName = "viewing_3d_presentations_page.html#width_opacity_anchor";
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
if (app) {
VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
}
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(0, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
{
if( myViewWindow ) {
SUIT_OverrideCursor wc;
- float opacity = this->Slider1->value() / 100.;
+ float opacity = (100 - this->Slider1->value() ) / 100.;
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList);
for (; anIter.More(); anIter.Next()) {
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, anIO->getEntry());
- if (anActor)
- anActor->SetOpacity(opacity);
- else {
- VISU_ActorBase* anActor = VISU::FindActorBase(VISU::GetAppStudy(myModule), myViewWindow, anIO->getEntry());
if (anActor)
anActor->SetOpacity(opacity);
+ else {
+ VISU_ActorBase* anActor = VISU::FindActorBase(VISU::GetAppStudy(myModule), myViewWindow, anIO->getEntry());
+ if (anActor)
+ anActor->SetOpacity(opacity);
}
}
myViewWindow->Repaint();
//=================================================================================
void VisuGUI_TransparencyDlg::onSelectionChanged()
{
- if( myViewWindow ) {
- int opacity = 100;
+ if ( myViewWindow ) {
+ int opacity = UNDEF_OPACITY;
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList);
- if (aList.Extent() == 1) {
- Handle(SALOME_InteractiveObject) FirstIOS = aList.First();
- if (!FirstIOS.IsNull()) {
- VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, FirstIOS->getEntry());
- if (anActor)
- opacity = int(anActor->GetOpacity() * 100. + 0.5);
- }
- } else if (aList.Extent() > 1) {
- SALOME_ListIteratorOfListIO It (aList);
- int setOp = -1;
- for (; It.More(); It.Next()) {
- Handle(SALOME_InteractiveObject) IO = It.Value();
- if (!IO.IsNull()) {
- VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, IO->getEntry());
- if (anActor) {
- int op = int(anActor->GetOpacity() * 100. + 0.5);
- if (setOp < 0)
- setOp = op;
- else if (setOp != op) {
- setOp = 100;
- break;
- }
+ SALOME_ListIteratorOfListIO It (aList);
+ for (; It.More(); It.Next()) {
+ Handle(SALOME_InteractiveObject) IO = It.Value();
+ if (!IO.IsNull()) {
+ int op = UNDEF_OPACITY;
+ VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, IO->getEntry());
+ if (anActor) {
+ op = int(anActor->GetOpacity() * 100. + 0.5);
+ }
+ else {
+ VISU_ActorBase* anActor = VISU::FindActorBase(VISU::GetAppStudy(myModule), myViewWindow, IO->getEntry());
+ if (anActor)
+ op = int(anActor->GetOpacity() * 100. + 0.5);
+ }
+ if ( op != UNDEF_OPACITY ) {
+ if ( opacity == UNDEF_OPACITY )
+ opacity = op;
+ else if ( opacity != op ) {
+ opacity = DEFAULT_OPACITY;
+ break;
}
}
}
- if (setOp >= 0)
- opacity = setOp;
- } else {
}
- Slider1->setValue(opacity);
+ Slider1->setValue( 100 - ( opacity == UNDEF_OPACITY ? DEFAULT_OPACITY : opacity ) );
}
ValueHasChanged();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VisuGUI : GUI for VISU component
// File : VisuGUI_TransparencyDlg.h
// Author : Nicolas REJNERI
public:
VisuGUI_TransparencyDlg( VisuGUI* = 0,
- bool modal = false );
+ bool modal = false );
~VisuGUI_TransparencyDlg();
-// 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
-//
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_ValuesLabelingDlg.cxx
// Author : Litonin SERGEY
// Module : SALOME
-
+//
#include "VisuGUI_ValuesLabelingDlg.h"
#include "VisuGUI.h"
/*!
\class VisuGUI_ValuesLabelingDlg
- \brief This class is intended for changing parameters of labeling values
+ \brief This class is intended for changing parameters of labeling values
of 3D colored presentations
*/
aBtnLay->addWidget( aHelp, 0, 3 );
myFont->setMode( QtxFontEdit::Custom );
- myFont->setFeatures( QtxFontEdit::Family | QtxFontEdit::Bold | QtxFontEdit::Italic |
+ myFont->setFeatures( QtxFontEdit::Family | QtxFontEdit::Bold | QtxFontEdit::Italic |
QtxFontEdit::Shadow | QtxFontEdit::UserSize | QtxFontEdit::Size );
QStringList fam;
fam.append( tr( "VISU_FONT_ARIAL" ) );
myFont->setFonts( fam );
// Layout widgets
-
+
QVBoxLayout* aMainLay = new QVBoxLayout( this );
aMainLay->setSpacing( 5 );
aMainLay->setMargin( 5 );
aMainLay->addWidget( aFGrp );
aMainLay->addWidget( aBtnGrp );
-
+
// Connect signals and slots
connect( anOK,SIGNAL( clicked() ), SLOT( accept() ) );
connect( aCancel, SIGNAL( clicked() ), SLOT( reject() ) );
}
/*!
- \brief Initializes dialog fields using specified presentation
+ \brief Initializes dialog fields using specified presentation
\param thePrs presentation
- \param theInit not used
+ \param theInit not used
\sa storeToPrsObject()
*/
void VisuGUI_ValuesLabelingDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, bool )
int VisuGUI_ValuesLabelingDlg::storeToPrsObject( VISU::ColoredPrs3d_i* thePrs )
{
if ( !thePrs )
- return 0;
+ return 0;
QFont aFont = myFont->currentFont();
// color
QColor aColor = myColor->color();
- thePrs->SetValLblFontColor(
+ thePrs->SetValLblFontColor(
aColor.red() / 255., aColor.green() / 255., aColor.blue() / 255. );
return 1;
*/
QString VisuGUI_ValuesLabelingDlg::GetContextHelpFilePath()
{
- return "values_labeling_page.html";
+ return "viewing_3d_presentations_page.html#labeling_parameters_anchor";
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// 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
-//
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_ValuesLabelingDlg.h
// Author : Sergey LITONIN
// Module : SALOME
-
+//
#ifndef VisuGUI_ValuesLabelingDlg_H
#define VisuGUI_ValuesLabelingDlg_H
-#include <VisuGUI_Prs3dDlg.h>
+#include "VisuGUI_Prs3dDlg.h"
class QtxFontEdit;
class QtxColorButton;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_VectorsDlg.cxx
// Author : Laurent CORNABE & Hubert ROLLAND
#include "VISU_Vectors_i.hh"
#include "LightApp_Application.h"
#include "SalomeApp_Module.h"
+#include <SalomeApp_IntSpinBox.h>
+#include <SalomeApp_DoubleSpinBox.h>
#include "SUIT_Desktop.h"
#include "SUIT_MessageBox.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
#include <QtxColorButton.h>
#include <QRadioButton>
#include <QCheckBox>
#include <QLabel>
-#include <QSpinBox>
#include <QPushButton>
#include <QKeyEvent>
// Scale factor
ScaleLabel = new QLabel (tr("LBL_SCALE_FACTOR"), TopGroup );
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
-
- ScalFact = new QtxDoubleSpinBox( 0, 1.0E+38, 0.1, aPrecision*(-1), 32, TopGroup );
+ ScalFact = new SalomeApp_DoubleSpinBox( TopGroup );
+ VISU::initSpinBox( ScalFact, 0., 1.0E+38, .1, "visual_data_precision" );
ScalFact->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
ScalFact->setValue( 0.1 );
// Line width
LineWidLabel = new QLabel (tr("LBL_LINE_WIDTH"), TopGroup );
- LinWid = new QSpinBox( TopGroup );
+ LinWid = new SalomeApp_IntSpinBox( TopGroup );
+ LinWid->setAcceptNames( false );
LinWid->setMinimum( 1 );
LinWid->setMaximum( 10 );
LinWid->setSingleStep( 1 );
GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
// top layout
- myTabBox->addTab(aBox, "Vectors");
+ myTabBox->addTab(aBox, tr("VISU_VECTORS"));
myInputPane = new VisuGUI_InputPane(VISU::TVECTORS, theModule, this);
- myTabBox->addTab(GetScalarPane(), "Scalar Bar");
- myTabBox->addTab(myInputPane, "Input");
+ myTabBox->addTab(GetScalarPane(), tr("SCALAR_BAR_TAB"));
+ myTabBox->addTab(myInputPane, tr("INPUT_TAB"));
TopLayout->addWidget( myTabBox );
TopLayout->addWidget( GroupButtons );
{}
void VisuGUI_VectorsDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if ( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TVECTORS>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_VectorsDlg.h
// Author : Laurent CORNABE & Hubert ROLLAND
#define VISUGUI_VECTORSDLG_H
#include "VisuGUI_Prs3dDlg.h"
-#include "QtxDoubleSpinBox.h"
class QGroupBox;
class QTabWidget;
#include CORBA_CLIENT_HEADER(VISU_Gen)
class SalomeApp_Module;
+class SalomeApp_IntSpinBox;
class VisuGUI_InputPane;
+class SalomeApp_DoubleSpinBox;
namespace VISU
{
void enableMagnColor( bool enable );
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
QCheckBox* UseMagn;
QtxColorButton* SelColor;
QLabel* LineWidLabel;
- QSpinBox* LinWid;
+ SalomeApp_IntSpinBox* LinWid;
QLabel* ScaleLabel;
- QtxDoubleSpinBox* ScalFact;
+ SalomeApp_DoubleSpinBox* ScalFact;
QCheckBox* UseGlyph;
QButtonGroup* TypeGlyph;
QGroupBox* TypeGB;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_ViewExtender.cxx
// Author : Vitaly Smetannikov
if (!myViewers.contains(aViewer)) {
SUIT_ViewManager* aMgr = aViewer->getViewManager();
connect(aMgr, SIGNAL(deleteView(SUIT_ViewWindow*)),
- this, SLOT(onViewDeleted(SUIT_ViewWindow*)));
+ this, SLOT(onViewDeleted(SUIT_ViewWindow*)));
connect(aViewer, SIGNAL(actorAdded(SVTK_ViewWindow*, VTKViewer_Actor*)),
- this, SLOT(onAddActor(SVTK_ViewWindow*, VTKViewer_Actor*)));
+ this, SLOT(onAddActor(SVTK_ViewWindow*, VTKViewer_Actor*)));
myViewers.append(aViewer);
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_ViewExtender.h
// Author : Vitaly Smetannikov
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Tools.cxx
// Author : Sergey Anikin
#include "SVTK_ViewModel.h"
#include "SVTK_ViewWindow.h"
+#include <VISU_Tools.h>
+
#include <SUIT_Desktop.h>
+#include <SalomeApp_Study.h>
+
namespace VISU
{
//----------------------------------------------------------------------------
VISU_Actor*
PublishInView(VisuGUI* theModule,
Prs3d_i* thePrs,
- SVTK_ViewWindow* theViewWindow,
- bool theIsHighlight)
+ SVTK_ViewWindow* theViewWindow,
+ bool theIsHighlight)
{
if (theViewWindow) {
QApplication::setOverrideCursor( Qt::WaitCursor );
try {
- 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;
- }
+ if (VISU_Actor* anActor = thePrs->CreateActor()) {
+ theViewWindow->AddActor(anActor);
+ if (theIsHighlight)
+ theViewWindow->highlight(anActor->getIO(),true);
+ theViewWindow->getRenderer()->ResetCameraClippingRange();
+ theViewWindow->Repaint();
+ QApplication::restoreOverrideCursor();
+
+ if(!thePrs->GetEntry().empty())
+ VISU::SetVisibilityState(thePrs->GetEntry(), Qtx::ShownState);
+ else {
+ VISU::ColoredPrs3d_i* prs = dynamic_cast<VISU::ColoredPrs3d_i*>(thePrs);
+ if(prs && !prs->GetHolderEntry().empty()) {
+ VISU::SetVisibilityState(prs->GetHolderEntry(), Qtx::ShownState);
+ }
+ }
+ return anActor;
+ }
} catch(std::exception& exc) {
- thePrs->RemoveActors();
+ thePrs->RemoveActors();
- QApplication::restoreOverrideCursor();
- INFOS(exc.what());
- SUIT_MessageBox::warning
- (GetDesktop(theModule), QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()));
+ QApplication::restoreOverrideCursor();
+ INFOS(exc.what());
+ SUIT_MessageBox::warning
+ (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()));
}
}
return NULL;
UpdateViewer(VisuGUI* theModule,
VISU::Prs3d_i* thePrs,
bool theDispOnly,
- const bool theIsHighlight)
+ const bool theIsHighlight)
{
if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)) {
vtkRenderer *aRen = aViewWindow->getRenderer();
- vtkActorCollection *anActColl = aRen->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRen->GetActors());
+ vtkActorCollection *anActColl = aCopy.GetActors();
anActColl->InitTraversal();
VISU_Actor* aResActor = NULL;
bool isOk = true;
while (vtkActor *anAct = anActColl->GetNextActor()) {
- if (VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(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());
- SUIT_MessageBox::warning
- (GetDesktop(theModule), QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()) );
- }
- } else if (theDispOnly) {
- anActor->VisibilityOff();
- }
- } else if (theDispOnly && anActor->GetVisibility()) {
- anActor->VisibilityOff();
- }
- }
+ if (VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(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());
+ SUIT_MessageBox::warning
+ (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()) );
+ }
+ } else if (theDispOnly) {
+ anActor->VisibilityOff();
+ }
+ } else if (theDispOnly && anActor->GetVisibility()) {
+ anActor->VisibilityOff();
+ }
+ }
}
if (aResActor) {
- if (theIsHighlight && isOk)
- aViewWindow->highlight(aResActor->getIO(), true);
- aViewWindow->getRenderer()->ResetCameraClippingRange();
- aViewWindow->Repaint();
- return aResActor;
+ if (theIsHighlight && isOk)
+ aViewWindow->highlight(aResActor->getIO(), true);
+ aViewWindow->getRenderer()->ResetCameraClippingRange();
+ aViewWindow->Repaint();
+ return aResActor;
}
return PublishInView(theModule, thePrs, aViewWindow, theIsHighlight);
}
void
ErasePrs3d(VisuGUI* theModule,
VISU::Prs3d_i* thePrs,
- bool theDoRepaint)
+ bool theDoRepaint)
{
if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)){
if(VISU_Actor* anActor = FindActor(aViewWindow, thePrs)){
anActor->VisibilityOff();
- if(theDoRepaint)
- aViewWindow->Repaint();
+ if(theDoRepaint)
+ aViewWindow->Repaint();
}
}
}
//----------------------------------------------------------------------------
void
ErasePrs(VisuGUI* theModule,
- Base_i* theBase,
- bool theDoRepaint)
- {
+ Base_i* theBase,
+ bool theDoRepaint)
+ {
if(!theBase)
return;
+ bool updateState = true;
+
switch (theBase->GetType()) {
case VISU::TCURVE: {
- if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(theBase))
- PlotCurve(theModule, aCurve, VISU::eErase );
+ if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(theBase)) {
+ PlotCurve(theModule, aCurve, VISU::eErase );
+ updateState = false;
+ }
break;
}
case VISU::TCONTAINER: {
- if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(theBase))
- PlotContainer(theModule, aContainer, VISU::eErase );
+ if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(theBase)) {
+ PlotContainer(theModule, aContainer, VISU::eErase );
+ updateState = false;
+ }
break;
}
case VISU::TTABLE: {
- if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(theBase))
- PlotTable(theModule, aTable, VISU::eErase );
+ if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(theBase)) {
+ PlotTable(theModule, aTable, VISU::eErase );
+ updateState = false;
+ }
break;
}
case VISU::TPOINTMAP3D: {
if (VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(theBase)) {
- if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)) {
- if(VISU_ActorBase* anActor = FindActorBase(aViewWindow, aTable3d)){
- anActor->VisibilityOff();
- if(theDoRepaint)
- aViewWindow->Repaint();
+ if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)) {
+ if(VISU_ActorBase* anActor = FindActorBase(aViewWindow, aTable3d)){
+ anActor->VisibilityOff();
+ if(theDoRepaint)
+ aViewWindow->Repaint();
+ }
+ } else {
+ if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(theBase)) {
+ PlotTable(theModule, aTable, VISU::eErase );
+ updateState = false;
}
- } else {
- if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(theBase))
- PlotTable(theModule, aTable, VISU::eErase );
- }
+ }
}
break;
}
default: {
if(VISU::Prs3d_i* aPrs3d = VISU::GetPrs3dFromBase(theBase)){
- if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)){
- RemoveScalarBarPosition(theModule, aViewWindow, aPrs3d);
- ErasePrs3d(theModule, aPrs3d, theDoRepaint);
- }
+ if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)){
+ RemoveScalarBarPosition(theModule, aViewWindow, aPrs3d);
+ ErasePrs3d(theModule, aPrs3d, theDoRepaint);
+ }
}
}} // switch (aType)
+
+ /* Update visibility state */
+ if(updateState) {
+ if( RemovableObject_i* obj = dynamic_cast<RemovableObject_i*>(theBase)) {
+ SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(theModule->application());
+ if(anApp) {
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy());
+ std::string entry = obj->GetEntry();
+ if(aStudy && !entry.empty())
+ aStudy->setVisibilityState(QString(entry.c_str()), Qtx::HiddenState);
+ }
+ }
+ }
}
-
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Tools.h
// Author : Sergey Anikin
typedef typename TViewer::TViewWindow TViewWindow;
if (SalomeApp_Application* anApp = theModule->getApp()) {
if (TViewWindow* aView = dynamic_cast<TViewWindow*>(anApp->desktop()->activeWindow()))
- return aView;
+ return aView;
}
SUIT_ViewManager* aViewManager =
theModule->getViewManager(TViewer::Type(), /*create = */true);
if (aViewManager) {
if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) {
- if (TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow)) {
- aViewWindow->raise();
- aViewWindow->setFocus();
- return aView;
- }
+ if (TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow)) {
+ aViewWindow->raise();
+ aViewWindow->setFocus();
+ return aView;
+ }
}
}
return NULL;
anApp = theModule->getApp();
else
anApp = dynamic_cast<SalomeApp_Application*>
- (SUIT_Session::session()->activeApplication());
+ (SUIT_Session::session()->activeApplication());
if (anApp)
if (SUIT_ViewManager* aViewManager = anApp->activeViewManager())
- if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView())
- return dynamic_cast<TViewWindow*>(aViewWindow);
+ if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView())
+ return dynamic_cast<TViewWindow*>(aViewWindow);
return NULL;
}
VISU_Actor*
PublishInView(VisuGUI* theModule,
Prs3d_i* thePrs,
- SVTK_ViewWindow* theViewWindow,
- const bool theIsHighlight = false);
+ SVTK_ViewWindow* theViewWindow,
+ const bool theIsHighlight = false);
//---------------------------------------------------------------
UpdateViewer(VisuGUI* theModule,
VISU::Prs3d_i* thePrs,
bool theDispOnly = false,
- const bool theIsHighlight = false);
+ const bool theIsHighlight = false);
//---------------------------------------------------------------
if (TViewWindow* aViewWindow = GetActiveViewWindow<TViewWindow>(theModule)) {
aViewWindow->unHighlightAll();
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<SALOME_Actor*>(anAct)) {
- anActor->VisibilityOff();
- }
- }
- aViewWindow->Repaint();
+ VTK::ActorCollectionCopy aCopy(aRen->GetActors());
+ vtkActorCollection *aCollection = aCopy.GetActors();
+ aCollection->InitTraversal();
+ while (vtkActor *anAct = aCollection->GetNextActor()) {
+ if (anAct->GetVisibility() > 0)
+ if (SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)) {
+ anActor->VisibilityOff();
+ }
+ }
+ aViewWindow->Repaint();
}
}
}
void
ErasePrs3d(VisuGUI* theModule,
VISU::Prs3d_i* thePrs,
- bool theDoRepaint = true);
+ bool theDoRepaint = true);
void
ErasePrs(VisuGUI* theModule,
- Base_i* theBase,
- bool theDoRepaintVW);
+ Base_i* theBase,
+ bool theDoRepaintVW);
}
#endif
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Alexey Petrov
# Module : VISU
VISU_I.hxx \
VISUConfig.hh \
VISU_Gen_i.hh \
+ VISU_Tools.h \
VISU_Result_i.hh \
VISU_MultiResult_i.hh \
VISU_PrsObject_i.hh \
VISU_DeformedShape_i.hh \
VISU_Plot3D_i.hh \
VISU_CutPlanes_i.hh \
+ VISU_CutLinesBase_i.hh \
VISU_CutLines_i.hh \
+ VISU_CutSegment_i.hh \
VISU_Prs3dUtils.hh \
VISU_Vectors_i.hh \
VISU_StreamLines_i.hh \
VISU_ViewManager_i.hh \
VISU_View_i.hh \
VISU_TimeAnimation.h \
+ VISU_Evolution.h \
VISU_DeformedShapeAndScalarMap_i.hh \
VISU_ColoredPrs3dCache_i.hh \
VISU_ColoredPrs3dHolder_i.hh \
VISU_Deformation_i.hh \
VISU_OptionalDeformation_i.hh \
SALOME_GenericObjPointer.hh \
- VISU_ClippingPlaneMgr.hxx
-
+ VISU_ClippingPlaneMgr.hxx \
+ VISU_TableDlg.h
libVISUEngineImpl_la_SOURCES = \
VISUConfig.cc \
+ VISU_Tools.cxx \
VISU_Result_i.cc \
VISU_ResultUtils.cc \
VISU_MultiResult_i.cc \
VISU_DeformedShape_i.cc \
VISU_Plot3D_i.cc \
VISU_CutPlanes_i.cc \
+ VISU_CutLinesBase_i.cc \
VISU_CutLines_i.cc \
+ VISU_CutSegment_i.cc \
VISU_Vectors_i.cc \
VISU_StreamLines_i.cc \
VISU_DeformedShapeAndScalarMap_i.cc \
VISU_Mesh_i.cc \
VISU_ViewManager_i.cc \
VISU_TimeAnimation.cxx \
+ VISU_Evolution.cxx \
VISU_View_i.cc \
VISU_Table_i.cc \
VISU_PointMap3d_i.cc \
VISU_Deformation_i.cc \
VISU_OptionalDeformation_i.cc \
SALOME_GenericObjPointer.cc \
- VISU_ClippingPlaneMgr.cxx
+ VISU_ClippingPlaneMgr.cxx \
+ VISU_TableDlg.cxx
+
+MOC_FILES = \
+ VISU_TimeAnimation_moc.cxx \
+ VISU_TableDlg_moc.cxx
-MOC_FILES = VISU_TimeAnimation_moc.cxx
nodist_libVISUEngineImpl_la_SOURCES= $(MOC_FILES)
# additionnal information to compil and link file
-I$(srcdir)/../CONVERTOR \
-I$(srcdir)/../PIPELINE \
-I$(srcdir)/../OBJECT \
- -I$(srcdir)/../GUITOOLS \
- -I$(top_builddir)/idl \
- -I$(top_builddir)/salome_adm/unix
+ -I$(top_builddir)/idl
libVISUEngineImpl_la_LDFLAGS= \
- $(PYTHON_LIBS) \
- $(QT_MT_LIBS) \
- $(QWT_LIBS) \
- @BOOST_LIBS@ \
$(KERNEL_LDFLAGS) \
$(GUI_LDFLAGS) \
$(MED_LDFLAGS) \
../../idl/libSalomeIDLVISU.la \
+ $(PYTHON_LIBS) \
+ $(BOOST_LIB_SIGNALS) \
+ $(BOOST_LIB_THREAD) \
+ $(BOOST_LIB_SYSTEM) \
+ $(BOOST_LIB_FILESYSTEM) \
$(VTK_LIBS)
libVISUEngineImpl_la_LIBADD= \
- -lboost_signals@BOOST_LIBSUFFIX@ \
- -lboost_thread@BOOST_LIBSUFFIX@ \
+ ../CONVERTOR/libVisuConvertor.la \
+ ../PIPELINE/libVisuPipeLine.la \
+ ../OBJECT/libVisuObject.la \
+ -lSalomeIDLKernel \
-lSalomeHDFPersist \
-lSalomeGenericObj \
-lSalomeContainer \
-lSalomeNS \
-lTOOLSDS \
-lOpUtil \
+ -lSalomeLifeCycleCORBA \
+ -lCAM \
-lVTKViewer \
-lSVTK \
-lEvent \
-lSalomeApp \
-lSalomeSession \
+ -lPlot2d \
-lSPlot2d \
- ../CONVERTOR/libVisuConvertor.la \
- ../PIPELINE/libVisuPipeLine.la \
- ../OBJECT/libVisuObject.la \
- ../GUITOOLS/libVISUGUITOOLS.la
+ -lqtx \
+ -lLightApp \
+ -lstd
if MED_ENABLE_MULTIPR
libVISUEngineImpl_la_CPPFLAGS+= $(MULTIPR_CPPFLAGS)
-lMEDWrapperBase \
-lMEDWrapper_V2_2 \
-lMEDWrapper_V2_1 \
- -lmed_V2_1 \
- -lmedmem
+ -lmedmem \
+ @CORBA_LIBS@
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_GenericObjPtr.cc
// Author : Oleg UVAROV
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_GenericObjPtr.hh
// Author : Oleg UVAROV
// Module : SALOME
}
void
- Destroy()
+ UnRegister()
{
if(this->myPointer){
- this->myPointer->Destroy();
+ this->myPointer->UnRegister();
this->myPointer = NULL;
}
}
//! Destroy smart pointer and remove the reference to its object.
~GenericObjPtr()
{
- this->Destroy();
+ this->UnRegister();
}
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISUConfig.cc
// Author : Alexey PETROV
return VISU::TPLOT3D;
if ( theComment == "CUTPLANES" )
return VISU::TCUTPLANES;
- if ( theComment == "CUTLINES" )
- return VISU::TCUTLINES;
+ if ( theComment == "CUTSEGMENT" )
+ return VISU::TCUTSEGMENT;
if ( theComment == "VECTORS" )
return VISU::TVECTORS;
if ( theComment == "STREAMLINES" )
return VISU::TTIMESTAMP;
if ( theComment == "ANIMATION" )
return VISU::TANIMATION;
+ if ( theComment == "EVOLUTION" )
+ return VISU::TEVOLUTION;
if ( theComment == "ALL" )
return VISU::TALL;
//---------------------------------------------------------------
QString
- GenerateName(const std::string& theFmt, int theId)
+ GenerateName(const std::string& theFmt, int /*theId*/) // theId was deprecated because of incorrect work IPAL21151
{
QString aName;
- if(theId > 0)
- aName.sprintf("%s:%d", theFmt.c_str(), theId);
- else
- aName.sprintf("%s", theFmt.c_str());
+ aName.sprintf("%s", theFmt.c_str());
+ int count = 0;
+
+ SalomeApp_Application* anApp =
+ dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ if ( anApp) {
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() );
+
+ if(aStudy){
+ while (1) {
+ std::vector<_PTR(SObject)> aList = aStudy->studyDS()->FindObjectByName(aName.toLatin1().data(), "VISU");
+ if ( aList.size() > 0 ) {
+ count++;
+ aName.sprintf("%s:%d", theFmt.c_str(), count);
+ } else
+ break;
+ }
+ }
+ }
+
+ if(count > 0)
+ aName.sprintf("%s:%d", theFmt.c_str(), count);
+
return aName;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISUConfig.hh
// Author : Alexey PETROV
#include CORBA_SERVER_HEADER(MED)
#include CORBA_SERVER_HEADER(SALOMEDS)
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
+#include CORBA_SERVER_HEADER(SALOME_Types)
#include "SALOME_NamingService.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VISU_ClippingPlaneMgr.hxx"
#include "VISU_ColoredPrs3dHolder_i.hh"
}
//*************************************************************
-void VISU_ClippingPlaneMgr::SetStudy(_PTR(Study) theStudy)
+void VISU_ClippingPlaneMgr::SetStudy(_PTR(Study) theStudy, bool reinitStudy)
{
- if (myStudy == theStudy) return;
+ if (myStudy == theStudy && !reinitStudy) return;
myStudy = theStudy;
myPlanes->RemoveAllItems();
if (!myStudy) return;
_PTR(GenericAttribute) anAttr;
if (aSObject->FindAttribute(anAttr, "AttributeSequenceOfReal")) {
- _PTR(AttributeSequenceOfReal) aArray(anAttr);
- aPlane->SetOrigin(aArray->Value(1), aArray->Value(2), aArray->Value(3));
- aPlane->SetNormal(aArray->Value(4), aArray->Value(5), aArray->Value(6));
+ _PTR(AttributeSequenceOfReal) aArray(anAttr);
+ aPlane->SetOrigin(aArray->Value(1), aArray->Value(2), aArray->Value(3));
+ aPlane->SetNormal(aArray->Value(4), aArray->Value(5), aArray->Value(6));
}
if (aSObject->FindAttribute(anAttr, "AttributeInteger")) {
- _PTR(AttributeInteger) aFlag(anAttr);
- aPlane->setAuto(aFlag->Value() == 1);
+ _PTR(AttributeInteger) aFlag(anAttr);
+ aPlane->setAuto(aFlag->Value() == 1);
} else
- aPlane->setAuto(false);
+ aPlane->setAuto(false);
applyPlaneToAll(aPlane);
- myPlanes->AddItem(aPlane);
+
+ myPlanes->AddItem(aPlane);
}
}
}
if(VISU::Base_i* aBase = dynamic_cast<VISU::Base_i*>(VISU::GetServant(anObject).in())) {
VISU::Prs3d_i* aPrs;
if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
- CORBA::Object_var anObject = aBase->_this();
- VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
- VISU::Prs3d_var aPrs3d = aHolder->GetDevice();
- aPrs = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aPrs3d).in());
+ CORBA::Object_var anObject = aBase->_this();
+ VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
+ VISU::Prs3d_var aPrs3d = aHolder->GetDevice();
+ aPrs = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aPrs3d).in());
} else {
- aPrs = dynamic_cast<VISU::Prs3d_i*>(aBase);
+ aPrs = dynamic_cast<VISU::Prs3d_i*>(aBase);
}
if (aPrs) {
- if (!ContainsPlane(aPrs, thePlane)) {
- if (thePlane->isAuto())
- aPrs->AddClippingPlane(thePlane);
- else {
- string aPrsEntry = aPrs->GetEntry();
- if (aPrsEntry.length() == 0) {
- VISU::ColoredPrs3d_i* aColPrs = dynamic_cast<VISU::ColoredPrs3d_i*>(aPrs);
- if (aColPrs)
- aPrsEntry = aColPrs->GetHolderEntry();
- }
-
- _PTR(SObject) aSObject = thePlane->getPlaneObject();
- _PTR(ChildIterator) aRefIter = myStudy->NewChildIterator(aSObject);
- for (; aRefIter->More(); aRefIter->Next()) {
- _PTR(SObject) aObj = aRefIter->Value();
- _PTR(SObject) aRefPrsObject;
- if (aObj->ReferencedObject(aRefPrsObject)) { // If it is referenced on current plane
- if (aRefPrsObject->GetID() == aPrsEntry) {
- aPrs->AddClippingPlane(thePlane);
- }
- }
- }
- }
- }
+ if (!ContainsPlane(aPrs, thePlane)) {
+ if (thePlane->isAuto())
+ aPrs->AddClippingPlane(thePlane);
+ else {
+ string aPrsEntry = aPrs->GetEntry();
+ if (aPrsEntry.length() == 0) {
+ VISU::ColoredPrs3d_i* aColPrs = dynamic_cast<VISU::ColoredPrs3d_i*>(aPrs);
+ if (aColPrs)
+ aPrsEntry = aColPrs->GetHolderEntry();
+ }
+
+ _PTR(SObject) aSObject = thePlane->getPlaneObject();
+ _PTR(ChildIterator) aRefIter = myStudy->NewChildIterator(aSObject);
+ for (; aRefIter->More(); aRefIter->Next()) {
+ _PTR(SObject) aObj = aRefIter->Value();
+ _PTR(SObject) aRefPrsObject;
+ if (aObj->ReferencedObject(aRefPrsObject)) { // If it is referenced on current plane
+ if (aRefPrsObject->GetID() == aPrsEntry) {
+ aPrs->AddClippingPlane(thePlane);
+ }
+ }
+ }
+ }
+ }
}
}
}
//*************************************************************
long VISU_ClippingPlaneMgr::CreateClippingPlane(double X,double Y, double Z,
- double dX, double dY, double dZ,
- bool isAuto, const char* name)
+ double dX, double dY, double dZ,
+ bool isAuto, const char* name)
{
_PTR(SObject) aObjPtr = CreateClippingPlaneObject(X, Y, Z, dX, dY, dZ, isAuto, name);
return myPlanes->GetNumberOfItems() - 1;
//*************************************************************
_PTR(SObject) VISU_ClippingPlaneMgr::CreateClippingPlaneObject(double X,double Y, double Z,
- double dX, double dY, double dZ,
- bool isAuto, const char* name)
+ double dX, double dY, double dZ,
+ bool isAuto, const char* name)
{
_PTR(SObject) aPlaneObj;
if(!myStudy->GetProperties()->IsLocked()) {
anAttr = aBuilder->FindOrCreateAttribute(aPlaneObj,"AttributeSequenceOfReal");
_PTR(AttributeSequenceOfReal) aArray(anAttr);
if (aArray->Length() == 6) {
- for (int i = 0; i < 6; i++)
- aArray->ChangeValue(i+1, aParams[i]);
+ for (int i = 0; i < 6; i++)
+ aArray->ChangeValue(i+1, aParams[i]);
} else {
- for (int i = 0; i < 6; i++)
- aArray->Add(aParams[i]);
+ for (int i = 0; i < 6; i++)
+ aArray->Add(aParams[i]);
}
// Save Bool Flag
anAttr = aBuilder->FindOrCreateAttribute(aPlaneObj,"AttributeInteger");
//*************************************************************
void VISU_ClippingPlaneMgr::EditClippingPlane(long id, double X,double Y, double Z,
- double dX, double dY, double dZ,
- bool isAuto, const char* name)
+ double dX, double dY, double dZ,
+ bool isAuto, const char* name)
{
VISU_CutPlaneFunction* aPlane = GetClippingPlane(id);
if (aPlane != NULL) {
if(!myStudy->GetProperties()->IsLocked()) {
_PTR(GenericAttribute) anAttr;
if (aSObj->FindAttribute(anAttr, "AttributeSequenceOfReal")) {
- _PTR(AttributeSequenceOfReal) aArray(anAttr);
- aArray->ChangeValue(1, X);
- aArray->ChangeValue(2, Y);
- aArray->ChangeValue(3, Z);
- aArray->ChangeValue(4, dX);
- aArray->ChangeValue(5, dY);
- aArray->ChangeValue(6, dZ);
+ _PTR(AttributeSequenceOfReal) aArray(anAttr);
+ aArray->ChangeValue(1, X);
+ aArray->ChangeValue(2, Y);
+ aArray->ChangeValue(3, Z);
+ aArray->ChangeValue(4, dX);
+ aArray->ChangeValue(5, dY);
+ aArray->ChangeValue(6, dZ);
}
if (aSObj->FindAttribute(anAttr, "AttributeInteger")) {
- _PTR(AttributeInteger) aFlag(anAttr);
- aFlag->SetValue(isAuto? 1 : 0);
+ _PTR(AttributeInteger) aFlag(anAttr);
+ aFlag->SetValue(isAuto? 1 : 0);
}
if (aSObj->FindAttribute(anAttr, "AttributeName")) {
- _PTR(AttributeName) aName(anAttr);
- aName->SetValue(name);
+ _PTR(AttributeName) aName(anAttr);
+ aName->SetValue(name);
}
// Remove references on presentations if it becomes Auto plane
_PTR(SObject) aPlaneSObj = aPlane->getPlaneObject();
if (aPlane->isAuto()) {
- _PTR(ChildIterator) aIter = myStudy->NewChildIterator(aPlaneSObj);
- _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
- for (; aIter->More(); aIter->Next()) {
- _PTR(SObject) aObj = aIter->Value();
- aBuilder->RemoveObject(aObj);
- }
+ _PTR(ChildIterator) aIter = myStudy->NewChildIterator(aPlaneSObj);
+ _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
+ for (; aIter->More(); aIter->Next()) {
+ _PTR(SObject) aObj = aIter->Value();
+ aBuilder->RemoveObject(aObj);
+ }
}
}
}
_PTR(SComponent) aVisuSO = myStudy->FindComponent("VISU");
_PTR(ChildIterator) aChildIter = myStudy->NewChildIterator(aVisuSO);
for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
- _PTR(SObject) aSObject = aChildIter->Value();
- CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
- if(VISU::Base_i* aBase = dynamic_cast<VISU::Base_i*>(VISU::GetServant(anObject).in())) {
- VISU::Prs3d_i* aPrs;
- if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
- CORBA::Object_var anObject = aBase->_this();
- VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
- VISU::Prs3d_var aPrs3d = aHolder->GetDevice();
- aPrs = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aPrs3d).in());
- } else
- aPrs = dynamic_cast<VISU::Prs3d_i*>(aBase);
-
- if (aPrs) {
- if (ContainsPlane(aPrs, aPlane)) {
- short aTag1 = aPlane->getPlaneObject()->Tag();
- for (int j = aPrs->GetNumberOfClippingPlanes()-1; j > -1; j--) {
- VISU_CutPlaneFunction* aPln = dynamic_cast<VISU_CutPlaneFunction*>
- (aPrs->GetClippingPlane(j));
- if (aPln) {
- short aTag2 = aPln->getPlaneObject()->Tag();
- if (aTag1 == aTag2) {
- aPrs->RemoveClippingPlane(j);
- break;
- }
- }
- }
- }
- }
- }
+ _PTR(SObject) aSObject = aChildIter->Value();
+ CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
+ if(VISU::Base_i* aBase = dynamic_cast<VISU::Base_i*>(VISU::GetServant(anObject).in())) {
+ VISU::Prs3d_i* aPrs;
+ if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
+ CORBA::Object_var anObject = aBase->_this();
+ VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
+ VISU::Prs3d_var aPrs3d = aHolder->GetDevice();
+ aPrs = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aPrs3d).in());
+ } else
+ aPrs = dynamic_cast<VISU::Prs3d_i*>(aBase);
+
+ if (aPrs) {
+ if (ContainsPlane(aPrs, aPlane)) {
+ short aTag1 = aPlane->getPlaneObject()->Tag();
+ for (int j = aPrs->GetNumberOfClippingPlanes()-1; j > -1; j--) {
+ VISU_CutPlaneFunction* aPln = dynamic_cast<VISU_CutPlaneFunction*>
+ (aPrs->GetClippingPlane(j));
+ if (aPln) {
+ short aTag2 = aPln->getPlaneObject()->Tag();
+ if (aTag1 == aTag2) {
+ aPrs->RemoveClippingPlane(j);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
}
_PTR(SObject) aSObj = aPlane->getPlaneObject();
if (aSObj) {
- _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
- aBuilder->RemoveObject(aSObj);
+ _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
+ aBuilder->RemoveObject(aSObj);
}
myPlanes->RemoveItem(id);
return true;
VISU_CutPlaneFunction* aPlane = dynamic_cast<VISU_CutPlaneFunction*>(thePrs->GetClippingPlane(i));
if (aPlane) {
if (aPlane->getPlaneObject()->GetID() == aEntry) {
- return true;
+ return true;
}
}
}
if (!aPlane->isAuto()) {
string aEntry = thePrs->GetEntry();
if (aEntry.length() == 0) {
- VISU::ColoredPrs3d_i* aColPrs = dynamic_cast<VISU::ColoredPrs3d_i*>(thePrs);
- if (aColPrs)
- aEntry = aColPrs->GetHolderEntry();
+ VISU::ColoredPrs3d_i* aColPrs = dynamic_cast<VISU::ColoredPrs3d_i*>(thePrs);
+ if (aColPrs)
+ aEntry = aColPrs->GetHolderEntry();
}
if(!myStudy->GetProperties()->IsLocked()) {
- _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
- _PTR(SObject) aPrsSObj = myStudy->FindObjectID(aEntry);
- _PTR(SObject) aSObject = aPlane->getPlaneObject();
- _PTR(SObject) aNewObj = aBuilder->NewObject(aSObject);
- aBuilder->Addreference(aNewObj, aPrsSObj);
+ _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
+ _PTR(SObject) aPrsSObj = myStudy->FindObjectID(aEntry);
+ _PTR(SObject) aSObject = aPlane->getPlaneObject();
+ _PTR(SObject) aNewObj = aBuilder->NewObject(aSObject);
+ aBuilder->Addreference(aNewObj, aPrsSObj);
}
}
return true;
bool isRemoved = false;
short aTag1 = aPlane->getPlaneObject()->Tag();
for (int j = thePrs->GetNumberOfClippingPlanes()-1; j > -1; j--) {
- VISU_CutPlaneFunction* aPln = dynamic_cast<VISU_CutPlaneFunction*>
- (thePrs->GetClippingPlane(j));
- if (aPln) {
- short aTag2 = aPln->getPlaneObject()->Tag();
- if (aTag1 == aTag2) {
- thePrs->RemoveClippingPlane(j);
- isRemoved = true;
- break;
- }
- }
+ VISU_CutPlaneFunction* aPln = dynamic_cast<VISU_CutPlaneFunction*>
+ (thePrs->GetClippingPlane(j));
+ if (aPln) {
+ short aTag2 = aPln->getPlaneObject()->Tag();
+ if (aTag1 == aTag2) {
+ thePrs->RemoveClippingPlane(j);
+ isRemoved = true;
+ break;
+ }
+ }
}
if(!myStudy->GetProperties()->IsLocked()) {
- _PTR(SObject) aSObject = aPlane->getPlaneObject();
- _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
-
- string aEntry = thePrs->GetEntry();
- if (aEntry.length() == 0) {
- VISU::ColoredPrs3d_i* aColPrs = dynamic_cast<VISU::ColoredPrs3d_i*>(thePrs);
- if (aColPrs)
- aEntry = aColPrs->GetHolderEntry();
- }
- _PTR(ChildIterator) aIter = myStudy->NewChildIterator(aSObject);
- for (; aIter->More(); aIter->Next()) {
- _PTR(SObject) aRefObj = aIter->Value();
- if(aRefObj) {
- _PTR(SObject) aRefPrsObject;
- if (aRefObj->ReferencedObject(aRefPrsObject)) {
- if (aRefPrsObject->GetID() == aEntry) {
- aBuilder->RemoveObject(aRefObj);
- break;
- }
- }
- }
- }
+ _PTR(SObject) aSObject = aPlane->getPlaneObject();
+ _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
+
+ string aEntry = thePrs->GetEntry();
+ if (aEntry.length() == 0) {
+ VISU::ColoredPrs3d_i* aColPrs = dynamic_cast<VISU::ColoredPrs3d_i*>(thePrs);
+ if (aColPrs)
+ aEntry = aColPrs->GetHolderEntry();
+ }
+ _PTR(ChildIterator) aIter = myStudy->NewChildIterator(aSObject);
+ for (; aIter->More(); aIter->Next()) {
+ _PTR(SObject) aRefObj = aIter->Value();
+ if(aRefObj) {
+ _PTR(SObject) aRefPrsObject;
+ if (aRefObj->ReferencedObject(aRefPrsObject)) {
+ if (aRefPrsObject->GetID() == aEntry) {
+ aBuilder->RemoveObject(aRefObj);
+ break;
+ }
+ }
+ }
+ }
}
return isRemoved;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ClippingPlaneMgr.hxx
// Author : VSV
VISU_ClippingPlaneMgr();
~VISU_ClippingPlaneMgr();
- void SetStudy(_PTR(Study) theStudy);
+ void SetStudy(_PTR(Study) theStudy, bool reinitStudy = false);
long CreateClippingPlane(double X,double Y, double Z,
- double dX, double dY, double dZ,
- bool isAuto, const char* name);
+ double dX, double dY, double dZ,
+ bool isAuto, const char* name);
void EditClippingPlane(long id, double X,double Y, double Z,
- double dX, double dY, double dZ,
- bool isAuto, const char* name);
+ double dX, double dY, double dZ,
+ bool isAuto, const char* name);
_PTR(SObject) CreateClippingPlaneObject(double X,double Y, double Z,
- double dX, double dY, double dZ,
- bool isAuto, const char* name);
+ double dX, double dY, double dZ,
+ bool isAuto, const char* name);
/* Returns clipping plane by its Id */
VISU_CutPlaneFunction* GetClippingPlane(long id);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ColoredPrs3dCache_i.cc
// Author : Oleg UVAROV
// Module : VISU
//
+#ifdef WNT
+#define NOGDI
+#endif
+
#include "VISU_ColoredPrs3dCache_i.hh"
#include "VISU_ColoredPrs3dHolder_i.hh"
#include "VISU_Actor.h"
#include "VISU_PipeLine.hxx"
+#include "VISU_Tools.h"
#include "SALOME_Event.h"
theRequiredMemory = int( aMemoryUsed + aMemoryNeeded ) + 1;
size_t aMb = 1024 * 1024;
- double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(8192*aMb)) / double(aMb);
+ double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(8192*(double)aMb)) / double(aMb);
anEnlargeType = aMemoryNeeded < aFreeMemory ?
VISU::ColoredPrs3dCache::ENLARGE : VISU::ColoredPrs3dCache::IMPOSSIBLE;
}
return;
size_t aMb = 1024 * 1024;
- double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(8192*aMb)) / double(aMb);
+ double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(8192*(double)aMb)) / double(aMb);
CORBA::Float aMemoryUsed = GetDeviceMemorySize();
CORBA::Float aMemoryNeeded = theMemorySize - aMemoryUsed;
if( aMemoryNeeded > aFreeMemory )
CORBA::String_var anIOR = GetID();
SALOMEDS::SObject_var aSObject = GetStudyDocument()->FindObjectIOR(anIOR.in());
VISU::RemoveFromStudy(aSObject, false, true);
- Destroy();
+ UnRegister();
}
std::string
TPrs3dPtr aPrs3d(thePrs3d);
myHolderMap[theHolderEntry].push_front(aPrs3d);
thePrs3d->SetHolderEntry( theHolderEntry );
- thePrs3d->Destroy();
+ thePrs3d->UnRegister();
}
return thePrs3d;
}
aPrs3d->SameAs(thePrs);
+ // rnv: fix for the 20870: EDF 1410 VISU: Anomaly in the Gauss point representation.
+ // special case for the "Gauss Points" presentation,
+ // update the LookupTable in the mapper, after assign properties of the presentation
+ // using SameAs(...) method.
+ VISU::GaussPoints_i* gPoints = dynamic_cast<VISU::GaussPoints_i*>( aPrs3d.get() );
+ if(gPoints) {
+ gPoints->UpdateMapperLookupTable();
+ }
+
// special case for deformed shape
VISU::DeformedShapeAndScalarMap_i* dShape =
dynamic_cast<VISU::DeformedShapeAndScalarMap_i*>( aPrs3d.get() );
ProcessVoidEvent(new TAddActorEvent(anActor,aViewWindow));
//aViewWindow->AddActor(anActor);
anActor->SetVisibility(true);
+ SetVisibilityState( aHolderEntry, Qtx::ShownState);
}
if(aPrs3d != aLastVisitedPrs3d)
aNewActor = aPrs3d->CreateActor();
ProcessVoidEvent(new TAddActorEvent(aNewActor,aViewWindow));
//aViewWindow->AddActor(aNewActor);
- }else
+ }else {
aNewActor->SetVisibility(true);
+ SetVisibilityState( aHolderEntry, Qtx::ShownState);
+ }
aNewActor->DeepCopy(anActor);
aPrs3d->SetActiveState(true);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ColoredPrs3dCache_i.hh
// Author : Oleg UVAROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ColoredPrs3dCache_i.cc
// Author : Oleg UVAROV
return VISU::CreatePrs3dByEnum<TCUTPLANES>(theStudy, thePublishInStudyMode);
case TCUTLINES:
return VISU::CreatePrs3dByEnum<TCUTLINES>(theStudy, thePublishInStudyMode);
+ case TCUTSEGMENT:
+ return VISU::CreatePrs3dByEnum<TCUTSEGMENT>(theStudy, thePublishInStudyMode);
case TVECTORS:
return VISU::CreatePrs3dByEnum<TVECTORS>(theStudy, thePublishInStudyMode);
}
case TCUTLINES:
aMemory = CheckIsPossible<TCUTLINES>(theInput, theMemoryCheck);
break;
+ case TCUTSEGMENT:
+ aMemory = CheckIsPossible<TCUTSEGMENT>(theInput, theMemoryCheck);
+ break;
case TVECTORS:
aMemory = CheckIsPossible<TVECTORS>(theInput, theMemoryCheck);
break;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ColoredPrs3dCache_i.hh
// Author : Oleg UVAROV
#include "VISU_StreamLines_i.hh"
#include "VISU_Vectors_i.hh"
#include "VISU_CutLines_i.hh"
+#include "VISU_CutSegment_i.hh"
#include "VISU_CutPlanes_i.hh"
#include "VISU_DeformedShape_i.hh"
#include "VISU_IsoSurfaces_i.hh"
TList<IsoSurfaces_i,
TList<CutPlanes_i,
TList<CutLines_i,
- TList<Vectors_i,
- TList<Plot3D_i,
- TNullType> > > > > > > > > > >
+ TList<CutSegment_i,
+ TList<Vectors_i,
+ TList<Plot3D_i,
+ TNullType> > > > > > > > > > > >
TColoredPrs3dTypeList;
TList<TInt2Type<TISOSURFACES>,
TList<TInt2Type<TCUTPLANES>,
TList<TInt2Type<TCUTLINES>,
- TList<TInt2Type<TVECTORS>,
- TList<TInt2Type<TPLOT3D>,
- TNullType> > > > > > > > > > >
+ TList<TInt2Type<TCUTSEGMENT>,
+ TList<TInt2Type<TVECTORS>,
+ TList<TInt2Type<TPLOT3D>,
+ TNullType> > > > > > > > > > > >
TColoredPrs3dEnumList;
SALOME::GenericObjPtr<TColoredPrs3d> aSameColoredPrs3d(new TColoredPrs3d(thePublishInStudyMode));
Copy(theColoredPrs3d, aSameColoredPrs3d);
if ( theCreateAsTemporalObject )
- aSameColoredPrs3d->Destroy();
+ aSameColoredPrs3d->UnRegister();
return aSameColoredPrs3d;
}
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ColoredPrs3dHolder_i.cc
// Author : Oleg UVAROV
CORBA::String_var anIOR = GetID();
SALOMEDS::SObject_var aSObject = GetStudyDocument()->FindObjectIOR(anIOR.in());
VISU::RemoveFromStudy(aSObject, false);
- Destroy();
+ UnRegister();
}
//----------------------------------------------------------------------------
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ColoredPrs3dHolder_i.hxx
// Author : Oleg UVAROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.cxx
// Author : Alexey PETROV
#include "SUIT_ResourceMgr.h"
#include "SALOME_Event.h"
-#include <strstream>
+#include <sstream>
#include <vtkMapper.h>
#include <vtkDataSet.h>
if(!theResult->IsMinMaxDone())
theResult->GetInput()->BuildMinMax();
if(theField->myIsELNO)
- return theField->GetMinMax(theCompID);
+ return theField->GetMinMax(theCompID, VISU::TNames());
else
- return theField->GetAverageMinMax(theCompID);
+ return theField->GetAverageMinMax(theCompID, VISU::TNames());
}
//---------------------------------------------------------------
//---------------------------------------------------------------
void
VISU::ColoredPrs3d_i
-::Destroy()
+::UnRegister()
{
- TSuperClass::Destroy();
+ TSuperClass::UnRegister();
}
//---------------------------------------------------------------
}
}
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::UpdateActor(VISU_ActorBase* theActor)
+{
+ bool isOnGroups = myGroupNames.size() > 0;
+ if ( isOnGroups )
+ {
+ QStringList aList;
+ TGroupNames::const_iterator anIter = myGroupNames.begin();
+ for ( ; anIter != myGroupNames.end(); anIter++ )
+ {
+ const std::string aGroupName = *anIter;
+ aList << QString( aGroupName.c_str() );
+ }
+ theActor->SetNameActorText( aList.join( "\n" ).toLatin1().constData() );
+ }
+ theActor->SetIsDisplayNameActor( isOnGroups );
+
+ TSuperClass::UpdateActor(theActor);
+}
+
//----------------------------------------------------------------------------
CORBA::Long
VISU::ColoredPrs3d_i
aValForTime = anIter->second;
if (aValForTime) {
- std::strstream aStream;
+ std::stringstream aStream;
const VISU::TTime& aTime = aValForTime->myTime;
aStream<<theTitle<<" ";
if(IsUnitsVisible()) {
//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::UpdateMapperLookupTable()
+{
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_ColoredPL>
+ (GetSpecificPL(), &VISU_ColoredPL::UpdateMapperLookupTable));
+}
+
+//----------------------------------------------------------------------------^
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ColoredPrs3d_i.hh
// Author : Alexey PETROV
virtual
void
- Destroy() = 0;
+ UnRegister() = 0;
};
typedef SALOME::GenericObjPtr<TMinMaxController> PMinMaxController;
virtual
void
- Destroy()
+ UnRegister()
{
vtkObjectBase::Delete();
}
virtual
void
- Destroy();
+ UnRegister();
virtual
void
void
SameAs(const Prs3d_i* theOrigin);
+ virtual
+ void
+ UpdateActor(VISU_ActorBase* theActor);
+
virtual
bool
IsBoldTitle();
SetValLblFontColor( const vtkFloatingPointType theR,
const vtkFloatingPointType theG,
const vtkFloatingPointType theB );
+
+ virtual
+ void
+ UpdateMapperLookupTable();
+
//----------------------------------------------------------------------------
protected:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_CorbaMedConvertor.cxx
// Author : Alexey PETROV
//---------------------------------------------------------------
int
GetEntity2Geom(const VISU::TEntity& theEntity,
- SALOME_MED::medGeometryElement*& theVector)
+ SALOME_MED::medGeometryElement*& theVector)
{
switch(theEntity){
case VISU::CELL_ENTITY:
//---------------------------------------------------------------
void
GetCellsSize(vtkIdType& theNbCells,
- vtkIdType& theCellsSize,
- SALOME_MED::MESH_ptr theMEDMesh,
- const VISU::TEntity& theVEntity)
+ vtkIdType& theCellsSize,
+ SALOME_MED::MESH_ptr theMEDMesh,
+ const VISU::TEntity& theVEntity)
{
theNbCells = theCellsSize = 0;
if(MYDEBUG) MESSAGE("GetCellsSize - theVEntity = "<<theVEntity);
for(int iGeom = 0; iGeom < iGeomEnd; iGeom++){
int iNumElemEnd = connInfo->numberOfElements[iGeom];
if(iNumElemEnd > 0){
- if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
- theCellsSize += iNumElemEnd + connInfo->nodalConnectivityLength[iGeom];
- theNbCells += iNumElemEnd;
+ if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
+ theCellsSize += iNumElemEnd + connInfo->nodalConnectivityLength[iGeom];
+ theNbCells += iNumElemEnd;
}
}
}
//---------------------------------------------------------------
void
GetCellsSize(vtkIdType& theNbCells,
- vtkIdType& theCellsSize,
- SALOME_MED::FAMILY_ptr theMEDFamily)
+ vtkIdType& theCellsSize,
+ SALOME_MED::FAMILY_ptr theMEDFamily)
{
theNbCells = theCellsSize = 0;
SALOME_MED::SUPPORT::supportInfos_var suppInfo=theMEDFamily->getSupportGlobal();
for(int iGeom = 0; iGeom < iGeomEnd; iGeom++) {
int iNumElemEnd = suppInfo->nbEltTypes[iGeom];
if(iNumElemEnd > 0){
- if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
- theNbCells += iNumElemEnd;
- theCellsSize += iNumElemEnd + suppInfo->nodalConnectivityLength[iGeom];
+ if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
+ theNbCells += iNumElemEnd;
+ theCellsSize += iNumElemEnd + suppInfo->nodalConnectivityLength[iGeom];
}
}
}
//---------------------------------------------------------------
void
GetCellsSize(VISU::PCMesh theMesh,
- SALOME_MED::MESH_ptr theMEDMesh,
- const VISU::TEntity& theEntity)
+ SALOME_MED::MESH_ptr theMEDMesh,
+ const VISU::TEntity& theEntity)
{
VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMap[theEntity];
//---------------------------------------------------------------
VISU::PCMeshOnEntity
InitMeshOnEntity(const VISU::PCMesh& theMesh,
- const VISU::TEntity& theEntity,
- const VISU::PCMeshOnEntity& theMeshOnEntity)
+ const VISU::TEntity& theEntity,
+ const VISU::PCMeshOnEntity& theMeshOnEntity)
{
VISU::PCMeshOnEntity aMeshOnEntity;
VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
VISU::PCSubProfile
CrSubProfile(const VISU::PCMesh theMesh,
- const VISU::PCField theField,
- const VISU::TCMeshOnEntity& theMeshOnEntity,
- SALOME_MED::medGeometryElement theMGeom,
- int theNbElems)
+ const VISU::PCField theField,
+ const VISU::TCMeshOnEntity& theMeshOnEntity,
+ SALOME_MED::medGeometryElement theMGeom,
+ int theNbElems)
{
if (MYDEBUG) MESSAGE("CrSubProfile");
VISU::EGeometry aEGeom = MEDGeom2VISU(theMGeom);
aSubProfile->myStatus = VISU::eRemoveAll;
else if(aTimeStampIter == aCellsFirstIndex.end() && theMGeom == SALOME_MED::MED_POINT1){
if(theNbElems > 0){
- aSubProfile->myName = "";
- aSubProfile->myStatus = VISU::eAddPart;
-
- aSubProfile->myNbCells = theNbElems;
- aSubProfile->myCellsSize = aSubProfile->myNbCells;
+ aSubProfile->myName = "";
+ aSubProfile->myStatus = VISU::eAddPart;
+
+ aSubProfile->myNbCells = theNbElems;
+ aSubProfile->myCellsSize = aSubProfile->myNbCells;
}
}else{
- if(theNbElems > 0){
- aSubProfile->myName = "";
- aSubProfile->myStatus = VISU::eAddPart;
-
- aSubProfile->myNbCells = theNbElems;
- aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
- }
+ if(theNbElems > 0){
+ aSubProfile->myName = "";
+ aSubProfile->myStatus = VISU::eAddPart;
+
+ aSubProfile->myNbCells = theNbElems;
+ aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
+ }
}
if (MYDEBUG) MESSAGE("CrSubProfile done");
VISU::TProfileKey
GetProfileKey(const VISU::PCMesh theMesh,
- const VISU::PCField theField,
- const VISU::PCValForTime theValForTime,
- const VISU::TCMeshOnEntity& theMeshOnEntity)
+ const VISU::PCField theField,
+ const VISU::PCValForTime theValForTime,
+ const VISU::TCMeshOnEntity& theMeshOnEntity)
{
if (MYDEBUG) MESSAGE("GetProfileKey");
if(anIter == aFirstIndex.end() && aSupport->getEntity() == SALOME_MED::MED_NODE){
SALOME_MED::medGeometryElement aMGeom = SALOME_MED::MED_POINT1;
try{
- aNbElems = aSupport->getNumberOfElements(SALOME_MED::MED_NONE);
- if(MYDEBUG)MESSAGE("aMGeom="<<aMGeom<<" aNbElems="<<aNbElems);
+ aNbElems = aSupport->getNumberOfElements(SALOME_MED::MED_NONE);
+ if(MYDEBUG)MESSAGE("aMGeom="<<aMGeom<<" aNbElems="<<aNbElems);
}catch(...){
- MESSAGE("Error in theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);");
+ MESSAGE("Error in theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);");
}
-
+
VISU::PCSubProfile aSubProfile = CrSubProfile(theMesh,
- theField,
- theMeshOnEntity,
- aMGeom,
- aNbElems);
+ theField,
+ theMeshOnEntity,
+ aMGeom,
+ aNbElems);
aProfileKey.insert(aSubProfile);
}
for(; anIter != aFirstIndex.end(); anIter++){
SALOME_MED::medGeometryElement aMGeom = anIter->first;
try{
- aNbElems = aSupport->getNumberOfElements(aMGeom);
- if(MYDEBUG)MESSAGE("aMGeom="<<aMGeom<<" aNbElems="<<aNbElems);
- } catch(...){
- MESSAGE("Error in theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);");
- continue;
+ aNbElems = aSupport->getNumberOfElements(aMGeom);
+ if(MYDEBUG)MESSAGE("aMGeom="<<aMGeom<<" aNbElems="<<aNbElems);
+ } catch(...){
+ MESSAGE("Error in theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);");
+ continue;
}
VISU::PCSubProfile aSubProfile = CrSubProfile(theMesh,
- theField,
- theMeshOnEntity,
- aMGeom,
- aNbElems);
+ theField,
+ theMeshOnEntity,
+ aMGeom,
+ aNbElems);
aProfileKey.insert(aSubProfile);
}
void
InitProfile(VISU::PCMesh theMesh,
- VISU::PCField theField,
- VISU::PCValForTime theValForTime,
- VISU::TCMeshOnEntity& theMeshOnEntity)
+ VISU::PCField theField,
+ VISU::PCValForTime theValForTime,
+ VISU::TCMeshOnEntity& theMeshOnEntity)
{
if (MYDEBUG) MESSAGE("InitProfile");
VISU::TProfileMap& aProfileMap = theMeshOnEntity.myProfileMap;
VISU::TProfileKey aProfileKey = GetProfileKey(theMesh,
- theField,
- theValForTime,
- theMeshOnEntity);
+ theField,
+ theValForTime,
+ theMeshOnEntity);
VISU::TProfileMap::const_iterator anIter = aProfileMap.find(aProfileKey);
if(anIter != aProfileMap.end()){
VISU::TProfileKey::const_iterator anIter = aProfileKey.begin();
for(; anIter != aProfileKey.end(); anIter++){
- VISU::PCSubProfile aSubProfile(*anIter);
-
- if(aProfile->myIsAll && aSubProfile->myStatus != VISU::eAddAll)
- aProfile->myIsAll = false;
-
- VISU::EGeometry aEGeom = aSubProfile->myGeom;
- aGeom2SubProfile[aEGeom] = aSubProfile;
+ VISU::PCSubProfile aSubProfile(*anIter);
+
+ if(aProfile->myIsAll && aSubProfile->myStatus != VISU::eAddAll)
+ aProfile->myIsAll = false;
+
+ VISU::EGeometry aEGeom = aSubProfile->myGeom;
+ aGeom2SubProfile[aEGeom] = aSubProfile;
}
aProfileMap[aProfileKey] = aProfile;
void
LoadProfile(VISU::PCMesh theMesh,
- VISU::PCField theField,
- VISU::PCValForTime theValForTime,
- VISU::PCMeshOnEntity theMeshOnEntity)
+ VISU::PCField theField,
+ VISU::PCValForTime theValForTime,
+ VISU::PCMeshOnEntity theMeshOnEntity)
{
VISU::PCProfile aProfile = theValForTime->myProfile;
if (MYDEBUG) MESSAGE("LoadProfile aProfile->myIsDone="<<aProfile->myIsDone);
VISU::EGeometry aEGeom = aGeom2SubProfileIter->first;
SALOME_MED::medGeometryElement aMGeom = VISUGeomToMED(aEGeom);
VISU::PCSubProfile aSubProfile = aGeom2SubProfileIter->second;
- SALOME_MED::long_array_var aGeom2ProfileIds;
+ SALOME_TYPES::ListOfLong_var aGeom2ProfileIds;
std::vector<int> aGeom2Profile;
if(!aSupport->isOnAllElements()){
- try{
- if(aMGeom == SALOME_MED::MED_POINT1)
- aGeom2ProfileIds = aSupport->getNumberFromFile(SALOME_MED::MED_NONE);
- else
- aGeom2ProfileIds = aSupport->getNumberFromFile(aMGeom);
- int aLen = aGeom2ProfileIds->length();
- if(MYDEBUG) MESSAGE_BEGIN(" - aMGeom="<<aMGeom<<"; aNbCells="<<aLen);
- for(int i = 0; i < aLen; i++){
- int anId = aGeom2ProfileIds[i];
- aGeom2Profile.push_back(anId);
- if(MYDEBUG) MESSAGE_ADD(std::endl << "------------------------------->" << anId);
- }
- if(MYDEBUG) MESSAGE_END(" ");
- } catch(...) {
- continue;
- }
+ try{
+ if(aMGeom == SALOME_MED::MED_POINT1)
+ aGeom2ProfileIds = aSupport->getNumberFromFile(SALOME_MED::MED_NONE);
+ else
+ aGeom2ProfileIds = aSupport->getNumberFromFile(aMGeom);
+ int aLen = aGeom2ProfileIds->length();
+ if(MYDEBUG) MESSAGE_BEGIN(" - aMGeom="<<aMGeom<<"; aNbCells="<<aLen);
+ for(int i = 0; i < aLen; i++){
+ int anId = aGeom2ProfileIds[i];
+ aGeom2Profile.push_back(anId);
+ if(MYDEBUG) MESSAGE_ADD(std::endl << "------------------------------->" << anId);
+ }
+ if(MYDEBUG) MESSAGE_END(" ");
+ } catch(...) {
+ continue;
+ }
} else {
- SALOME_MED::medEntityMesh aMEntity = aSupport->getEntity();
- int aNbElems = theMesh->myMesh->getNumberOfElements(aMEntity,aMGeom);
- for(int i = 0; i < aNbElems; i++)
- aGeom2Profile.push_back(i+1);
+ SALOME_MED::medEntityMesh aMEntity = aSupport->getEntity();
+ int aNbElems = theMesh->myMesh->getNumberOfElements(aMEntity,aMGeom);
+ for(int i = 0; i < aNbElems; i++)
+ aGeom2Profile.push_back(i+1);
}
if(aGeom2Profile.size()>0){
- VISU::TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
- int aSize = aGeom2Profile.size();
- aSubMeshID.resize(aSize);
- for(int anId = 0; anId < aSize; anId++){
- aSubMeshID[anId] = aGeom2Profile[anId] - 1;
- }
+ VISU::TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
+ int aSize = aGeom2Profile.size();
+ aSubMeshID.resize(aSize);
+ for(int anId = 0; anId < aSize; anId++){
+ aSubMeshID[anId] = aGeom2Profile[anId] - 1;
+ }
}
}
SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
- SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh();
+ SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh()->convertInMESH();
if(aMEDMesh->_is_nil())
throw std::runtime_error("VISU_MEDFieldConvertor::Build >> aMEDMesh->_is_nil() !!!");
if(MYDEBUG)
MESSAGE("VISU_MEDFieldConvertor::Build - aFieldName = '"<<aFieldName<<
- "'; myId = "<<anId<<"; myTime = "<<aDT);
+ "'; myId = "<<anId<<"; myTime = "<<aDT);
return this;
}
{
SALOMEDS::GenericAttribute_var anAttr;
if(theSObj->FindAttribute(anAttr,"AttributeName")){
- SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
- CORBA::String_var aValue = aName->Value();
- theIsSuccess = (myName == aValue.in());
- if(theIsSuccess)
- return TRet(SALOMEDS::SObject::_duplicate(theSObj));
+ SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
+ CORBA::String_var aValue = aName->Value();
+ theIsSuccess = (myName == aValue.in());
+ if(theIsSuccess)
+ return TRet(SALOMEDS::SObject::_duplicate(theSObj));
}
return TRet();
}
{
CORBA::Object_var anObj = VISU::SObjectToObject(theSObj);
if(!CORBA::is_nil(anObj)){
- SALOME_MED::MESH_var aMesh = SALOME_MED::MESH::_narrow(anObj);
- if(!CORBA::is_nil(aMesh)){
- CORBA::String_var aName = aMesh->getName();
- theIsSuccess = (myName == aName.in());
- if(theIsSuccess)
- return TRet(aMesh,SALOMEDS::SObject::_duplicate(theSObj));
- }
+ SALOME_MED::MESH_var aMesh = SALOME_MED::MESH::_narrow(anObj);
+ if(!CORBA::is_nil(aMesh)){
+ CORBA::String_var aName = aMesh->getName();
+ theIsSuccess = (myName == aName.in());
+ if(theIsSuccess)
+ return TRet(aMesh,SALOMEDS::SObject::_duplicate(theSObj));
+ }
}
return TRet();
}
SALOMEDS::SObject_var aSObj = anIter->Value();
typename TFun::TRet aRet = theFun(aSObj,theIsSuccess);
if(theIsSuccess)
- return aRet;
+ return aRet;
}
return typename TFun::TRet();
}
return NULL;
CORBA::Long aNbMeshes = theMED->getNumberOfMeshes();
- SALOME_MED::string_array_var aMeshNames = theMED->getMeshNames();
+ SALOME_TYPES::ListOfString_var aMeshNames = theMED->getMeshNames();
if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aNbMeshes = "<<aNbMeshes);
SALOMEDS::Study_var aStudy = mySObject->GetStudy();
anIsSuccess = false;
CORBA::String_var aMeshName = aMeshNames[iMesh];
TMeshByName::TRet aMeshByNameRet =
- Find(aMeshesSObj,aStudy,TMeshByName(aMeshName.in()),anIsSuccess);
+ Find(aMeshesSObj,aStudy,TMeshByName(aMeshName.in()),anIsSuccess);
if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - Find aMeshName('"<<aMeshName.in()<<"') = "<<anIsSuccess);
+ MESSAGE("VISU_MEDConvertor::Build - Find aMeshName('"<<aMeshName.in()<<"') = "<<anIsSuccess);
if(!anIsSuccess)
- continue;
+ continue;
VISU::PCMesh aMesh = myMeshMap[aMeshName.in()](new VISU::TCMesh());
SALOME_MED::MESH_var aMEDMesh = boost::get<0>(aMeshByNameRet);
aMesh->myMesh = aMEDMesh;
if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - aMeshName = "<<aMeshName<<"; myDim = "<<aMesh->myDim);
+ MESSAGE("VISU_MEDConvertor::Build - aMeshName = "<<aMeshName<<"; myDim = "<<aMesh->myDim);
std::string aName = aMeshName.in();
std::replace(aName.begin(),aName.end(),' ','_');
aStream<<"MEDSUPPORTS_OF_"<<aName;
std::string aSupportsName(aStream.str());
TSObjectByName::TRet aSObjectByNameRet =
- Find(aMeshesSObj,aStudy,TSObjectByName(aSupportsName.c_str()),anIsSuccess);
+ Find(aMeshesSObj,aStudy,TSObjectByName(aSupportsName.c_str()),anIsSuccess);
if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - Find aSupportsName('"<<aSupportsName<<"') = "<<anIsSuccess);
+ MESSAGE("VISU_MEDConvertor::Build - Find aSupportsName('"<<aSupportsName<<"') = "<<anIsSuccess);
if(!anIsSuccess)
- continue;
+ continue;
VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
SALOMEDS::SObject_var aSupportsSObj = boost::get<0>(aSObjectByNameRet);
// Fill all MeshOnEntity
aSupportIterator->InitEx(true);
for(; aSupportIterator->More(); aSupportIterator->Next()){
- SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
-
- CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
- if(CORBA::is_nil(aMedSupport))
- continue;
-
- SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport);
- if(aMEDSupport->_is_nil())
- continue;
-
- SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
- SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
- VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
- CORBA::String_var aSupportName = aMEDSupport->getName();
-
- if(aMEDSupport->isOnAllElements() && strcmp(aSupportName.in(),"SupportOnAll_MED_") > 0){
- if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - Support isOnAllElements = '"<<aSupportName<<
- "' aVEntity = "<<aVEntity);
- vtkIdType aNbCells, aCellsSize;
- //Check, if there is any data on the support?
- if(aVEntity == VISU::NODE_ENTITY){
- aMesh->myNbPoints = aMeshOnSupport->getNumberOfNodes();
- aNbCells = aMesh->myNbPoints;
- aCellsSize = 2*aMesh->myNbPoints;
- }else
- ::GetCellsSize(aNbCells,aCellsSize,aMeshOnSupport,aVEntity);
-
- if(aNbCells > 0){
- if(aMeshOnEntityMap.find(aVEntity) == aMeshOnEntityMap.end()){
- VISU::PCMeshOnEntity aMeshOnEntity(new VISU::TCMeshOnEntity());
- aMeshOnEntity->myMeshName = aMeshName.in();
- aMeshOnEntity->myEntity = aVEntity;
- aMeshOnEntity->myNbCells = aNbCells;
- aMeshOnEntity->myCellsSize = aCellsSize;
- aMeshOnEntity->mySupport = aMEDSupport;
- aMeshOnEntityMap[aVEntity] = aMeshOnEntity;
- }
- }
- }
+ SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
+
+ CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
+ if(CORBA::is_nil(aMedSupport))
+ continue;
+
+ SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport);
+ if(aMEDSupport->_is_nil())
+ continue;
+
+ SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh()->convertInMESH();
+ SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
+ VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
+ CORBA::String_var aSupportName = aMEDSupport->getName();
+
+ if(aMEDSupport->isOnAllElements() && strcmp(aSupportName.in(),"SupportOnAll_MED_") > 0){
+ if(MYDEBUG)
+ MESSAGE("VISU_MEDConvertor::Build - Support isOnAllElements = '"<<aSupportName<<
+ "' aVEntity = "<<aVEntity);
+ vtkIdType aNbCells, aCellsSize;
+ //Check, if there is any data on the support?
+ if(aVEntity == VISU::NODE_ENTITY){
+ aMesh->myNbPoints = aMeshOnSupport->getNumberOfNodes();
+ aNbCells = aMesh->myNbPoints;
+ aCellsSize = 2*aMesh->myNbPoints;
+ }else
+ ::GetCellsSize(aNbCells,aCellsSize,aMeshOnSupport,aVEntity);
+
+ if(aNbCells > 0){
+ if(aMeshOnEntityMap.find(aVEntity) == aMeshOnEntityMap.end()){
+ VISU::PCMeshOnEntity aMeshOnEntity(new VISU::TCMeshOnEntity());
+ aMeshOnEntity->myMeshName = aMeshName.in();
+ aMeshOnEntity->myEntity = aVEntity;
+ aMeshOnEntity->myNbCells = aNbCells;
+ aMeshOnEntity->myCellsSize = aCellsSize;
+ aMeshOnEntity->mySupport = aMEDSupport;
+ aMeshOnEntityMap[aVEntity] = aMeshOnEntity;
+ }
+ }
+ }
}
// Fill all Family
aSupportIterator->InitEx(true);
for(; aSupportIterator->More(); aSupportIterator->Next()){
- SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
-
- CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
- if(CORBA::is_nil(aMedSupport))
- continue;
-
- SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport);
- if(aMEDSupport->_is_nil())
- continue;
-
- SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
- SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
- VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
- CORBA::String_var aSupportName = aMEDSupport->getName();
-
- SALOME_MED::FAMILY_var aMEDFamily = SALOME_MED::FAMILY::_narrow(aMedSupport);
- if(!aMEDFamily->_is_nil()) {
- VISU::TMeshOnEntityMap::iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(aVEntity);
- if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
- continue;
- VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
-
- vtkIdType aNbCells = aMeshOnEntity->myNbCells, aCellsSize = aMeshOnEntity->myCellsSize;
- CORBA::Boolean anIsOnAllElements = aMEDSupport->isOnAllElements();
- if(!anIsOnAllElements)
- ::GetCellsSize(aNbCells,aCellsSize,aMEDFamily);
-
- if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build "<<
- "- aFamily = '"<<aSupportName<<"'"<<
- "; anIsOnAllElements = "<<anIsOnAllElements<<
- "; aVEntity = "<<aVEntity<<
- "; aNbCells = "<<aNbCells);
-
- if(aNbCells > 0){
- VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
- VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.find(aSupportName.in());
- if(aFamilyMapIter == aFamilyMap.end()){
- VISU::PCFamily aFamily(new VISU::TCFamily());
- aFamily->myEntity = aVEntity;
- aFamily->myNbCells = aNbCells;
- aFamily->myCellsSize = aCellsSize;
- aFamily->myId = aMEDFamily->getIdentifier();
- aFamily->myName = aSupportName.in();
- aFamily->myFamily = aMEDFamily;
- aFamilyMap[aSupportName.in()] = aFamily;
- }
- }
- }
+ SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
+
+ CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
+ if(CORBA::is_nil(aMedSupport))
+ continue;
+
+ SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport);
+ if(aMEDSupport->_is_nil())
+ continue;
+
+ SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh()->convertInMESH();
+ SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
+ VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
+ CORBA::String_var aSupportName = aMEDSupport->getName();
+
+ SALOME_MED::FAMILY_var aMEDFamily = SALOME_MED::FAMILY::_narrow(aMedSupport);
+ if(!aMEDFamily->_is_nil()) {
+ VISU::TMeshOnEntityMap::iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(aVEntity);
+ if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
+ continue;
+ VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
+
+ vtkIdType aNbCells = aMeshOnEntity->myNbCells, aCellsSize = aMeshOnEntity->myCellsSize;
+ CORBA::Boolean anIsOnAllElements = aMEDSupport->isOnAllElements();
+ if(!anIsOnAllElements)
+ ::GetCellsSize(aNbCells,aCellsSize,aMEDFamily);
+
+ if(MYDEBUG)
+ MESSAGE("VISU_MEDConvertor::Build "<<
+ "- aFamily = '"<<aSupportName<<"'"<<
+ "; anIsOnAllElements = "<<anIsOnAllElements<<
+ "; aVEntity = "<<aVEntity<<
+ "; aNbCells = "<<aNbCells);
+
+ if(aNbCells > 0){
+ VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+ VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.find(aSupportName.in());
+ if(aFamilyMapIter == aFamilyMap.end()){
+ VISU::PCFamily aFamily(new VISU::TCFamily());
+ aFamily->myEntity = aVEntity;
+ aFamily->myNbCells = aNbCells;
+ aFamily->myCellsSize = aCellsSize;
+ aFamily->myId = aMEDFamily->getIdentifier();
+ aFamily->myName = aSupportName.in();
+ aFamily->myFamily = aMEDFamily;
+ aFamilyMap[aSupportName.in()] = aFamily;
+ }
+ }
+ }
}
-
+
// Fill all Groups
aSupportIterator->InitEx(true);
for(; aSupportIterator->More(); aSupportIterator->Next()){
- SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
-
- CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
- if(CORBA::is_nil(aMedSupport))
- continue;
-
- SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport);
- if(aMEDSupport->_is_nil())
- continue;
-
- SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
- SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
- VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
- CORBA::String_var aSupportName = aMEDSupport->getName();
-
- SALOME_MED::GROUP_var aMEDGroup = SALOME_MED::GROUP::_narrow(aMedSupport);
- if(!aMEDGroup->_is_nil()){
- CORBA::Boolean anIsOnAllElements = aMEDSupport->isOnAllElements();
-
- if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build "<<
- "- aGroup = '"<<aSupportName<<"'"<<
- "; anIsOnAllElements = "<<anIsOnAllElements<<
- "; aVEntity = "<<aVEntity);
-
- VISU::PCGroup aGroup(new VISU::TCGroup());
- aGroup->myGroup = aMEDGroup;
- VISU::TFamilySet& aFamilySet = aGroup->myFamilySet;
-
- SALOME_MED::Family_array_var aFamilies = aMEDGroup->getFamilies();
- int iFamilyEnd = aFamilies->length();
- for(int iFamaily = 0; iFamaily < iFamilyEnd; iFamaily++){
- SALOME_MED::FAMILY_var aMEDFamily = aFamilies[iFamaily];
- CORBA::String_var aFamilyName = aMEDFamily->getName();
- TFindFamilyOnEntity aFindFamilyOnEntity =
- FindFamilyOnEntity(aMeshName.in(), aVEntity, aFamilyName.in());
- VISU::PCFamily aFamily = boost::get<2>(aFindFamilyOnEntity);
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"' = "<<bool(aFamily));
- if(aFamily){
- aFamilySet.insert(aFamily);
- }
- }
-
- if(!aFamilySet.empty()){
- VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
- aGroupMap[aSupportName.in()] = aGroup;
- }
-
- }
+ SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
+
+ CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
+ if(CORBA::is_nil(aMedSupport))
+ continue;
+
+ SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport);
+ if(aMEDSupport->_is_nil())
+ continue;
+
+ SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh()->convertInMESH();
+ SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
+ VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
+ CORBA::String_var aSupportName = aMEDSupport->getName();
+
+ SALOME_MED::GROUP_var aMEDGroup = SALOME_MED::GROUP::_narrow(aMedSupport);
+ if(!aMEDGroup->_is_nil()){
+ CORBA::Boolean anIsOnAllElements = aMEDSupport->isOnAllElements();
+
+ if(MYDEBUG)
+ MESSAGE("VISU_MEDConvertor::Build "<<
+ "- aGroup = '"<<aSupportName<<"'"<<
+ "; anIsOnAllElements = "<<anIsOnAllElements<<
+ "; aVEntity = "<<aVEntity);
+
+ VISU::PCGroup aGroup(new VISU::TCGroup());
+ aGroup->myGroup = aMEDGroup;
+ VISU::TFamilySet& aFamilySet = aGroup->myFamilySet;
+
+ SALOME_MED::Family_array_var aFamilies = aMEDGroup->getFamilies();
+ int iFamilyEnd = aFamilies->length();
+ for(int iFamaily = 0; iFamaily < iFamilyEnd; iFamaily++){
+ SALOME_MED::FAMILY_var aMEDFamily = aFamilies[iFamaily];
+ CORBA::String_var aFamilyName = aMEDFamily->getName();
+ TFindFamilyOnEntity aFindFamilyOnEntity =
+ FindFamilyOnEntity(aMeshName.in(), aVEntity, aFamilyName.in());
+ VISU::PCFamily aFamily = boost::get<2>(aFindFamilyOnEntity);
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"' = "<<bool(aFamily));
+ if(aFamily){
+ aFamilySet.insert(VISU::TEnity2Family(aVEntity, aFamily));
+ }
+ }
+
+ if(!aFamilySet.empty()){
+ VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
+ aGroupMap[aSupportName.in()] = aGroup;
+ }
+
+ }
}
}
}
if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aFieldName = '"<<GetSObjectName(aFieldSObj)<<"'");
SALOMEDS::ChildIterator_var aTimeStampIterator = aStudy->NewChildIterator(aFieldSObj);
for(; aTimeStampIterator->More(); aTimeStampIterator->Next()){
- SALOMEDS::SObject_var aTimeStampSObj = aTimeStampIterator->Value();
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aTimeStampSObj = '"<<GetSObjectName(aTimeStampSObj)<<"'");
- CORBA::Object_var aMedField = VISU::SObjectToObject(aTimeStampSObj);
- if(CORBA::is_nil(aMedField))
- continue;
-
- SALOME_MED::FIELD_var aMEDField = SALOME_MED::FIELD::_narrow(aMedField);
- if(aMEDField->_is_nil())
- continue;
-
- SALOME_MED::SUPPORT_var aMEDSupport = aMEDField->getSupport();
- if(aMEDSupport->_is_nil())
- continue;
-
- SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
- VISU::TEntity anEntity = MEDEntityToVTK(aMEntity);
- SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh();
- if(aMEDMesh->_is_nil())
- continue;
-
- CORBA::String_var aMeshName = aMEDMesh->getName();
- CORBA::String_var aFieldName = aMEDField->getName();
-
- VISU::TMeshMap::iterator aMeshMapIter = myMeshMap.find(aMeshName.in());
- if(aMeshMapIter == myMeshMap.end())
- continue;
-
- VISU::PCMesh aMesh = aMeshMapIter->second;
- VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
- VISU::TMeshOnEntityMap::iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
- if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
- continue;
-
- VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
- VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- VISU::TFieldMap::iterator aFieldMapIter = aFieldMap.find(aFieldName.in());
- VISU::PCField aField;
- if(aFieldMapIter == aFieldMap.end()){
- aField = aFieldMap[aFieldName.in()](new VISU::TCField());
- aField->myId = iField;
- aField->myName = aFieldName.in();
- aField->myEntity = anEntity;
- aField->myMeshName = aMeshName.in();
- aField->myDataSize = aMeshOnEntity->myNbCells * aField->myNbComp;
-
- vtkIdType aDataType = VTK_DOUBLE;
- SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField);
- if(aFieldDouble->_is_nil()) {
+ SALOMEDS::SObject_var aTimeStampSObj = aTimeStampIterator->Value();
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aTimeStampSObj = '"<<GetSObjectName(aTimeStampSObj)<<"'");
+ CORBA::Object_var aMedField = VISU::SObjectToObject(aTimeStampSObj);
+ if(CORBA::is_nil(aMedField))
+ continue;
+
+ SALOME_MED::FIELD_var aMEDField = SALOME_MED::FIELD::_narrow(aMedField);
+ if(aMEDField->_is_nil())
+ continue;
+
+ SALOME_MED::SUPPORT_var aMEDSupport = aMEDField->getSupport();
+ if(aMEDSupport->_is_nil())
+ continue;
+
+ SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
+ VISU::TEntity anEntity = MEDEntityToVTK(aMEntity);
+ SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh()->convertInMESH();
+ if(aMEDMesh->_is_nil())
+ continue;
+
+ CORBA::String_var aMeshName = aMEDMesh->getName();
+ CORBA::String_var aFieldName = aMEDField->getName();
+
+ VISU::TMeshMap::iterator aMeshMapIter = myMeshMap.find(aMeshName.in());
+ if(aMeshMapIter == myMeshMap.end())
+ continue;
+
+ VISU::PCMesh aMesh = aMeshMapIter->second;
+ VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+ VISU::TMeshOnEntityMap::iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
+ if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
+ continue;
+
+ VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
+ VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ VISU::TFieldMap::iterator aFieldMapIter = aFieldMap.find(aFieldName.in());
+ VISU::PCField aField;
+ if(aFieldMapIter == aFieldMap.end()){
+ aField = aFieldMap[aFieldName.in()](new VISU::TCField());
+ aField->myId = iField;
+ aField->myName = aFieldName.in();
+ aField->myEntity = anEntity;
+ aField->myMeshName = aMeshName.in();
+ aField->myDataSize = aMeshOnEntity->myNbCells * aField->myNbComp;
+
+ vtkIdType aDataType = VTK_DOUBLE;
+ SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField);
+ if(aFieldDouble->_is_nil()) {
// PAL18313: Mandriva 64 porting: CRASH at creating presentation on "Import Structure".
if (sizeof(long) == 4 ) // Size of CORBA::Long is always 4 (see CORBA_basetypes.h)
aDataType = VTK_LONG;
continue;
}
}
- aField->Init(aMEDField->getNumberOfComponents(), aDataType);
-
- if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<<aMeshOnEntity->myNbCells);
- }else
- aField = aFieldMapIter->second;
-
- VISU::TValField& aValField = aField->myValField;
- int anId = aMEDField->getIterationNumber();
- VISU::PCValForTime aValForTime = aValField[anId](new VISU::TCValForTime());
- aValForTime->myId = anId;
- CORBA::Double aDT = aMEDField->getTime();
- aValForTime->myTime = VISU::TTime(aDT,"");
- aValForTime->myField = aMEDField;
- if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<<aMeshName<<
- "'; myEntity = "<<anEntity<<"; myTime = "<<aDT);
+ aField->Init(aMEDField->getNumberOfComponents(), aDataType);
+
+ if(MYDEBUG)
+ MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<<aMeshOnEntity->myNbCells);
+ }else
+ aField = aFieldMapIter->second;
+
+ VISU::TValField& aValField = aField->myValField;
+ int anId = aMEDField->getIterationNumber();
+ VISU::PCValForTime aValForTime = aValField[anId](new VISU::TCValForTime());
+ aValForTime->myId = anId;
+ CORBA::Double aDT = aMEDField->getTime();
+ aValForTime->myTime = VISU::TTime(aDT,"");
+ aValForTime->myField = aMEDField;
+ if(MYDEBUG)
+ MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<<aMeshName<<
+ "'; myEntity = "<<anEntity<<"; myTime = "<<aDT);
}
}
}
SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
- SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh();
+ SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh()->convertInMESH();
if(aMEDMesh->_is_nil()) continue;
CORBA::String_var aMeshName = aMEDMesh->getName();
CORBA::String_var aFieldName = aMEDField->getName();
myMeshMap[aMeshName.in()] = aMesh;
if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build "<<
- "- aMeshName = '"<<aMeshName<<"'"<<
- "; aDim = "<<aMesh->myDim);
+ MESSAGE("VISU_MEDConvertor::Build "<<
+ "- aMeshName = '"<<aMeshName<<"'"<<
+ "; aDim = "<<aMesh->myDim);
}else
aMesh = aMeshMapIter->second;
aFieldMap[aFieldName.in()] = aField;
if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<<aMeshOnEntity->myNbCells);
+ MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<<aMeshOnEntity->myNbCells);
}else
aField = aFieldMapIter->second;
aValForTime->myField = aMEDField;
if(MYDEBUG)
MESSAGE("VISU_MEDConvertor::Build "<<
- "- aMeshName = '"<<aMeshName<<"'"<<
- "; myEntity = "<<aVEntity<<
- "; myTime = "<<aDT<<
- "; anId = "<<anId);
+ "- aMeshName = '"<<aMeshName<<"'"<<
+ "; myEntity = "<<aVEntity<<
+ "; myTime = "<<aDT<<
+ "; anId = "<<anId);
}
return this;
}
int
VISU_MEDConvertor
::LoadMeshOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity)
+ VISU::PMeshOnEntityImpl theMeshOnEntity)
{
int anIsUpdated = LoadPoints(theMesh);
const VISU::TEntity& aVEntity = theMeshOnEntity->myEntity;
int
VISU_MEDConvertor
::LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFamilyImpl theFamily)
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFamilyImpl theFamily)
{
int anIsUpdated = LoadPoints(theMesh);
const VISU::TEntity& anEntity = theMeshOnEntity->myEntity;
int
VISU_MEDConvertor
::LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilySet& theFamilySet)
+ const VISU::TFamilySet& theFamilySet)
{
//Main part of code
int anIsUpdated = LoadPoints(theMesh);
VISU::TFamilySet::const_iterator aFamilyIter = theFamilySet.begin();
for(; aFamilyIter != theFamilySet.end(); aFamilyIter++){
- VISU::PCFamily aFamily = *aFamilyIter;
+ VISU::PCFamily aFamily = (*aFamilyIter).second;
const VISU::TEntity& aVEntity = aFamily->myEntity;
VISU::PCMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity];
if(aVEntity == VISU::NODE_ENTITY){
int
VISU_MEDConvertor
::LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime)
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime)
{
//Main part of code
int anIsUpdated = LoadPoints(theMesh);
if(aNbElem <= 0)
throw std::runtime_error("LoadPoints >> There is no points in the mesh !!!");
- SALOME_MED::double_array_var aCCoord = aMedMesh->getCoordinates(SALOME_MED::MED_FULL_INTERLACE);
+ SALOME_TYPES::ListOfDouble_var aCCoord = aMedMesh->getCoordinates(SALOME_MED::MED_FULL_INTERLACE);
VISU::TCMEDCoordHolder* aCoordHolder = new VISU::TCMEDCoordHolder();
aCoordHolder->Init(aNbElem, aDim, aCCoord);
int
VISU_MEDConvertor
::LoadPointsOnFamily(VISU::PCMesh theMesh,
- VISU::PCFamily theFamily)
+ VISU::PCFamily theFamily)
{
VISU::PCMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[VISU::NODE_ENTITY];
if(!anIsOnAllElements){
SALOME_MED::medGeometryElement_array_var aGeom = aMedFamily->getTypes();
- SALOME_MED::long_array_var aCellNumForType = aMedFamily->getNumber(aGeom[0]);
+ SALOME_TYPES::ListOfLong_var aCellNumForType = aMedFamily->getNumber(aGeom[0]);
int aSize = aNbElem;
aNbElem = aCellNumForType->length();
for(int iElem = 0; iElem < aNbElem; iElem++){
int anID = aCellNumForType[iElem] - 1;
if(0 > anID || anID >= aSize){
- static QString aString;
- aString.sprintf("LoadPointsOnFamily - aSize(%d) <= aCellNumForType[%d] = %d < 0",aSize,iElem,anID);
- throw std::runtime_error((const char*)aString.toLatin1());
+ static QString aString;
+ aString.sprintf("LoadPointsOnFamily - aSize(%d) <= aCellNumForType[%d] = %d < 0",aSize,iElem,anID);
+ throw std::runtime_error((const char*)aString.toLatin1());
}
aSubMeshID.push_back(anID);
}
SALOME_MED::medEntityMesh theEntity)
{
{
- SALOME::SenderInt_var aSender =
- theMesh->getSenderForPolygonsConnectivity(SALOME_MED::MED_NODAL, theEntity);
- long int aSize;
- int* aValuePtr = ReceiverFactory::getValue(aSender.in(), aSize);
- myConn.assign(aValuePtr, aValuePtr + aSize);
+ SALOME::SenderInt_var aSender =
+ theMesh->getSenderForConnectivity(SALOME_MED::MED_NODAL, theEntity, SALOME_MED::MED_POLYGON);
+ long int aSize;
+ int* aValuePtr = ReceiverFactory::getValue(aSender.in(), aSize);
+ myConn.assign(aValuePtr, aValuePtr + aSize);
}
{
- SALOME::SenderInt_var aSender =
- theMesh->getSenderForPolygonsConnectivityIndex(SALOME_MED::MED_NODAL, theEntity);
- long int aSize;
- int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
- myConnIndex.assign(aValuePtr, aValuePtr + aSize);
+ SALOME::SenderInt_var aSender =
+ theMesh->getSenderForConnectivityIndex(SALOME_MED::MED_NODAL, theEntity, SALOME_MED::MED_POLYGON);
+ long int aSize;
+ int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
+ myConnIndex.assign(aValuePtr, aValuePtr + aSize);
+
+ // since the connectivity indices for polygones are stored together with other elements
+ // we should cut the indices by a value of the first one
+ if( aSize > 0 )
+ {
+ int anOffset = myConnIndex.front() - 1;
+ for( int anIndex = 0; anIndex < aSize; anIndex++ )
+ myConnIndex[ anIndex ] -= anOffset;
+ }
}
}
TIntArray myFaceIndex;
public:
- MEDPolyhedraConnectivity(SALOME_MED::MESH_var theMesh)
+ MEDPolyhedraConnectivity(SALOME_MED::MESH_var theMesh,
+ SALOME_MED::medEntityMesh theEntity)
{
{
- SALOME::SenderInt_var aSender =
- theMesh->getSenderForPolyhedronConnectivity(SALOME_MED::MED_NODAL);
- long int aSize;
- int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
- myConn.assign(aValuePtr, aValuePtr + aSize);
- }
- {
- SALOME::SenderInt_var aSender =
- theMesh->getSenderForPolyhedronIndex(SALOME_MED::MED_NODAL);
- long int aSize;
- int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
- myConnIndex.assign(aValuePtr, aValuePtr + aSize);
- }
- {
- SALOME::SenderInt_var aSender =
- theMesh->getSenderForPolyhedronFacesIndex();
- long int aSize;
- int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
- myFaceIndex.assign(aValuePtr, aValuePtr + aSize);
+ SALOME::SenderInt_var aSender =
+ theMesh->getSenderForConnectivity(SALOME_MED::MED_NODAL, theEntity, SALOME_MED::MED_POLYHEDRA);
+ long int aSize;
+ int* pt = ReceiverFactory::getValue(aSender, aSize);
+ //
+ SALOME::SenderInt_var aSender2 =
+ theMesh->getSenderForConnectivityIndex(SALOME_MED::MED_NODAL, theEntity, SALOME_MED::MED_POLYHEDRA);
+ long int aSizeI;
+ int* ptI = ReceiverFactory::getValue(aSender, aSize);
+ //
+ int nbOfPolyHCells=aSizeI-1;
+ std::vector<int> polh1v(aSizeI);
+ polh1v[0]=1;
+ std::vector<int> polh2v,polh3v;
+ for(int i=0;i<nbOfPolyHCells;i++)
+ {
+ int nbOfFaces=std::count(pt+ptI[i]-1,pt+ptI[i+1]-1,-1)+1;
+ polh1v[i+1]=polh1v[i]+nbOfFaces;
+ int *work=pt+ptI[i]-1;
+ for(int j=0;j<nbOfFaces;j++)
+ {
+ int *work2=std::find(work,pt+ptI[i+1]-1,-1);
+ int connLgthOfFace=std::distance(work,work2);
+ polh2v.push_back(connLgthOfFace);
+ polh3v.insert(polh3v.end(),work,work2);
+ work=work2+1;
+ }
+ }
+ //
+ myConn.assign(polh3v.begin(),polh3v.end());
+ myFaceIndex.assign(polh2v.begin(),polh2v.end());
+ myConnIndex.assign(polh1v.begin(),polh1v.end());
}
}
int
GetUniqueConn(int theId,
- TConnSet& theConnSet) const
+ TConnSet& theConnSet) const
{
theConnSet.clear();
int aStartFaceId = myConnIndex[theId] - 1;
TConnSet aConnSet;
int aCellSize = 0;
for(int anElemId = 0; anElemId < GetNbElem(); anElemId++)
- aCellSize += GetUniqueConn(anElemId, aConnSet);
+ aCellSize += GetUniqueConn(anElemId, aConnSet);
return aCellSize;
}
};
int
VISU_MEDConvertor
::LoadCellsOnEntity(VISU::PCMesh theMesh,
- VISU::PCMeshOnEntity theMeshOnEntity)
+ VISU::PCMeshOnEntity theMeshOnEntity)
{
if(theMeshOnEntity->myIsDone)
return 0;
SALOME_MED::SUPPORT_var& aMedSupport = theMeshOnEntity->mySupport;
- SALOME_MED::MESH_var aMedMesh = aMedSupport->getMesh();
+ SALOME_MED::MESH_var aMedMesh = aMedSupport->getMesh()->convertInMESH();
//Main part of code
const VISU::TEntity& aVEntity = theMeshOnEntity->myEntity;
break;
case SALOME_MED::MED_POLYHEDRA:
{
- MEDPolyhedraConnectivity aConn( aMedMesh );
+ MEDPolyhedraConnectivity aConn( aMedMesh, aMEntity );
int aNbElem = aConn.GetNbElem();
if (aNbElem > 0) {
VISU::PSubMeshImpl aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TCSubMesh());
int aVNbNodes = VISUGeom2NbNodes(aEGeom);
int aNbElem = anInfo->numberOfElements[iGeom];
if (aNbElem > 0) {
- SALOME_MED::long_array_var aConn =
- aMedMesh->getConnectivity(SALOME_MED::MED_FULL_INTERLACE,
- SALOME_MED::MED_NODAL,
- aMEntity,
- aMGeom);
+ SALOME_TYPES::ListOfLong_var aConn =
+ aMedMesh->getConnectivity(SALOME_MED::MED_NODAL,
+ aMEntity,
+ aMGeom);
VISU::PSubMeshImpl aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TCSubMesh());
aSubMesh->myNbCells = aNbElem;
aConnect[k] = aConn[kj+k] - 1;
switch(aMGeom){
-#if !(defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+#if !(defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
case SALOME_MED::MED_SEG3:
anArray[0] = aConnect[0];
anArray[2] = aConnect[1];
anArray[1] = aConnect[2];
break;
#endif
-#if !(defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+#if !(defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
case SALOME_MED::MED_TRIA6:
anArray[0] = aConnect[0];
anArray[2] = aConnect[1];
anArray[5] = aConnect[5];
break;
#endif
-#if !(defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+#if !(defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
case SALOME_MED::MED_QUAD8:
anArray[0] = aConnect[0];
anArray[2] = aConnect[1];
anArray[7] = aConnect[7];
break;
#endif
-#if (defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+#if (defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
case SALOME_MED::MED_TETRA10 :
#endif
case SALOME_MED::MED_TETRA4 :
anArray[2] = aConnect[3];
anArray[3] = aConnect[2];
break;
-#if (defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+#if (defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
case SALOME_MED::MED_PYRA13:
#endif
case SALOME_MED::MED_PYRA5 :
int
VISU_MEDConvertor
::LoadCellsOnFamily(VISU::PCMesh theMesh,
- VISU::PCMeshOnEntity theMeshOnEntity,
- VISU::PCFamily theFamily)
+ VISU::PCMeshOnEntity theMeshOnEntity,
+ VISU::PCFamily theFamily)
{
if(theFamily->myIsDone)
return 0;
if(MYDEBUG) MESSAGE("LoadCellsOnFamily - iGeomEnd = "<<iGeomEnd);
for(int iGeom = 0; iGeom < iGeomEnd; iGeom++){
SALOME_MED::medGeometryElement aMGeom = aGeoms[iGeom];
- SALOME_MED::long_array_var aCellNumForType = aMedFamily->getNumber(aMGeom);
+ SALOME_TYPES::ListOfLong_var aCellNumForType = aMedFamily->getNumber(aMGeom);
VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
int aNbElem = aCellNumForType->length();
VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[aEGeom];
if(MYDEBUG)
- MESSAGE("LoadCellsOnFamily "<<
- "- aMGeom = "<<aMGeom<<
- "; aNbElem = "<<aNbElem<<
- "; aSize = "<<aSize<<
- "; aCounter = "<<aCounter);
+ MESSAGE("LoadCellsOnFamily "<<
+ "- aMGeom = "<<aMGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; aSize = "<<aSize<<
+ "; aCounter = "<<aCounter);
for(int iElem = 0; iElem < aNbElem; iElem++){
- int anID = aCellNumForType[iElem] - aCounter - 1;
- if(0 > anID || anID >= aSize){
- static QString aString;
- aString.sprintf("LoadCellsOnFamily - aNbElem(%d) <= aCellNumForType[%d] = %d < 0 !!!",aNbElem,iElem,anID);
- throw std::runtime_error((const char*)aString.toLatin1());
- }
- aSubMeshID.push_back(anID);
+ int anID = aCellNumForType[iElem] - aCounter - 1;
+ if(0 > anID || anID >= aSize){
+ static QString aString;
+ aString.sprintf("LoadCellsOnFamily - aNbElem(%d) <= aCellNumForType[%d] = %d < 0 !!!",aNbElem,iElem,anID);
+ throw std::runtime_error((const char*)aString.toLatin1());
+ }
+ aSubMeshID.push_back(anID);
}
}
}else{
VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[aEGeom];
int iNumElemEnd = aCell2Connect.size();
for(int iNumElem = 0; iNumElem < iNumElemEnd; iNumElem++)
- aSubMeshID.push_back(iNumElem);
+ aSubMeshID.push_back(iNumElem);
}
}
template<class TValueType,
- class TContainerType>
+ class TContainerType>
void
ImportField(TContainerType& theContainer,
- VISU::PCMesh theMesh,
- VISU::PCField theField,
- VISU::PCValForTime theValForTime,
- VISU::PCMeshOnEntity theMeshOnEntity)
+ VISU::PCMesh theMesh,
+ VISU::PCField theField,
+ VISU::PCValForTime theValForTime,
+ VISU::PCMeshOnEntity theMeshOnEntity)
{
typedef VISU::TTCMEDMeshValue<TValueType, TContainerType> TVMeshValue;
vtkIdType aNbComp = theField->myNbComp;
const VISU::TCellsFirstIndex& aCellsFirstIndex = theMeshOnEntity->myCellsFirstIndex;
VISU::TCellsFirstIndex::const_iterator aCellsFirstIndexIter = aCellsFirstIndex.find(aMGeom);
if(aCellsFirstIndexIter != aCellsFirstIndex.end()){
- const VISU::TIndexAndSize& aIndexAndSize = aCellsFirstIndexIter->second;
- if(MYDEBUG)
- MESSAGE("ImportField - aMGeom = "<<aMGeom<<
- "; aIndexAndSize = {"<<aIndexAndSize.first<<
- ","<<aIndexAndSize.second<<"}");
-
- vtkIdType aNbElem = aIndexAndSize.second;
- vtkIdType aStart = aIndexAndSize.first * aNbComp;
- VISU::PMeshValue& aVMeshValue = theValForTime->GetMeshValue(aEGeom);
- TVMeshValue* aMeshValue = new TVMeshValue();
- aMeshValue->Init(aNbElem, aNbGauss, aNbComp, theContainer, aStart);
- aVMeshValue.reset(aMeshValue);
+ const VISU::TIndexAndSize& aIndexAndSize = aCellsFirstIndexIter->second;
+ if(MYDEBUG)
+ MESSAGE("ImportField - aMGeom = "<<aMGeom<<
+ "; aIndexAndSize = {"<<aIndexAndSize.first<<
+ ","<<aIndexAndSize.second<<"}");
+
+ vtkIdType aNbElem = aIndexAndSize.second;
+ vtkIdType aStart = aIndexAndSize.first * aNbComp;
+ VISU::PMeshValue& aVMeshValue = theValForTime->GetMeshValue(aEGeom);
+ TVMeshValue* aMeshValue = new TVMeshValue();
+ aMeshValue->Init(aNbElem, aNbGauss, aNbComp, theContainer, aStart);
+ aVMeshValue.reset(aMeshValue);
}
}
}
int
VISU_MEDConvertor
::LoadField(VISU::PCMesh theMesh,
- VISU::PCMeshOnEntity theMeshOnEntity,
- VISU::PField theField,
- VISU::PCValForTime theValForTime)
+ VISU::PCMeshOnEntity theMeshOnEntity,
+ VISU::PField theField,
+ VISU::PCValForTime theValForTime)
{
MESSAGE("VISU_MEDConvertor::LoadField");
//Check on loading already done
SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField);
if(!aFieldDouble->_is_nil()){
- SALOME_MED::double_array_var anArray = aFieldDouble->getValue(SALOME_MED::MED_FULL_INTERLACE);
+ SALOME_TYPES::ListOfDouble_var anArray = aFieldDouble->getValue(SALOME_MED::MED_FULL_INTERLACE);
if(MYDEBUG) MESSAGE("VISU_MEDConvertor::LoadField - There is FIELDDOUBLE = "<<anArray->length());
ImportField<CORBA::Double>(anArray,
- theMesh,
- theField,
- theValForTime,
- theMeshOnEntity);
+ theMesh,
+ theField,
+ theValForTime,
+ theMeshOnEntity);
}
SALOME_MED::FIELDINT_ptr aFieldInt = SALOME_MED::FIELDINT::_narrow(aMEDField);
if(!aFieldInt->_is_nil()){
- SALOME_MED::long_array_var anArray = aFieldInt->getValue(SALOME_MED::MED_FULL_INTERLACE);
+ SALOME_TYPES::ListOfLong_var anArray = aFieldInt->getValue(SALOME_MED::MED_FULL_INTERLACE);
if(MYDEBUG) MESSAGE("VISU_MEDConvertor::LoadField - There is FIELDINT = "<<anArray->length());
ImportField<CORBA::Long>(anArray,
- theMesh,
- theField,
- theValForTime,
- theMeshOnEntity);
+ theMesh,
+ theField,
+ theValForTime,
+ theMeshOnEntity);
}
anUnstructuredGridIDMapper->myIsVTKDone = true;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_CorbaMedConvertor.hxx
// Author : Alexey PETROV
#include "VISU_PointCoords.hxx"
#include "VISU_MeshValue.hxx"
-#include <string>
+#include <string>
namespace VISU
{
typedef std::map<SALOME_MED::medGeometryElement, TIndexAndSize> TCellsFirstIndex; // key: SALOME_MED::medGeometryElement
//---------------------------------------------------------------
- struct TCMEDCoordHolder: TCoordHolder<SALOME_MED::double_array_var>
+ struct TCMEDCoordHolder: TCoordHolder<SALOME_TYPES::ListOfDouble_var>
{
virtual
const TCoord*
//! To initilize the class instance
void
Init(vtkIdType theNbElem,
- vtkIdType theNbGauss,
- vtkIdType theNbComp,
- const TContainerType& theContainer,
- vtkIdType theStartIndex)
+ vtkIdType theNbGauss,
+ vtkIdType theNbComp,
+ const TContainerType& theContainer,
+ vtkIdType theStartIndex)
{
TSuperClass::Init(theNbElem, theNbGauss, theNbComp, theContainer);
myStartIndex = theStartIndex;
virtual
int
LoadMeshOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity);
+ VISU::PMeshOnEntityImpl theMeshOnEntity);
virtual
int
LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFamilyImpl theFamily);
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFamilyImpl theFamily);
virtual
int
LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilySet& theFamilySet);
+ const VISU::TFamilySet& theFamilySet);
virtual
int
LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime);
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime);
virtual
int
LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime)
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime)
{
return 0;
}
int
LoadPointsOnFamily(VISU::PCMesh theMesh,
- VISU::PCFamily theFamily) ;
+ VISU::PCFamily theFamily) ;
int
LoadCellsOnEntity(VISU::PCMesh theMesh,
- VISU::PCMeshOnEntity theMeshOnEntity);
+ VISU::PCMeshOnEntity theMeshOnEntity);
int
LoadCellsOnFamily(VISU::PCMesh theMesh,
- VISU::PCMeshOnEntity theMeshOnEntity,
- VISU::PCFamily theFamily);
+ VISU::PCMeshOnEntity theMeshOnEntity,
+ VISU::PCFamily theFamily);
int
LoadField(VISU::PCMesh theMesh,
- VISU::PCMeshOnEntity theMeshOnEntity,
- VISU::PField theField,
- VISU::PCValForTime theValForTime);
+ VISU::PCMeshOnEntity theMeshOnEntity,
+ VISU::PField theField,
+ VISU::PCValForTime theValForTime);
};
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VISU_CutLinesBase_i.cc
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#include "VISU_CutLinesBase_i.hh"
+#include "VISU_Prs3dUtils.hh"
+#include "VISU_Result_i.hh"
+
+#include "VISU_Actor.h"
+#include "VISU_ScalarMapAct.h"
+#include "VISU_CutLinesBasePL.hxx"
+#include "VISU_Convertor.hxx"
+#include "VISU_PipeLineUtils.hxx"
+
+#include "SUIT_ResourceMgr.h"
+
+#include <vtkAppendPolyData.h>
+
+static vtkFloatingPointType EPS_machine = 1.0E-7;
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+using namespace std;
+
+//---------------------------------------------------------------
+VISU::CutLinesBase_i::
+CutLinesBase_i(EPublishInStudyMode thePublishInStudyMode) :
+ ColoredPrs3d_i(thePublishInStudyMode),
+ ScalarMap_i(thePublishInStudyMode),
+ myUseAbsLength( false ),
+ myCutLinesBasePL(NULL)
+{}
+
+
+//---------------------------------------------------------------
+void
+VISU::CutLinesBase_i
+::SameAs(const Prs3d_i* theOrigin)
+{
+ TSuperClass::SameAs(theOrigin);
+
+ if(const CutLinesBase_i* aPrs3d = dynamic_cast<const CutLinesBase_i*>(theOrigin)){
+ CutLinesBase_i* anOrigin = const_cast<CutLinesBase_i*>(aPrs3d);
+ myUseAbsLength = anOrigin->IsUseAbsoluteLength();
+ CopyCurvesInverted(anOrigin->GetCurvesInverted());
+ }
+}
+
+
+//---------------------------------------------------------------
+/*! Copy map to /a myMapCurvesInverted.
+ * \param theCurves - map
+ */
+void
+VISU::CutLinesBase_i
+::CopyCurvesInverted(const TCurvesInv& theCurves)
+{
+ myMapCurvesInverted = theCurves;
+}
+
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::CutLinesBase_i
+::Create(const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber)
+{
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ SetUseAbsoluteLength( aResourceMgr->booleanValue( "VISU", "use_absolute_length", false ) );
+ SetAllCurvesInverted( aResourceMgr->booleanValue( "VISU", "invert_all_curves", false ) );
+ return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
+}
+
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::CutLinesBase_i
+::Restore(SALOMEDS::SObject_ptr theSObject,
+ const Storable::TRestoringMap& theMap)
+{
+ if(!TSuperClass::Restore(theSObject, theMap))
+ return NULL;
+
+ SetNbLines(VISU::Storable::FindValue(theMap,"myNbLines").toInt());
+
+ SetUseAbsoluteLength(VISU::Storable::FindValue(theMap,"myUseAbsLength").toInt());
+
+ // Restoring the map - \a myMapCurvesInverted
+ QStringList aMapCurvesInverted = VISU::Storable::FindValue(theMap,"myMapCurvesInverted").split("|",QString::SkipEmptyParts );
+ if (aMapCurvesInverted.count() == GetNbLines()){
+ for(int i = 0, iEnd = GetNbLines(); i < iEnd ; i++){
+ if(aMapCurvesInverted[i].toInt())
+ SetCurveInverted(i,true);
+ else
+ SetCurveInverted(i,false);
+ }
+ } else {
+ for(int i = 0, iEnd = GetNbLines(); i < iEnd ; i++)
+ SetCurveInverted(i,false);
+ }
+
+ return this;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::CutLinesBase_i
+::ToStream(std::ostringstream& theStr)
+{
+ TSuperClass::ToStream(theStr);
+
+ Storable::DataToStream( theStr, "myNbLines", GetNbLines() );
+
+ Storable::DataToStream( theStr, "myUseAbsLength", IsUseAbsoluteLength());
+
+ // Storing the map - \a myMapCurvesInverted
+ QString aStrCurvesInverted;
+ for(int i = 0, iEnd = GetNbLines(); i < iEnd; i++)
+ aStrCurvesInverted.append(QString::number(IsCurveInverted(i)) + "|");
+ Storable::DataToStream( theStr, "myMapCurvesInverted", (const char*)aStrCurvesInverted.toLatin1());
+}
+
+
+//---------------------------------------------------------------
+VISU::CutLinesBase_i
+::~CutLinesBase_i()
+{
+ if(MYDEBUG) MESSAGE("CutLinesBase_i::~CutLinesBase_i()");
+}
+
+
+//----------------------------------------------------------------------------^
+VISU_Actor*
+VISU::CutLinesBase_i
+::CreateActor()
+{
+ VISU_Actor* anActor = TSuperClass::CreateActor();
+ if(VISU_ScalarMapAct* aScalarMapAct = dynamic_cast<VISU_ScalarMapAct*>(anActor)) {
+ //rnv: To fix the bug IPAL22007 Cut Lines in VTK viewer are shown with square points on ends
+ //rnv: set small size of the vertices for the "Cut Lines" and "Cut Segment" presentations.
+ aScalarMapAct->Set0DElemSize(1.0);
+ }
+ return anActor;
+}
+
+
+
+//---------------------------------------------------------------
+void
+VISU::CutLinesBase_i
+::SetNbLines(CORBA::Long theNb)
+{
+ VISU::TSetModified aModified(this);
+
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutLinesBasePL, int>
+ (GetSpecificPL(), &VISU_CutLinesBasePL::SetNbParts, theNb));
+}
+
+//---------------------------------------------------------------
+CORBA::Long
+VISU::CutLinesBase_i
+::GetNbLines()
+{
+ return myCutLinesBasePL->GetNbParts();
+}
+
+//---------------------------------------------------------------
+/*! Invert all curves of corresponding table
+ * see void VISU::CutLinesBase_i::SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert)
+ * \param theInvert - Invert all curves, if value is TRUE, else not.
+ */
+void
+VISU::CutLinesBase_i
+::SetAllCurvesInverted(CORBA::Boolean theInvert)
+{
+ for(int i=0; i < GetNbLines(); i++)
+ SetCurveInverted(i, theInvert);
+}
+
+//---------------------------------------------------------------
+/*! Checks the orientation of all curves
+ * \retval TRUE - if all curves are inverted, else FALSE
+ */
+CORBA::Boolean
+VISU::CutLinesBase_i
+::IsAllCurvesInverted()
+{
+ for (int i=0; i<GetNbLines(); i++)
+ if (!IsCurveInverted(i)) return false;
+ return true;
+}
+
+//---------------------------------------------------------------
+/*! Sets orientation of curve
+ * \param theCurveNumber - integer value, number of cut line.
+ * \param theInvert - boolean value, TRUE or false.
+ */
+void
+VISU::CutLinesBase_i
+::SetCurveInverted(CORBA::Long theCurveNumber, CORBA::Boolean theInvert)
+{
+ if(myMapCurvesInverted[theCurveNumber] == theInvert)
+ return;
+
+ VISU::TSetModified aModified(this);
+
+ myMapCurvesInverted[theCurveNumber] = theInvert;
+ myParamsTime.Modified();
+}
+
+//---------------------------------------------------------------
+/*! Checks orientation of curve.
+ * \param theCurveNumber - integer value, number of cut line.
+ * \retval TRUE - if line in the table is inverted, else FALSE.
+ */
+CORBA::Boolean
+VISU::CutLinesBase_i
+::IsCurveInverted(CORBA::Long theCurveNumber)
+{
+ return myMapCurvesInverted[theCurveNumber];
+}
+
+//---------------------------------------------------------------
+/*! It control the way the length of cutlines is shown: using aboslute or relative values
+* \param theAbsLength - boolean value, TRUE or false.
+*/
+void
+VISU::CutLinesBase_i
+::SetUseAbsoluteLength(CORBA::Boolean theAbsLength)
+{
+ if ( myUseAbsLength == theAbsLength )
+ return;
+
+ VISU::TSetModified aModified(this);
+
+ myUseAbsLength = theAbsLength;
+ myParamsTime.Modified();
+}
+
+//---------------------------------------------------------------
+CORBA::Boolean
+VISU::CutLinesBase_i
+::IsUseAbsoluteLength()
+{
+ return myUseAbsLength;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::CutLinesBase_i
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
+{
+ // temporarily commented (see note 0006576 of the external issue 0020468)
+ //myCutLinesBasePL = dynamic_cast<VISU_CutLinesBasePL*>(thePipeLine);
+ myCutLinesBasePL = (VISU_CutLinesBasePL*)thePipeLine;
+
+ TSuperClass::CreatePipeLine(myCutLinesBasePL);
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::CutLinesBase_i
+::BuildTableOfReal(SALOMEDS::SObject_var theSObject, bool theIsCutSegment)
+{
+ try{
+ if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal");
+ Update();
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
+ anAttr = aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributeTableOfReal");
+ SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
+
+ typedef set<vtkFloatingPointType> TXCont;
+ typedef map<vtkFloatingPointType,vtkFloatingPointType> TXYMap;
+ typedef map<int,TXYMap> TXYMapCont;
+ typedef map<long,long> TLineIdCont;
+
+ QString aTitle( GetScalarBarTitle().c_str() );
+ aTitle = aTitle.simplified();
+ aTableOfReal->SetTitle( aTitle.toLatin1().data() );
+
+ int iLineEnd = myCutLinesBasePL->GetAppendPolyData()->GetNumberOfInputConnections(0);
+ if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLineEnd = "<<iLineEnd);
+ TXCont aXCont;
+ TXYMapCont aXYMapCont;
+ TLineIdCont aLineIdCont; // Define internal numeration of lines
+ const vtkFloatingPointType *aDirLn = myCutLinesBasePL->GetDirLn();
+ const vtkFloatingPointType *aBasePnt = myCutLinesBasePL->GetBasePnt();
+ const vtkFloatingPointType *aBoundPrjLn = myCutLinesBasePL->GetBoundPrjLn();
+ for(int iLine = 0, jLine = 0; iLine < iLineEnd; iLine++){
+ vtkDataSet *aDataSet = myCutLinesBasePL->GetAppendPolyData()->GetInput(iLine);
+ aDataSet->Update();
+ int aNbPoints = aDataSet->GetNumberOfPoints();
+ if(!aNbPoints) continue;
+ vtkPointData *aPointData = aDataSet->GetPointData();
+ vtkDataArray *aScalars = aPointData->GetScalars();
+ VISU_CellDataToPointData *aFilter = NULL;
+ if(!aScalars) {
+ aFilter = VISU_CellDataToPointData::New();
+ aFilter->SetInput(aDataSet);
+ aFilter->PassCellDataOn();
+ aDataSet = aFilter->GetOutput();
+ aDataSet->Update();
+ }
+ aPointData = aDataSet->GetPointData();
+ aScalars = aPointData->GetScalars();
+ if(!aScalars) continue;
+ if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLine = "<<iLine<<"; aNbPoints = "<<aNbPoints);
+ aLineIdCont[iLine] = jLine++;
+ TXYMap& aXYMap = aXYMapCont[iLine];
+ vtkFloatingPointType aPnt[3], aVect[3], aDist, aTopBnd, aDivide;
+ aTopBnd = aBoundPrjLn[2];
+ aDivide = aBoundPrjLn[2];
+ if( !IsUseAbsoluteLength() ){
+ aTopBnd = 1.0;
+ }
+ else aDivide = 1.0;
+
+ for(int i = 0; i < aNbPoints; i++){
+ aDataSet->GetPoint(i,aPnt);
+ for(int j = 0; j < 3; j++)
+ aVect[j] = aPnt[j] - aBasePnt[j];
+ //VISU::Sub(aPnt,aBasePnt,aVect);
+ if ( fabs(aBoundPrjLn[2]) < EPS_machine )
+ aDist = 0.5;
+ else
+ {
+ aDist = vtkMath::Dot(aVect,aDirLn)/aDivide;
+ // the workaround
+ if(aDist < 0.0) aDist = 0.0;
+ if(aDist > aTopBnd) aDist = aTopBnd;
+ }
+ aXYMap[aDist] = aScalars->GetTuple1(i);
+ }
+ if(aFilter)
+ aFilter->Delete();
+ }
+ if(aXYMapCont.size() == 0)
+ throw std::runtime_error("CutPlanes_i::BuildTableOfReal aXYMapCont.size() == 0 !!!");
+
+ {
+ // Invertion all curves in the table, which has inversion flag is TRUE (see \a myMapCurvesInverted)
+ for(int iLine=0; iLine < iLineEnd; iLine++){
+ if (!IsCurveInverted(iLine)) continue;
+ TXYMap aNewXYMap;
+ TXYMap& aXYMap = aXYMapCont[iLine];
+ TXYMap::const_iterator aXYMapIter = aXYMap.begin();
+ std::list<vtkFloatingPointType> XKeys;
+ for (;aXYMapIter != aXYMap.end() ; aXYMapIter++) XKeys.push_back(aXYMapIter->first);
+ XKeys.sort();
+ if (XKeys.size() > 1) {
+ vtkFloatingPointType a_first_indx = XKeys.front();
+ vtkFloatingPointType a_last_indx = XKeys.back();
+ if (a_first_indx > a_last_indx){
+ XKeys.reverse();
+ vtkFloatingPointType tmp = a_first_indx;
+ a_first_indx = a_last_indx;
+ a_last_indx = tmp;
+ }
+ std::list<vtkFloatingPointType>::const_iterator aIter = XKeys.begin();
+ for (int k=0;k<XKeys.size() && aIter != XKeys.end();k++,aIter++){
+ // Warning: value '1.0' come from workaround:
+ // see also aDist = vtkMath::Dot(aVect,aDirLn) / aBoundPrjLn[2];
+ // aDist >= 0 and aDist<=1.0
+ vtkFloatingPointType aTopBnd = aBoundPrjLn[2];
+ if( !IsUseAbsoluteLength() ){
+ aTopBnd = 1.0;
+ }
+ aNewXYMap[aTopBnd - *aIter] = aXYMap[*aIter];
+ }
+ TXYMap::const_iterator aNewXYMapIter = aNewXYMap.begin();
+ aXYMap.clear();
+ for (;aNewXYMapIter != aNewXYMap.end();aNewXYMapIter++) {
+ aXYMap[aNewXYMapIter->first] = aNewXYMapIter->second;
+ }
+ }
+ }
+ }
+ //Resorting of theXYMap
+ TXYMapCont::iterator aXYMapContIter = aXYMapCont.begin();
+ for(; aXYMapContIter != aXYMapCont.end(); aXYMapContIter++){
+ TXYMap& aXYMap = aXYMapContIter->second, aNewXYMap;
+ if(aXYMap.size() > 2){
+ // Try to smooth the values of the line by applying linear approximation
+ TXYMap::const_iterator aXYMapIter[2] = {aXYMap.begin(), ++aXYMap.begin()};
+ aNewXYMap[aXYMapIter[0]->first] = aXYMapIter[0]->second;
+ aXCont.insert(aXYMapIter[0]->first);
+ for(; aXYMapIter[1] != aXYMap.end(); aXYMapIter[0]++, aXYMapIter[1]++){
+ vtkFloatingPointType aY[3] = {aXYMapIter[0]->second, aXYMapIter[1]->second, 0.0};
+ aY[2] = (aY[0] + aY[1])/2.0;
+ vtkFloatingPointType aX[3] = {aXYMapIter[0]->first, aXYMapIter[1]->first, 0.0};
+ aX[2] = (aX[0] + aX[1])/2.0;
+ aNewXYMap[aX[2]] = aY[2];
+ aXCont.insert(aX[2]);
+ }
+ aNewXYMap[aXYMapIter[0]->first] = aXYMapIter[0]->second;
+ aXCont.insert(aXYMapIter[0]->first);
+ aXYMap = aNewXYMap;
+ }else{
+ TXYMap::const_iterator aXYMapIter = aXYMap.begin();
+ for(; aXYMapIter != aXYMap.end(); aXYMapIter++)
+ aXCont.insert(aXYMapIter->first);
+ }
+ }
+ if(aXCont.size() == 0)
+ throw std::runtime_error("CutPlanes_i::BuildTableOfReal aXCont.size() == 0 !!!");
+ QString aString;
+ int iEnd = aXCont.size();
+ aTableOfReal->SetNbColumns(iEnd);
+ TXCont::const_iterator aXContIter = aXCont.begin();
+ vtkFloatingPointType aMinDist = *aXContIter;
+ aXContIter = aXCont.end();
+ aXContIter--;
+ vtkFloatingPointType aMaxDist = *aXContIter;
+ if(aMaxDist < aMinDist)
+ throw std::runtime_error("CutPlanes_i::BuildTableOfReal aMaxDist < aMinDist !!!");
+ aXContIter = aXCont.begin();
+ for(long i = 0; aXContIter != aXCont.end(); aXContIter++, i++){
+ vtkFloatingPointType aDist = *aXContIter;
+ vtkFloatingPointType aXVal = aDist;
+ if(theIsCutSegment){
+ aXVal -= aMinDist;
+ if(!IsUseAbsoluteLength() && fabs(aMaxDist - aMinDist) > EPS_machine)
+ aXVal /= (aMaxDist - aMinDist);
+ }
+ aTableOfReal->PutValue(aXVal,1,i+1);
+ aString.sprintf("%d",i);
+ aTableOfReal->SetColumnTitle(i+1,(const char*)aString.toLatin1());
+ if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal aDist = "<<aDist<<" aXVal = "<<aXVal);
+ TXYMapCont::const_iterator aXYMapContIter = aXYMapCont.begin();
+ for(; aXYMapContIter != aXYMapCont.end(); aXYMapContIter++){
+ long iLine = aXYMapContIter->first;
+ long iLineId = aLineIdCont[iLine];
+ const TXYMap& aXYMap = aXYMapCont[iLine];
+ TXYMap::const_iterator aXYMapIter = aXYMap.find(aDist);
+ // Can we find some value that belong to the line and have the same X coordinate?
+ if(aXYMapIter == aXYMap.end()) continue;
+ vtkFloatingPointType aVal = aXYMapIter->second;
+ aTableOfReal->PutValue(aVal,iLineId+2,i+1);
+ }
+ }
+ {
+ aTableOfReal->SetRowTitle(1,"X");
+ aTableOfReal->SetRowUnit(1,"-");
+ QString aUnitName = GetField()->myUnitNames[0].c_str();
+ int aScalarMode = myCutLinesBasePL->GetScalarMode();
+ if(aScalarMode != 0)
+ aUnitName = GetField()->myUnitNames[aScalarMode-1].c_str();
+ aUnitName = aUnitName.simplified();
+ if(aUnitName.isEmpty()) aUnitName = "-";
+ TXYMapCont::const_iterator aXYMapContIter = aXYMapCont.begin();
+ for(; aXYMapContIter != aXYMapCont.end(); aXYMapContIter++){
+ long iLine = aXYMapContIter->first;
+ long iLineId = aLineIdCont[iLine];
+ aString.sprintf("Y%d",iLine);
+ if(MYDEBUG)
+ MESSAGE("CutPlanes_i::BuildTableOfReal - SetRowTitle("<<iLineId+2<<",'"<<(const char*)aString.toLatin1()<<"')");
+ aTableOfReal->SetRowTitle(iLineId+2,(const char*)aString.toLatin1());
+ aTableOfReal->SetRowUnit(iLineId+2,(const char*)aUnitName.toLatin1());
+ }
+ }
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch (...){
+ INFOS("Unknown exception was occured !!!");
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VISU_CutLinesBase_i.hh
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#ifndef VISU_CutLinesBase_i_HeaderFile
+#define VISU_CutLinesBase_i_HeaderFile
+
+#include "VISU_I.hxx"
+#include "VISU_ScalarMap_i.hh"
+
+class VISU_CutLinesBasePL;
+
+namespace VISU
+{
+ //----------------------------------------------------------------------------
+ class VISU_I_EXPORT CutLinesBase_i : public virtual POA_VISU::CutLinesBase,
+ public virtual ScalarMap_i
+ {
+ CutLinesBase_i(const CutLinesBase_i&);
+
+ public:
+ //----------------------------------------------------------------------------
+ typedef ScalarMap_i TSuperClass;
+ typedef VISU::CutLinesBase TInterface;
+
+ explicit
+ CutLinesBase_i(EPublishInStudyMode thePublishInStudyModep);
+
+ virtual
+ ~CutLinesBase_i();
+
+ virtual
+ VISU_Actor*
+ CreateActor();
+
+ virtual
+ void
+ SetNbLines(CORBA::Long theNb);
+
+ virtual
+ CORBA::Long
+ GetNbLines();
+
+ virtual
+ void
+ SetAllCurvesInverted(CORBA::Boolean theInvert);
+
+ virtual
+ CORBA::Boolean
+ IsAllCurvesInverted();
+
+ virtual
+ void
+ SetCurveInverted(CORBA::Long theCurveNumber,
+ CORBA::Boolean theInvert);
+
+ virtual
+ CORBA::Boolean
+ IsCurveInverted(CORBA::Long theCurveNumber);
+
+ virtual
+ void
+ SetUseAbsoluteLength(CORBA::Boolean theAbsLength);
+
+ virtual
+ CORBA::Boolean
+ IsUseAbsoluteLength();
+
+ typedef std::map<int,bool> TCurvesInv;
+ TCurvesInv
+ GetCurvesInverted()
+ {
+ return myMapCurvesInverted;
+ }
+
+ void
+ CopyCurvesInverted(const TCurvesInv& theCurves);
+
+ VISU_CutLinesBasePL*
+ GetSpecificPL() const
+ {
+ return myCutLinesBasePL;
+ }
+
+ protected:
+ //! Extends VISU_ColoredPrs3d_i::CreatePipeLine
+ virtual
+ void
+ CreatePipeLine(VISU_PipeLine* thePipeLine);
+
+ VISU_CutLinesBasePL *myCutLinesBasePL;
+ TCurvesInv myMapCurvesInverted;
+ CORBA::Boolean myUseAbsLength;
+
+ public:
+ //! Extends VISU_ColoredPrs3d_i::Create
+ virtual
+ Storable*
+ Create(const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber);
+
+ //! Extends VISU_ColoredPrs3d_i::ToStream
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
+
+ //! Extends VISU_ColoredPrs3d_i::Restore
+ virtual
+ Storable*
+ Restore(SALOMEDS::SObject_ptr theSObject,
+ const Storable::TRestoringMap& theMap);
+
+ virtual
+ void
+ SameAs(const Prs3d_i* theOrigin);
+
+ void BuildTableOfReal(SALOMEDS::SObject_var theSObject,
+ bool theIsCutSegment = false);
+ };
+}
+
+#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.cxx
// Author : Alexey PETROV
#include <vtkAppendPolyData.h>
-static vtkFloatingPointType EPS_machine = 1.0E-7;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
CutLines_i(EPublishInStudyMode thePublishInStudyMode) :
ColoredPrs3d_i(thePublishInStudyMode),
ScalarMap_i(thePublishInStudyMode),
- myUseAbsLength( false ),
+ CutLinesBase_i(thePublishInStudyMode),
myCutLinesPL(NULL)
{}
::SameAs(const Prs3d_i* theOrigin)
{
TSuperClass::SameAs(theOrigin);
-
- if(const CutLines_i* aPrs3d = dynamic_cast<const CutLines_i*>(theOrigin)){
- CutLines_i* anOrigin = const_cast<CutLines_i*>(aPrs3d);
- myUseAbsLength = anOrigin->IsUseAbsoluteLength();
- CopyCurvesInverted(anOrigin->GetCurvesInverted());
- }
-}
-
-
-//---------------------------------------------------------------
-/*! Copy map to /a myMapCurvesInverted.
- * \param theCurves - map
- */
-void
-VISU::CutLines_i
-::CopyCurvesInverted(const TCurvesInv& theCurves)
-{
- myMapCurvesInverted = theCurves;
}
const std::string& theFieldName,
CORBA::Long theTimeStampNumber)
{
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- SetUseAbsoluteLength( aResourceMgr->booleanValue( "VISU", "use_absolute_length", false ) );
- SetAllCurvesInverted( aResourceMgr->booleanValue( "VISU", "invert_all_curves", false ) );
return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
}
if(!TSuperClass::Restore(theSObject, theMap))
return NULL;
- SetNbLines(VISU::Storable::FindValue(theMap,"myNbLines").toInt());
SetDisplacement(VISU::Storable::FindValue(theMap,"myDisplacement[0]").toDouble());
SetDisplacement2(VISU::Storable::FindValue(theMap,"myDisplacement[1]").toDouble());
SetOrientation(CutPlanes::Orientation(VISU::Storable::FindValue(theMap,"myBasePlane[0]").toInt()),
SetOrientation2(CutPlanes::Orientation(VISU::Storable::FindValue(theMap,"myBasePlane[1]").toInt()),
Storable::FindValue(theMap,"aRot[1][0]").toDouble(),
Storable::FindValue(theMap,"aRot[1][1]").toDouble());
- SetUseAbsoluteLength(VISU::Storable::FindValue(theMap,"myUseAbsLength").toInt());
if (VISU::Storable::FindValue(theMap,"myBasePlaneCondition").toInt())
SetDefault();
if(aCondList[i].toInt() == 0)
SetLinePosition(i,aPosList[i].toDouble());
- // Restoring the map - \a myMapCurvesInverted
- QStringList aMapCurvesInverted = VISU::Storable::FindValue(theMap,"myMapCurvesInverted").split("|",QString::SkipEmptyParts );
- if (aMapCurvesInverted.count() == GetNbLines()){
- for(int i = 0, iEnd = GetNbLines(); i < iEnd ; i++){
- if(aMapCurvesInverted[i].toInt())
- SetCurveInverted(i,true);
- else
- SetCurveInverted(i,false);
- }
- } else {
- for(int i = 0, iEnd = GetNbLines(); i < iEnd ; i++)
- SetCurveInverted(i,false);
- }
-
return this;
}
{
TSuperClass::ToStream(theStr);
- int aNbLines = GetNbLines();
-
- Storable::DataToStream( theStr, "myNbLines", aNbLines );
Storable::DataToStream( theStr, "myDisplacement[0]", GetDisplacement() );
Storable::DataToStream( theStr, "myDisplacement[1]", GetDisplacement2() );
Storable::DataToStream( theStr, "myBasePlane[0]", int(GetOrientationType()) );
Storable::DataToStream( theStr, "myLinePosition", (const char*)aStrPos.toLatin1());
Storable::DataToStream( theStr, "myLineCondition", (const char*)aStrCon.toLatin1());
- Storable::DataToStream( theStr,"myUseAbsLength", IsUseAbsoluteLength());
-
- // Storing the map - \a myMapCurvesInverted
- QString aStrCurvesInverted;
- for(int i = 0, iEnd = GetNbLines(); i < iEnd; i++)
- aStrCurvesInverted.append(QString::number(IsCurveInverted(i)) + "|");
- Storable::DataToStream( theStr, "myMapCurvesInverted", (const char*)aStrCurvesInverted.toLatin1());
}
return myCutLinesPL->IsPartDefault(thePlaneNumber);
}
-//---------------------------------------------------------------
-/*! Invert all curves of corresponding table
- * see void VISU::CutLines_i::SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert)
- * \param theInvert - Invert all curves, if value is TRUE, else not.
- */
-void
-VISU::CutLines_i
-::SetAllCurvesInverted(CORBA::Boolean theInvert)
-{
- for(int i=0; i < GetNbLines(); i++)
- SetCurveInverted(i, theInvert);
-}
-
-//---------------------------------------------------------------
-/*! Checks the orientation of all curves
- * \retval TRUE - if all curves are inverted, else FALSE
- */
-CORBA::Boolean
-VISU::CutLines_i
-::IsAllCurvesInverted()
-{
- for (int i=0; i<GetNbLines(); i++)
- if (!IsCurveInverted(i)) return false;
- return true;
-}
-
-//---------------------------------------------------------------
-/*! Sets orientation of curve
- * \param theCurveNumber - integer value, number of cut line.
- * \param theInvert - boolean value, TRUE or false.
- */
-void
-VISU::CutLines_i
-::SetCurveInverted(CORBA::Long theCurveNumber, CORBA::Boolean theInvert)
-{
- if(myMapCurvesInverted[theCurveNumber] == theInvert)
- return;
-
- VISU::TSetModified aModified(this);
-
- myMapCurvesInverted[theCurveNumber] = theInvert;
- myParamsTime.Modified();
-}
-
-//---------------------------------------------------------------
-/*! Checks orientation of curve.
- * \param theCurveNumber - integer value, number of cut line.
- * \retval TRUE - if line in the table is inverted, else FALSE.
- */
-CORBA::Boolean
-VISU::CutLines_i
-::IsCurveInverted(CORBA::Long theCurveNumber)
-{
- return myMapCurvesInverted[theCurveNumber];
-}
-
-//---------------------------------------------------------------
-/*! It control the way the length of cutlines is shown: using aboslute or relative values
-* \param theAbsLength - boolean value, TRUE or false.
-*/
-void
-VISU::CutLines_i
-::SetUseAbsoluteLength(CORBA::Boolean theAbsLength)
-{
- if ( myUseAbsLength == theAbsLength )
- return;
-
- VISU::TSetModified aModified(this);
-
- myUseAbsLength = theAbsLength;
- myParamsTime.Modified();
-}
-
-//---------------------------------------------------------------
-CORBA::Boolean
-VISU::CutLines_i
-::IsUseAbsoluteLength()
-{
- return myUseAbsLength;
-}
-
-//---------------------------------------------------------------
-void
-VISU::CutLines_i
-::SetNbLines(CORBA::Long theNb)
-{
- VISU::TSetModified aModified(this);
-
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutLinesPL, int>
- (GetSpecificPL(), &VISU_CutLinesPL::SetNbParts, theNb));
-}
-
-//---------------------------------------------------------------
-CORBA::Long
-VISU::CutLines_i
-::GetNbLines()
-{
- return myCutLinesPL->GetNbParts();
-}
-
-
//---------------------------------------------------------------
void
VISU::CutLines_i
}
return NULL;
}
-
-//---------------------------------------------------------------
-void
-VISU::CutLines_i
-::BuildTableOfReal(SALOMEDS::SObject_var theSObject)
-{
- try{
- if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal");
- Update();
- SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
- anAttr = aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributeTableOfReal");
- SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
-
- typedef set<vtkFloatingPointType> TXCont;
- typedef map<vtkFloatingPointType,vtkFloatingPointType> TXYMap;
- typedef map<int,TXYMap> TXYMapCont;
- typedef map<long,long> TLineIdCont;
-
- QString aTitle( GetScalarBarTitle().c_str() );
- aTitle = aTitle.simplified();
- aTableOfReal->SetTitle( aTitle.toLatin1().data() );
-
- int iLineEnd = myCutLinesPL->GetAppendPolyData()->GetNumberOfInputConnections(0);
- if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLineEnd = "<<iLineEnd);
- TXCont aXCont;
- TXYMapCont aXYMapCont;
- TLineIdCont aLineIdCont; // Define internal numeration of lines
- const vtkFloatingPointType *aDirLn = myCutLinesPL->GetDirLn();
- const vtkFloatingPointType *aBasePnt = myCutLinesPL->GetBasePnt();
- const vtkFloatingPointType *aBoundPrjLn = myCutLinesPL->GetBoundPrjLn();
- for(int iLine = 0, jLine = 0; iLine < iLineEnd; iLine++){
- vtkDataSet *aDataSet = myCutLinesPL->GetAppendPolyData()->GetInput(iLine);
- aDataSet->Update();
- int aNbPoints = aDataSet->GetNumberOfPoints();
- if(!aNbPoints) continue;
- vtkPointData *aPointData = aDataSet->GetPointData();
- vtkDataArray *aScalars = aPointData->GetScalars();
- vtkCellDataToPointData *aFilter = NULL;
- if(!aScalars) {
- aFilter = vtkCellDataToPointData::New();
- aFilter->SetInput(aDataSet);
- aFilter->PassCellDataOn();
- aDataSet = aFilter->GetOutput();
- aDataSet->Update();
- }
- aPointData = aDataSet->GetPointData();
- aScalars = aPointData->GetScalars();
- if(!aScalars) continue;
- if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLine = "<<iLine<<"; aNbPoints = "<<aNbPoints);
- aLineIdCont[iLine] = jLine++;
- TXYMap& aXYMap = aXYMapCont[iLine];
- vtkFloatingPointType aPnt[3], aVect[3], aDist, aTopBnd, aDivide;
- aTopBnd = aBoundPrjLn[2];
- aDivide = aBoundPrjLn[2];
- if( !IsUseAbsoluteLength() ){
- aTopBnd = 1.0;
- }
- else aDivide = 1.0;
-
- for(int i = 0; i < aNbPoints; i++){
- aDataSet->GetPoint(i,aPnt);
- for(int j = 0; j < 3; j++)
- aVect[j] = aPnt[j] - aBasePnt[j];
- //VISU::Sub(aPnt,aBasePnt,aVect);
- if ( fabs(aBoundPrjLn[2]) < EPS_machine )
- aDist = 0.5;
- else
- {
- aDist = vtkMath::Dot(aVect,aDirLn)/aDivide;
- // the workaround
- if(aDist < 0.0) aDist = 0.0;
- if(aDist > aTopBnd) aDist = aTopBnd;
- }
- aXYMap[aDist] = aScalars->GetTuple1(i);
- }
- if(aFilter)
- aFilter->Delete();
- }
- if(aXYMapCont.size() == 0)
- throw std::runtime_error("CutPlanes_i::BuildTableOfReal aXYMapCont.size() == 0 !!!");
-
- {
- // Invertion all curves in the table, which has inversion flag is TRUE (see \a myMapCurvesInverted)
- for(int iLine=0; iLine < iLineEnd; iLine++){
- if (!IsCurveInverted(iLine)) continue;
- TXYMap aNewXYMap;
- TXYMap& aXYMap = aXYMapCont[iLine];
- TXYMap::const_iterator aXYMapIter = aXYMap.begin();
- std::list<vtkFloatingPointType> XKeys;
- for (;aXYMapIter != aXYMap.end() ; aXYMapIter++) XKeys.push_back(aXYMapIter->first);
- XKeys.sort();
- if (XKeys.size() > 1) {
- vtkFloatingPointType a_first_indx = XKeys.front();
- vtkFloatingPointType a_last_indx = XKeys.back();
- if (a_first_indx > a_last_indx){
- XKeys.reverse();
- vtkFloatingPointType tmp = a_first_indx;
- a_first_indx = a_last_indx;
- a_last_indx = tmp;
- }
- std::list<vtkFloatingPointType>::const_iterator aIter = XKeys.begin();
- for (int k=0;k<XKeys.size() && aIter != XKeys.end();k++,aIter++){
- // Warning: value '1.0' come from workaround:
- // see also aDist = vtkMath::Dot(aVect,aDirLn) / aBoundPrjLn[2];
- // aDist >= 0 and aDist<=1.0
- vtkFloatingPointType aTopBnd = aBoundPrjLn[2];
- if( !IsUseAbsoluteLength() ){
- aTopBnd = 1.0;
- }
- aNewXYMap[aTopBnd - *aIter] = aXYMap[*aIter];
- }
- TXYMap::const_iterator aNewXYMapIter = aNewXYMap.begin();
- aXYMap.clear();
- for (;aNewXYMapIter != aNewXYMap.end();aNewXYMapIter++) {
- aXYMap[aNewXYMapIter->first] = aNewXYMapIter->second;
- }
- }
- }
- }
- //Resorting of theXYMap
- TXYMapCont::iterator aXYMapContIter = aXYMapCont.begin();
- for(; aXYMapContIter != aXYMapCont.end(); aXYMapContIter++){
- TXYMap& aXYMap = aXYMapContIter->second, aNewXYMap;
- if(aXYMap.size() > 2){
- // Try to smooth the values of the line by applying linear approximation
- TXYMap::const_iterator aXYMapIter[2] = {aXYMap.begin(), ++aXYMap.begin()};
- aNewXYMap[aXYMapIter[0]->first] = aXYMapIter[0]->second;
- aXCont.insert(aXYMapIter[0]->first);
- for(; aXYMapIter[1] != aXYMap.end(); aXYMapIter[0]++, aXYMapIter[1]++){
- vtkFloatingPointType aY[3] = {aXYMapIter[0]->second, aXYMapIter[1]->second, 0.0};
- aY[2] = (aY[0] + aY[1])/2.0;
- vtkFloatingPointType aX[3] = {aXYMapIter[0]->first, aXYMapIter[1]->first, 0.0};
- aX[2] = (aX[0] + aX[1])/2.0;
- aNewXYMap[aX[2]] = aY[2];
- aXCont.insert(aX[2]);
- }
- aNewXYMap[aXYMapIter[0]->first] = aXYMapIter[0]->second;
- aXCont.insert(aXYMapIter[0]->first);
- aXYMap = aNewXYMap;
- }else{
- TXYMap::const_iterator aXYMapIter = aXYMap.begin();
- for(; aXYMapIter != aXYMap.end(); aXYMapIter++)
- aXCont.insert(aXYMapIter->first);
- }
- }
- if(aXCont.size() == 0)
- throw std::runtime_error("CutPlanes_i::BuildTableOfReal aXCont.size() == 0 !!!");
- QString aString;
- int iEnd = aXCont.size();
- aTableOfReal->SetNbColumns(iEnd);
- TXCont::const_iterator aXContIter = aXCont.begin();
- for(long i = 0; aXContIter != aXCont.end(); aXContIter++, i++){
- vtkFloatingPointType aDist = *aXContIter;
- aTableOfReal->PutValue(aDist,1,i+1);
- aString.sprintf("%d",i);
- aTableOfReal->SetColumnTitle(i+1,(const char*)aString.toLatin1());
- if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal aDist = "<<aDist);
- TXYMapCont::const_iterator aXYMapContIter = aXYMapCont.begin();
- for(; aXYMapContIter != aXYMapCont.end(); aXYMapContIter++){
- long iLine = aXYMapContIter->first;
- long iLineId = aLineIdCont[iLine];
- const TXYMap& aXYMap = aXYMapCont[iLine];
- TXYMap::const_iterator aXYMapIter = aXYMap.find(aDist);
- // Can we find some value that belong to the line and have the same X coordinate?
- if(aXYMapIter == aXYMap.end()) continue;
- vtkFloatingPointType aVal = aXYMapIter->second;
- aTableOfReal->PutValue(aVal,iLineId+2,i+1);
- }
- }
- {
- aTableOfReal->SetRowTitle(1,"X");
- aTableOfReal->SetRowUnit(1,"-");
- QString aUnitName = GetField()->myUnitNames[0].c_str();
- int aScalarMode = myCutLinesPL->GetScalarMode();
- if(aScalarMode != 0)
- aUnitName = GetField()->myUnitNames[aScalarMode-1].c_str();
- aUnitName = aUnitName.simplified();
- if(aUnitName.isEmpty()) aUnitName = "-";
- TXYMapCont::const_iterator aXYMapContIter = aXYMapCont.begin();
- for(; aXYMapContIter != aXYMapCont.end(); aXYMapContIter++){
- long iLine = aXYMapContIter->first;
- long iLineId = aLineIdCont[iLine];
- aString.sprintf("Y%d",iLine);
- if(MYDEBUG)
- MESSAGE("CutPlanes_i::BuildTableOfReal - SetRowTitle("<<iLineId+2<<",'"<<(const char*)aString.toLatin1()<<"')");
- aTableOfReal->SetRowTitle(iLineId+2,(const char*)aString.toLatin1());
- aTableOfReal->SetRowUnit(iLineId+2,(const char*)aUnitName.toLatin1());
- }
- }
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- }catch (...){
- INFOS("Unknown exception was occured !!!");
- }
-}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.hxx
// Author : Alexey PETROV
#define VISU_CutLines_i_HeaderFile
#include "VISU_I.hxx"
-#include "VISU_ScalarMap_i.hh"
+#include "VISU_CutLinesBase_i.hh"
class VISU_CutLinesPL;
{
//----------------------------------------------------------------------------
class VISU_I_EXPORT CutLines_i : public virtual POA_VISU::CutLines,
- public virtual ScalarMap_i
+ public virtual CutLinesBase_i
{
static int myNbPresent;
- CutLines_i(const CutLines_i&);
+ CutLines_i(const CutLines_i&);
public:
//----------------------------------------------------------------------------
- typedef ScalarMap_i TSuperClass;
+ typedef CutLinesBase_i TSuperClass;
typedef VISU::CutLines TInterface;
explicit
CORBA::Boolean
IsDefaultPosition(CORBA::Long thePlaneNumber);
- virtual
- void
- SetAllCurvesInverted(CORBA::Boolean theInvert);
-
- virtual
- CORBA::Boolean
- IsAllCurvesInverted();
-
- virtual
- void
- SetCurveInverted(CORBA::Long theCurveNumber,
- CORBA::Boolean theInvert);
-
- virtual
- CORBA::Boolean
- IsCurveInverted(CORBA::Long theCurveNumber);
-
- virtual
- void
- SetUseAbsoluteLength(CORBA::Boolean theAbsLength);
-
- virtual
- CORBA::Boolean
- IsUseAbsoluteLength();
-
- virtual
- void
- SetNbLines(CORBA::Long theNb);
-
- virtual
- CORBA::Long
- GetNbLines();
-
- typedef std::map<int,bool> TCurvesInv;
- TCurvesInv
- GetCurvesInverted()
- {
- return myMapCurvesInverted;
- }
-
- void
- CopyCurvesInverted(const TCurvesInv& theCurves);
-
VISU_CutLinesPL*
GetSpecificPL() const
{
GetIconName();
VISU_CutLinesPL *myCutLinesPL;
- TCurvesInv myMapCurvesInverted;
- CORBA::Boolean myUseAbsLength;
public:
//! Extends VISU_ColoredPrs3d_i::IsPossible
VISU_Actor*
CreateActor();
- void BuildTableOfReal(SALOMEDS::SObject_var theSObject);
-
static const std::string myComment;
virtual
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.cxx
// Author : Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.hxx
// Author : Alexey PETROV
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VISU_CutSegment_i.cc
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#include "VISU_CutSegment_i.hh"
+#include "VISU_Prs3dUtils.hh"
+#include "VISU_Result_i.hh"
+
+#include "VISU_Actor.h"
+#include "VISU_CutSegmentPL.hxx"
+#include "VISU_Convertor.hxx"
+#include "VISU_PipeLineUtils.hxx"
+
+#include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.h"
+
+#include <vtkAppendPolyData.h>
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+using namespace std;
+
+//---------------------------------------------------------------
+size_t
+VISU::CutSegment_i
+::IsPossible(Result_i* theResult,
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck)
+{
+ return TSuperClass::IsPossible(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber,
+ theIsMemoryCheck);
+}
+
+//---------------------------------------------------------------
+int VISU::CutSegment_i::myNbPresent = 0;
+
+//---------------------------------------------------------------
+QString
+VISU::CutSegment_i::GenerateName()
+{
+ return VISU::GenerateName("CutSegment",myNbPresent++);
+}
+
+//---------------------------------------------------------------
+const string VISU::CutSegment_i::myComment = "CUTSEGMENT";
+
+//---------------------------------------------------------------
+const char*
+VISU::CutSegment_i
+::GetComment() const
+{
+ return myComment.c_str();
+}
+
+//----------------------------------------------------------------------------
+const char*
+VISU::CutSegment_i
+::GetIconName()
+{
+ if (!IsGroupsUsed())
+ return "ICON_TREE_CUT_SEGMENT";
+ else
+ return "ICON_TREE_CUT_SEGMENT_GROUPS";
+}
+
+//---------------------------------------------------------------
+VISU::CutSegment_i::
+CutSegment_i(EPublishInStudyMode thePublishInStudyMode) :
+ ColoredPrs3d_i(thePublishInStudyMode),
+ ScalarMap_i(thePublishInStudyMode),
+ CutLinesBase_i(thePublishInStudyMode),
+ myCutSegmentPL(NULL)
+{}
+
+
+//---------------------------------------------------------------
+void
+VISU::CutSegment_i
+::SameAs(const Prs3d_i* theOrigin)
+{
+ TSuperClass::SameAs(theOrigin);
+}
+
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::CutSegment_i
+::Create(const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber)
+{
+ return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
+}
+
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::CutSegment_i
+::Restore(SALOMEDS::SObject_ptr theSObject,
+ const Storable::TRestoringMap& theMap)
+{
+ if(!TSuperClass::Restore(theSObject, theMap))
+ return NULL;
+
+ SetPoint1(VISU::Storable::FindValue(theMap,"myPoint1[0]").toDouble(),
+ VISU::Storable::FindValue(theMap,"myPoint1[1]").toDouble(),
+ VISU::Storable::FindValue(theMap,"myPoint1[2]").toDouble());
+ SetPoint2(VISU::Storable::FindValue(theMap,"myPoint2[0]").toDouble(),
+ VISU::Storable::FindValue(theMap,"myPoint2[1]").toDouble(),
+ VISU::Storable::FindValue(theMap,"myPoint2[2]").toDouble());
+
+ return this;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::CutSegment_i
+::ToStream(std::ostringstream& theStr)
+{
+ TSuperClass::ToStream(theStr);
+
+ double aCoord[3];
+ GetPoint1( aCoord[0], aCoord[1], aCoord[2] );
+ Storable::DataToStream( theStr, "myPoint1[0]", aCoord[0] );
+ Storable::DataToStream( theStr, "myPoint1[1]", aCoord[1] );
+ Storable::DataToStream( theStr, "myPoint1[2]", aCoord[2] );
+
+ GetPoint2( aCoord[0], aCoord[1], aCoord[2] );
+ Storable::DataToStream( theStr, "myPoint2[0]", aCoord[0] );
+ Storable::DataToStream( theStr, "myPoint2[1]", aCoord[1] );
+ Storable::DataToStream( theStr, "myPoint2[2]", aCoord[2] );
+}
+
+
+//---------------------------------------------------------------
+VISU::CutSegment_i
+::~CutSegment_i()
+{
+ if(MYDEBUG) MESSAGE("CutSegment_i::~CutSegment_i()");
+}
+
+
+//---------------------------------------------------------------
+struct TSetPoint1Event: public SALOME_Event
+{
+ VISU_CutSegmentPL* myCutSegmentPL;
+ CORBA::Double myX, myY, myZ;
+ TSetPoint1Event(VISU_CutSegmentPL* theCutSegment,
+ CORBA::Double theX,
+ CORBA::Double theY,
+ CORBA::Double theZ):
+ myCutSegmentPL(theCutSegment),
+ myX(theX),
+ myY(theY),
+ myZ(theZ)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ myCutSegmentPL->SetPoint1(myX, myY, myZ);
+ }
+};
+
+void
+VISU::CutSegment_i
+::SetPoint1(CORBA::Double theX,
+ CORBA::Double theY,
+ CORBA::Double theZ)
+{
+ VISU::TSetModified aModified(this);
+
+ ProcessVoidEvent(new TSetPoint1Event(myCutSegmentPL, theX, theY, theZ));
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::CutSegment_i
+::GetPoint1(CORBA::Double& theX,
+ CORBA::Double& theY,
+ CORBA::Double& theZ)
+{
+ myCutSegmentPL->GetPoint1(theX, theY, theZ);
+}
+
+
+//---------------------------------------------------------------
+struct TSetPoint2Event: public SALOME_Event
+{
+ VISU_CutSegmentPL* myCutSegmentPL;
+ CORBA::Double myX, myY, myZ;
+ TSetPoint2Event(VISU_CutSegmentPL* theCutSegment,
+ CORBA::Double theX,
+ CORBA::Double theY,
+ CORBA::Double theZ):
+ myCutSegmentPL(theCutSegment),
+ myX(theX),
+ myY(theY),
+ myZ(theZ)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ myCutSegmentPL->SetPoint2(myX, myY, myZ);
+ }
+};
+
+void
+VISU::CutSegment_i
+::SetPoint2(CORBA::Double theX,
+ CORBA::Double theY,
+ CORBA::Double theZ)
+{
+ VISU::TSetModified aModified(this);
+
+ ProcessVoidEvent(new TSetPoint2Event(myCutSegmentPL, theX, theY, theZ));
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::CutSegment_i
+::GetPoint2(CORBA::Double& theX,
+ CORBA::Double& theY,
+ CORBA::Double& theZ)
+{
+ myCutSegmentPL->GetPoint2(theX, theY, theZ);
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::CutSegment_i
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
+{
+ if(!thePipeLine){
+ myCutSegmentPL = VISU_CutSegmentPL::New();
+ }else
+ myCutSegmentPL = dynamic_cast<VISU_CutSegmentPL*>(thePipeLine);
+
+ TSuperClass::CreatePipeLine(myCutSegmentPL);
+}
+
+
+//----------------------------------------------------------------------------
+bool
+VISU::CutSegment_i
+::CheckIsPossible()
+{
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
+}
+
+
+//---------------------------------------------------------------
+VISU_Actor*
+VISU::CutSegment_i
+::CreateActor()
+{
+ if(VISU_Actor* anActor = TSuperClass::CreateActor()){
+ anActor->SetVTKMapping(true);
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aDispMode = aResourceMgr->integerValue("VISU", "cut_segment_represent", 2);
+ anActor->SetRepresentation(aDispMode);
+ return anActor;
+ }
+ return NULL;
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VISU_CutSegment_i.hh
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#ifndef VISU_CutSegment_i_HeaderFile
+#define VISU_CutSegment_i_HeaderFile
+
+#include "VISU_I.hxx"
+#include "VISU_CutLinesBase_i.hh"
+
+class VISU_CutSegmentPL;
+
+namespace VISU
+{
+ //----------------------------------------------------------------------------
+ class VISU_I_EXPORT CutSegment_i : public virtual POA_VISU::CutSegment,
+ public virtual CutLinesBase_i
+ {
+ static int myNbPresent;
+ CutSegment_i(const CutSegment_i&);
+
+ public:
+ //----------------------------------------------------------------------------
+ typedef CutLinesBase_i TSuperClass;
+ typedef VISU::CutSegment TInterface;
+
+ explicit
+ CutSegment_i(EPublishInStudyMode thePublishInStudyModep);
+
+ virtual
+ ~CutSegment_i();
+
+ virtual
+ VISU::VISUType
+ GetType()
+ {
+ return VISU::TCUTSEGMENT;
+ }
+
+ virtual
+ void
+ SetPoint1(CORBA::Double theX,
+ CORBA::Double theY,
+ CORBA::Double theZ );
+
+ virtual
+ void
+ GetPoint1(CORBA::Double& theX,
+ CORBA::Double& theY,
+ CORBA::Double& theZ );
+
+ virtual
+ void
+ SetPoint2(CORBA::Double theX,
+ CORBA::Double theY,
+ CORBA::Double theZ );
+
+ virtual
+ void
+ GetPoint2(CORBA::Double& theX,
+ CORBA::Double& theY,
+ CORBA::Double& theZ );
+
+ VISU_CutSegmentPL*
+ GetSpecificPL() const
+ {
+ return myCutSegmentPL;
+ }
+
+ protected:
+ //! Extends VISU_ColoredPrs3d_i::CreatePipeLine
+ virtual
+ void
+ CreatePipeLine(VISU_PipeLine* thePipeLine);
+
+ //! Extends VISU_ColoredPrs3d_i::CheckIsPossible
+ virtual
+ bool
+ CheckIsPossible();
+
+ virtual
+ const char*
+ GetIconName();
+
+ VISU_CutSegmentPL *myCutSegmentPL;
+
+ public:
+ //! Extends VISU_ColoredPrs3d_i::IsPossible
+ static
+ size_t
+ IsPossible(Result_i* theResult,
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck);
+
+ //! Extends VISU_ColoredPrs3d_i::Create
+ virtual
+ Storable*
+ Create(const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber);
+
+ //! Extends VISU_ColoredPrs3d_i::ToStream
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
+
+ //! Extends VISU_ColoredPrs3d_i::Restore
+ virtual
+ Storable*
+ Restore(SALOMEDS::SObject_ptr theSObject,
+ const Storable::TRestoringMap& theMap);
+
+ virtual
+ void
+ SameAs(const Prs3d_i* theOrigin);
+
+ //! Extends VISU_ColoredPrs3d_i::CreateActor
+ virtual
+ VISU_Actor*
+ CreateActor();
+
+ static const std::string myComment;
+
+ virtual
+ const char*
+ GetComment() const;
+
+ virtual
+ QString
+ GenerateName();
+ };
+}
+
+#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_Deformation_i.cc
// Author :
// Module : VISU
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_Deformation_i.hxx
// Author :
// Module : VISU
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_DeformedShapeAndScalarMap_i.cc
// Author : Eugeny Nikolaev
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_DeformedShapeAndScalarMap_i.hh
// Author: Eugeny Nikolaev
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.cxx
// Author : Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.hxx
// Author : Alexey PETROV
#ifndef VISU_DeformedShape_i_HeaderFile
#define VISU_DeformedShape_i_HeaderFile
-#include <VISU_I.hxx>
+#include "VISU_I.hxx"
#include "VISU_MonoColorPrs_i.hh"
class VISU_DeformedShapePL;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_DumpPython.cc
// Author : Alexey PETROV
#include "VISU_DeformedShape_i.hh"
#include "VISU_CutPlanes_i.hh"
#include "VISU_CutLines_i.hh"
+#include "VISU_CutSegment_i.hh"
#include "VISU_Vectors_i.hh"
#include "VISU_StreamLines_i.hh"
#include "VISU_Plot3D_i.hh"
#include "utilities.h"
#include <cctype>
-#include <strstream>
+#include <sstream>
#include <functional>
#include <QString>
{
//---------------------------------------------------------------------------
static std::string PREFIX(" ");
-
+
typedef std::map<std::string,std::string> TName2EntryMap;
typedef std::map<std::string,std::string> TEntry2NameMap;
-
-
+
+
//---------------------------------------------------------------------------
inline
std::string
GenerateName(std::string theName,
- SALOMEDS::SObject_ptr theSObject,
- TName2EntryMap& theName2EntryMap,
- TEntry2NameMap& theEntry2NameMap,
- char theSuffix)
+ SALOMEDS::SObject_ptr theSObject,
+ TName2EntryMap& theName2EntryMap,
+ TEntry2NameMap& theEntry2NameMap,
+ char theSuffix)
{
if(theName2EntryMap.find(theName) != theName2EntryMap.end()){
theName = GenerateName(theName + theSuffix, theSObject, theName2EntryMap, theEntry2NameMap, theSuffix);
theEntry2NameMap[anID.in()] = theName;
//cout<<"GenerateName - "<<theName<<" => "<<anID.in()<<endl;
}
-
+
return theName;
}
-
-
+
+
//---------------------------------------------------------------------------
struct TReplacePredicate
{
return !(isdigit(theChar) || isalpha(theChar) || theChar == '_');
}
};
-
-
+
+
//---------------------------------------------------------------------------
inline
std::string
GetName(SALOMEDS::SObject_ptr theSObject)
{
CORBA::String_var aString = theSObject->GetName();
-
+
std::string aName = QString(aString.in()).simplified().toLatin1().data();
-
+
//replace_if(aName.begin(),aName.end(),not1(ptr_fun(isxdigit)),'_');
replace_if(aName.begin(),aName.end(),TReplacePredicate(),'_');
-
+
if ( isdigit( aName[0] ))
aName.insert( 0, 1, 'a' );
-
+
return aName;
}
-
-
+
+
//---------------------------------------------------------------------------
inline
std::string
GenerateName(SALOMEDS::SObject_ptr theSObject,
- TName2EntryMap& theName2EntryMap,
- TEntry2NameMap& theEntry2NameMap)
+ TName2EntryMap& theName2EntryMap,
+ TEntry2NameMap& theEntry2NameMap)
{
std::string aName = GetName(theSObject);
-
+
return GenerateName(aName, theSObject, theName2EntryMap, theEntry2NameMap, 'X');
}
-
-
+
+
//---------------------------------------------------------------------------
inline
std::string
{
if(theArgument)
return "True";
-
+
return "False";
}
-
-
+
+
//---------------------------------------------------------------------------
inline
std::string
aStream<<"SALOMEDS.Color("<<theColor.R<<", "<<theColor.G<<", "<<theColor.B<<")";
return aStream.str();
}
-
-
+
+
//---------------------------------------------------------------------------
typedef void (*TDumpToPython)(SALOMEDS::Study_ptr theStudy,
- CORBA::Boolean theIsPublished,
- CORBA::Boolean& theIsValidScript,
- SALOMEDS::SObject_ptr theSObject,
- std::ostream& theStr,
- TName2EntryMap& theName2EntryMap,
- TEntry2NameMap& theEntry2NameMap,
- std::string theArgumentName,
- std::string thePrefix);
-
-
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript,
+ SALOMEDS::SObject_ptr theSObject,
+ std::ostream& theStr,
+ TName2EntryMap& theName2EntryMap,
+ TEntry2NameMap& theEntry2NameMap,
+ std::string theArgumentName,
+ std::string thePrefix);
+
+
void
DumpToPython(SALOMEDS::Study_ptr theStudy,
- CORBA::Boolean theIsPublished,
- CORBA::Boolean& theIsValidScript,
- SALOMEDS::SObject_ptr theSObject,
- std::ostream& theStr,
- TName2EntryMap& theName2EntryMap,
- TEntry2NameMap& theEntry2NameMap,
- std::string theArgumentName,
- std::string thePrefix);
-
-
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript,
+ SALOMEDS::SObject_ptr theSObject,
+ std::ostream& theStr,
+ TName2EntryMap& theName2EntryMap,
+ TEntry2NameMap& theEntry2NameMap,
+ std::string theArgumentName,
+ std::string thePrefix);
+
+
//---------------------------------------------------------------------------
void SetClippingPlane(Prs3d_i* thePrs, string theName,
- std::ostream& theStr,
- std::string thePrefix)
+ std::ostream& theStr,
+ std::string thePrefix)
{
VISU_CutPlaneFunction* aPlane;
VISU_Gen_i* aGen = VISU_Gen_i::GetVisuGenImpl();
for (int i = 0; i < thePrs->GetNumberOfClippingPlanes(); i++) {
aPlane = dynamic_cast<VISU_CutPlaneFunction*>(thePrs->GetClippingPlane(i));
if (aPlane) {
- if (!aPlane->isAuto()) {
- aId = aMgr.GetPlaneId(aPlane);
- if (aId > -1) {
- theStr<<thePrefix<<"aVisu.ApplyClippingPlane("<<theName<<", "<<aId<<")"<<endl;
- }
- }
+ if (!aPlane->isAuto()) {
+ aId = aMgr.GetPlaneId(aPlane);
+ if (aId > -1) {
+ theStr<<thePrefix<<"aVisu.ApplyClippingPlane("<<theName<<", "<<aId<<")"<<endl;
+ }
+ }
}
}
}
-
+
void
Prs3dToPython(VISU::Prs3d_i* theServant,
- std::ostream& theStr,
- const std::string& theName,
- std::string thePrefix)
+ std::ostream& theStr,
+ const std::string& theName,
+ std::string thePrefix)
{
float x, y, z;
theServant->GetOffset(x,y,z);
theStr<<thePrefix<<theName<<".SetOffset("<<x<<", "<<y<<", "<<z<<")"<<endl;
SetClippingPlane(theServant, theName, theStr, thePrefix);
+
+ VISU::MarkerType aMarkerType = theServant->GetMarkerType();
+ if( aMarkerType != VISU::MT_NONE ) {
+ if( aMarkerType != VISU::MT_USER ) {
+ VISU::MarkerScale aMarkerScale = theServant->GetMarkerScale();
+ std::string aParam1, aParam2;
+ switch( aMarkerType ) {
+ case MT_POINT: aParam1 = "MT_POINT"; break;
+ case MT_PLUS: aParam1 = "MT_PLUS"; break;
+ case MT_STAR: aParam1 = "MT_STAR"; break;
+ case MT_O: aParam1 = "MT_O"; break;
+ case MT_X: aParam1 = "MT_X"; break;
+ case MT_O_POINT: aParam1 = "MT_O_POINT"; break;
+ case MT_O_PLUS: aParam1 = "MT_O_PLUS"; break;
+ case MT_O_STAR: aParam1 = "MT_O_STAR"; break;
+ case MT_O_X: aParam1 = "MT_O_X"; break;
+ case MT_POINT_SPRITE: aParam1 = "MT_POINT_SPRITE"; break;
+ default: aParam1 = "MT_NONE"; break;
+ }
+ switch( aMarkerScale ) {
+ case MS_10: aParam2 = "MS_10"; break;
+ case MS_15: aParam2 = "MS_15"; break;
+ case MS_20: aParam2 = "MS_20"; break;
+ case MS_25: aParam2 = "MS_25"; break;
+ case MS_30: aParam2 = "MS_30"; break;
+ case MS_35: aParam2 = "MS_35"; break;
+ case MS_40: aParam2 = "MS_40"; break;
+ case MS_45: aParam2 = "MS_45"; break;
+ case MS_50: aParam2 = "MS_50"; break;
+ case MS_55: aParam2 = "MS_55"; break;
+ case MS_60: aParam2 = "MS_60"; break;
+ case MS_65: aParam2 = "MS_65"; break;
+ case MS_70: aParam2 = "MS_70"; break;
+ default: aParam2 = "MS_NONE"; break;
+ }
+ if( aMarkerType == MT_POINT_SPRITE )
+ aParam2 = "MS_NONE";
+ theStr<<thePrefix<<theName<<".SetMarkerStd(VISU."<<aParam1<<", VISU."<<aParam2<<")"<<endl;
+ }
+ else {
+ int aMarkerTexture = theServant->GetMarkerTexture();
+ if( aMarkerTexture >= 0 )
+ theStr<<thePrefix<<theName<<".SetMarkerTexture(texture_map["<<aMarkerTexture<<"])"<<endl;
+ }
+ }
}
-
+
//---------------------------------------------------------------------------
struct TColoredPrs3dFactory
{
virtual
std::string
operator()(std::ostream& theStr,
- std::string thePrefix)
+ std::string thePrefix)
{
-
+
return thePrefix;
}
};
-
-
+
+
struct TCreateFromResult: TColoredPrs3dFactory
{
VISU::ColoredPrs3d_i* myServant;
std::string myConstructorName;
std::string myArgumentName;
-
+
SALOMEDS::SObject_var mySObject;
std::string myName;
-
- TCreateFromResult(const SALOMEDS::SObject_var& theSObject,
- VISU::ColoredPrs3d_i* theServant,
- const std::string& theName,
- const std::string& theConstructorName,
- const std::string& theArgumentName):
- myServant(theServant),
- myConstructorName(theConstructorName),
- myArgumentName(theArgumentName),
- mySObject(theSObject),
- myName(theName)
- {}
+
+ TCreateFromResult(const SALOMEDS::SObject_ptr theSObject,
+ VISU::ColoredPrs3d_i* theServant,
+ const std::string& theName,
+ const std::string& theConstructorName,
+ const std::string& theArgumentName):
+ myServant(theServant),
+ myConstructorName(theConstructorName),
+ myArgumentName(theArgumentName),
+ myName(theName)
+ {
+ mySObject = SALOMEDS::SObject::_duplicate(theSObject);
+ }
virtual
std::string
operator()(std::ostream& theStr,
- std::string thePrefix)
+ std::string thePrefix)
{
std::string aParam;
switch(myServant->GetEntity()){
- case NODE:
- aParam = "VISU.NODE";
- break;
- case EDGE:
- aParam = "VISU.EDGE";
- break;
- case FACE:
- aParam = "VISU.FACE";
- break;
- case CELL:
- aParam = "VISU.CELL";
- break;
+ case NODE:
+ aParam = "VISU.NODE";
+ break;
+ case EDGE:
+ aParam = "VISU.EDGE";
+ break;
+ case FACE:
+ aParam = "VISU.FACE";
+ break;
+ case CELL:
+ aParam = "VISU.CELL";
+ break;
}
-
+
theStr<<thePrefix<<myName<<" = aVisu."<<myConstructorName<<"("<<myArgumentName<<
- ", '"<<myServant->GetCMeshName()<<"'"<<
- ", "<<aParam<<
- ", '"<<myServant->GetCFieldName()<<"'"<<
- ", "<<myServant->GetTimeStampNumber()<<
- ")"<<endl;
+ ", '"<<myServant->GetCMeshName()<<"'"<<
+ ", "<<aParam<<
+ ", '"<<myServant->GetCFieldName()<<"'"<<
+ ", "<<myServant->GetTimeStampNumber()<<
+ ")"<<endl;
theStr<<thePrefix<<"if "<<myName<<" != None:"<<endl;
thePrefix += PREFIX;
// Add to Name->Object map
theStr<<thePrefix<<"aName2ObjectMap['"<<myName<<"'] = "<<myName<<endl;
-
+
// Set name (as this object could be renamed by user)
CORBA::String_var aNameInStudy = mySObject->GetName();
theStr<<thePrefix<<"visu.SetName("<<myName<<", '"<<aNameInStudy.in()<<"')"<<endl;
-
+
return thePrefix;
}
};
-
-
+
+
//---------------------------------------------------------------------------
std::string
ColoredPrs3dToPython(SALOMEDS::SObject_ptr theSObject,
- VISU::ColoredPrs3d_i* theServant,
- std::ostream& theStr,
- const std::string& theName,
- TColoredPrs3dFactory& thePrsFactory,
- std::string thePrefix)
+ VISU::ColoredPrs3d_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
{
thePrefix = thePrsFactory(theStr, thePrefix);
-
+
// Set parameters common for all Prs3d objects (offset values)
Prs3dToPython(theServant, theStr, theName, thePrefix);
-
+
theStr<<thePrefix<<theName<<".SetPosition("<<theServant->GetPosX()<<", "<<theServant->GetPosY()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetSize("<<theServant->GetWidth()<<", "<<theServant->GetHeight()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetNbColors("<<theServant->GetNbColors()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetLabels("<<theServant->GetLabels()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetTitle('"<<theServant->GetTitle()<<"')"<<endl;
-
+
std::string aParam;
switch(theServant->GetBarOrientation()){
- case ColoredPrs3dBase::HORIZONTAL:
- aParam = "VISU.ColoredPrs3d.HORIZONTAL";
- break;
- case ColoredPrs3dBase::VERTICAL:
- aParam = "VISU.ColoredPrs3d.VERTICAL";
- break;
+ case ColoredPrs3dBase::HORIZONTAL:
+ aParam = "VISU.ColoredPrs3d.HORIZONTAL";
+ break;
+ case ColoredPrs3dBase::VERTICAL:
+ aParam = "VISU.ColoredPrs3d.VERTICAL";
+ break;
}
theStr<<thePrefix<<theName<<".SetBarOrientation("<<aParam<<")"<<endl;
-
+
theStr<<thePrefix<<theName<<".SetScalarMode("<<theServant->GetScalarMode()<<")"<<endl;
-
+
if(theServant->IsRangeFixed())
theStr<<thePrefix<<theName<<".SetRange("<<theServant->GetMin()<<", "<<theServant->GetMax()<<")"<<endl;
else
theStr<<thePrefix<<theName<<".SetSourceRange()"<<endl;
-
+
const VISU::ColoredPrs3d_i::TGroupNames aGroupNames = theServant->GetGroupNames();
VISU::ColoredPrs3d_i::TGroupNames::const_iterator anIter = aGroupNames.begin();
for(; anIter != aGroupNames.end(); anIter++){
return thePrefix;
}
-
-
+
+
//---------------------------------------------------------------------------
std::string
GaussPointsToPython(SALOMEDS::SObject_ptr theSObject,
- VISU::GaussPoints_i* theServant,
- std::ostream& theStr,
- const std::string& theName,
- TColoredPrs3dFactory& thePrsFactory,
- std::string thePrefix)
+ VISU::GaussPoints_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
{
thePrefix = ColoredPrs3dToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
theStr<<thePrefix<<endl;
-
+
bool aBoolean = theServant->GetIsActiveLocalScalarBar();
theStr<<thePrefix<<theName<<".SetIsActiveLocalScalarBar("<<GetBoolean(aBoolean)<<")"<<endl;
-
+
if(aBoolean){
aBoolean = theServant->GetIsDispGlobalScalarBar();
theStr<<thePrefix<<theName<<".SetIsDispGlobalScalarBar("<<GetBoolean(aBoolean)<<")"<<endl;
}
-
+
theStr<<thePrefix<<theName<<".SetSpacing("<<theServant->GetSpacing()<<")"<<endl;
-
+
aBoolean = theServant->GetBiColor();
theStr<<thePrefix<<theName<<".SetBiColor("<<GetBoolean(aBoolean)<<")"<<endl;
-
+
aBoolean = theServant->GetIsDeformed();
theStr<<thePrefix<<theName<<".SetIsDeformed("<<GetBoolean(aBoolean)<<")"<<endl;
theStr<<thePrefix<<theName<<".SetScaleFactor("<<theServant->GetScaleFactor()<<")"<<endl;
-
+
std::string aParam;
switch(theServant->GetPrimitiveType()){
- case VISU::GaussPoints::SPRITE :
- aParam = "VISU.GaussPoints.SPRITE";
- break;
- case VISU::GaussPoints::POINT :
- aParam = "VISU.GaussPoints.POINT";
- break;
- case VISU::GaussPoints::SPHERE :
- aParam = "VISU.GaussPoints.SPHERE";
- break;
+ case VISU::GaussPoints::SPRITE :
+ aParam = "VISU.GaussPoints.SPRITE";
+ break;
+ case VISU::GaussPoints::POINT :
+ aParam = "VISU.GaussPoints.POINT";
+ break;
+ case VISU::GaussPoints::SPHERE :
+ aParam = "VISU.GaussPoints.SPHERE";
+ break;
}
theStr<<thePrefix<<theName<<".SetPrimitiveType("<<aParam<<")"<<endl;
-
+
theStr<<thePrefix<<theName<<".SetClamp("<<theServant->GetClamp()<<")"<<endl;
-
+
QString aMainTexture = theServant->GetQMainTexture();
QString anAlphaTexture = theServant->GetQAlphaTexture();
theStr<<thePrefix<<theName<<".SetTextures('"<<aMainTexture.toLatin1().data()<<"', '"<<anAlphaTexture.toLatin1().data()<<"')"<<endl;
-
+
theStr<<thePrefix<<theName<<".SetAlphaThreshold("<<theServant->GetAlphaThreshold()<<")"<<endl;
-
+
theStr<<thePrefix<<theName<<".SetResolution("<<theServant->GetResolution()<<")"<<endl;
-
+
theStr<<thePrefix<<theName<<".SetFaceLimit("<<theServant->GetFaceLimit()<<")"<<endl;
-
+
aBoolean = theServant->GetIsColored();
theStr<<thePrefix<<theName<<".SetIsColored("<<GetBoolean(aBoolean)<<")"<<endl;
-
+
if(aBoolean){
theStr<<thePrefix<<theName<<".SetMinSize("<<theServant->GetMinSize()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetMaxSize("<<theServant->GetMaxSize()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetColor("<<GetColor(theServant->GetColor())<<")"<<endl;
theStr<<thePrefix<<theName<<".SetGeomSize("<<theServant->GetGeomSize()<<")"<<endl;
}
-
+
theStr<<thePrefix<<theName<<".SetMagnification("<<theServant->GetMagnification()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetMagnificationIncrement("<<theServant->GetMagnificationIncrement()<<")"<<endl;
-
+
+ std::string aVisible = theServant->IsBarVisible()? "True" : "False";
+ theStr<<thePrefix<<theName<<".SetBarVisible("<<aVisible<<")"<<endl;
+
return thePrefix;
}
-
-
+
+
//---------------------------------------------------------------------------
std::string
ScalarMapToPython(SALOMEDS::SObject_ptr theSObject,
- VISU::ScalarMap_i* theServant,
- std::ostream& theStr,
- const std::string& theName,
- TColoredPrs3dFactory& thePrsFactory,
- std::string thePrefix)
+ VISU::ScalarMap_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
{
thePrefix = ColoredPrs3dToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
theStr<<thePrefix<<endl;
-
+
std::string aParam;
switch(theServant->GetScaling()){
- case LINEAR:
- aParam = "VISU.LINEAR";
- break;
- case LOGARITHMIC:
- aParam = "VISU.LOGARITHMIC";
- break;
+ case LINEAR:
+ aParam = "VISU.LINEAR";
+ break;
+ case LOGARITHMIC:
+ aParam = "VISU.LOGARITHMIC";
+ break;
}
std::string aVisible = theServant->IsBarVisible()? "True" : "False";
theStr<<thePrefix<<theName<<".SetScaling("<<aParam<<")"<<endl;
theStr<<thePrefix<<theName<<".SetBarVisible("<<aVisible<<")"<<endl;
-
+
+ switch(theServant->GetGaussMetric()){
+ case AVERAGE:
+ aParam = "VISU.AVERAGE";
+ break;
+ case MINIMUM:
+ aParam = "VISU.MINIMUM";
+ break;
+ case MAXIMUM:
+ aParam = "VISU.MAXIMUM";
+ break;
+ }
+ theStr<<thePrefix<<theName<<".SetGaussMetric("<<aParam<<")"<<endl;
+
+ SALOMEDS::Color aColor = theServant->GetLinkColor();
+ theStr<<thePrefix<<theName<<".SetLinkColor(SALOMEDS.Color("<<
+ aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
+
+ if(theServant->IsRangeFixed())
+ theStr<<thePrefix<<theName<<".SetRange("<<theServant->GetMin()<<", "<<theServant->GetMax()<<")"<<endl;
+ else
+ theStr<<thePrefix<<theName<<".SetSourceRange()"<<endl;
+
return thePrefix;
}
-
+
//---------------------------------------------------------------------------
std::string
MonoColorPrsToPython(SALOMEDS::SObject_ptr theSObject,
- VISU::MonoColorPrs_i* theServant,
- std::ostream& theStr,
- const std::string& theName,
- TColoredPrs3dFactory& thePrsFactory,
- std::string thePrefix)
+ VISU::MonoColorPrs_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
{
thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
theStr<<thePrefix<<endl;
theStr<<thePrefix<<theName<<".SetColor("<<GetColor(theServant->GetColor())<<")"<<endl;
return thePrefix;
}
-
+
//---------------------------------------------------------------------------
std::string
DeformedShapeToPython(SALOMEDS::SObject_ptr theSObject,
- VISU::DeformedShape_i* theServant,
- std::ostream& theStr,
- const std::string& theName,
- TColoredPrs3dFactory& thePrsFactory,
- std::string thePrefix)
+ VISU::DeformedShape_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
{
thePrefix = MonoColorPrsToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
theStr<<thePrefix<<endl;
-
+
theStr<<thePrefix<<theName<<".SetScale("<<theServant->GetScale()<<")"<<endl;
-// theStr<<thePrefix<<theName<<".ShowColored("<<GetBoolean(theServant->IsColored())<<")"<<endl;
-// theStr<<thePrefix<<theName<<".SetColor("<<GetColor(theServant->GetColor())<<")"<<endl;
-
+ // theStr<<thePrefix<<theName<<".ShowColored("<<GetBoolean(theServant->IsColored())<<")"<<endl;
+ // theStr<<thePrefix<<theName<<".SetColor("<<GetColor(theServant->GetColor())<<")"<<endl;
+
return thePrefix;
}
-
-
+
+
//---------------------------------------------------------------------------
std::string
StreamLinesToPython(SALOMEDS::SObject_ptr theSObject,
- VISU::StreamLines_i* theServant,
- std::ostream& theStr,
- TEntry2NameMap& theEntry2NameMap,
- const std::string& theName,
- TColoredPrs3dFactory& thePrsFactory,
- std::string thePrefix)
+ VISU::StreamLines_i* theServant,
+ std::ostream& theStr,
+ TEntry2NameMap& theEntry2NameMap,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
{
thePrefix = MonoColorPrsToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
// thePrefix = DeformedShapeToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
std::string aParam;
switch(theServant->GetDirection()){
- case StreamLines::FORWARD:
- aParam = "VISU.StreamLines.FORWARD";
- break;
- case StreamLines::BACKWARD:
- aParam = "VISU.StreamLines.BACKWARD";
- break;
- case StreamLines::BOTH:
- aParam = "VISU.StreamLines.BOTH";
- break;
+ case StreamLines::FORWARD:
+ aParam = "VISU.StreamLines.FORWARD";
+ break;
+ case StreamLines::BACKWARD:
+ aParam = "VISU.StreamLines.BACKWARD";
+ break;
+ case StreamLines::BOTH:
+ aParam = "VISU.StreamLines.BOTH";
+ break;
}
theStr<<thePrefix<<"aPrs3d = None"<<endl;
VISU::Prs3d_var aPrs3d = theServant->GetSource();
if(!CORBA::is_nil(aPrs3d)){
if(Prs3d_i* aServant3d = dynamic_cast<Prs3d_i*>(GetServant(aPrs3d).in())){
- SALOMEDS::SObject_var aSObject = aServant3d->GetSObject();
- CORBA::String_var anID = aSObject->GetID();
- std::string anArg = theEntry2NameMap[anID.in()];
- theStr<<thePrefix<<"if aName2ObjectMap.has_key('"<<anArg<<"'):"<<endl;
- thePrefix += PREFIX;
- theStr<<thePrefix<<"aPrs3d = aName2ObjectMap['"<<anArg<<"']"<<endl;
+ SALOMEDS::SObject_var aSObject = aServant3d->GetSObject();
+ CORBA::String_var anID = aSObject->GetID();
+ std::string anArg = theEntry2NameMap[anID.in()];
+ theStr<<thePrefix<<"if aName2ObjectMap.has_key('"<<anArg<<"'):"<<endl;
+ thePrefix += PREFIX;
+ theStr<<thePrefix<<"aPrs3d = aName2ObjectMap['"<<anArg<<"']"<<endl;
}
}
theStr<<thePrefix<<theName<<".SetParams("<<
- theServant->GetIntegrationStep()<<", "<<
- theServant->GetPropagationTime()<<", "<<
- theServant->GetStepLength()<<", "<<
- "aPrs3d"<<", "<<
- theServant->GetUsedPoints()<<", "<<
- aParam<<
- ")"<<endl;
+ theServant->GetIntegrationStep()<<", "<<
+ theServant->GetPropagationTime()<<", "<<
+ theServant->GetStepLength()<<", "<<
+ "aPrs3d"<<", "<<
+ theServant->GetUsedPoints()<<", "<<
+ aParam<<
+ ")"<<endl;
return thePrefix;
}
-
-
+
+
//---------------------------------------------------------------------------
std::string
DeformedShapeAndScalarMapToPython(SALOMEDS::SObject_ptr theSObject,
- VISU::DeformedShapeAndScalarMap_i* theServant,
- std::ostream& theStr,
- const std::string& theName,
- TColoredPrs3dFactory& thePrsFactory,
- std::string thePrefix)
+ VISU::DeformedShapeAndScalarMap_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
{
thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
theStr<<thePrefix<<endl;
-
+
theStr<<thePrefix<<theName<<".SetRange("<<theServant->GetMin()<<", "<<theServant->GetMax()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetScale("<<theServant->GetScale()<<")"<<endl;
-
+
std::string aParam;
VISU::Entity anEntity = theServant->GetScalarEntity();
switch(anEntity){
- case NODE:
- aParam = "VISU.NODE";
- break;
- case EDGE:
- aParam = "VISU.EDGE";
- break;
- case FACE:
- aParam = "VISU.FACE";
- break;
- case CELL:
- aParam = "VISU.CELL";
- break;
+ case NODE:
+ aParam = "VISU.NODE";
+ break;
+ case EDGE:
+ aParam = "VISU.EDGE";
+ break;
+ case FACE:
+ aParam = "VISU.FACE";
+ break;
+ case CELL:
+ aParam = "VISU.CELL";
+ break;
}
CORBA::String_var aFieldName = theServant->GetScalarFieldName();
CORBA::Long aTimeStampNumber = theServant->GetScalarTimeStampNumber();
theStr<<thePrefix<<theName<<".SetScalarField("<<
- aParam<<", "<<
- "'"<<aFieldName<<"', "<<
- aTimeStampNumber<<
- ")"<<endl;
-
+ aParam<<", "<<
+ "'"<<aFieldName<<"', "<<
+ aTimeStampNumber<<
+ ")"<<endl;
+
return thePrefix;
}
-
-
+
+
//---------------------------------------------------------------------------
std::string
VectorsToPython(SALOMEDS::SObject_ptr theSObject,
- VISU::Vectors_i* theServant,
- std::ostream& theStr,
- const std::string& theName,
- TColoredPrs3dFactory& thePrsFactory,
- std::string thePrefix)
+ VISU::Vectors_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
{
thePrefix = DeformedShapeToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
theStr<<thePrefix<<endl;
-
+
theStr<<thePrefix<<theName<<".SetLineWidth("<<theServant->GetLineWidth()<<")"<<endl;
-
+
std::string aParam;
switch(theServant->GetGlyphType()){
- case Vectors::ARROW:
- aParam = "VISU.Vectors.ARROW";
- break;
- case Vectors::CONE2:
- aParam = "VISU.Vectors.CONE2";
- break;
- case Vectors::CONE6:
- aParam = "VISU.Vectors.CONE6";
- break;
- case Vectors::NONE:
- aParam = "VISU.Vectors.NONE";
- break;
+ case Vectors::ARROW:
+ aParam = "VISU.Vectors.ARROW";
+ break;
+ case Vectors::CONE2:
+ aParam = "VISU.Vectors.CONE2";
+ break;
+ case Vectors::CONE6:
+ aParam = "VISU.Vectors.CONE6";
+ break;
+ case Vectors::NONE:
+ aParam = "VISU.Vectors.NONE";
+ break;
}
theStr<<thePrefix<<theName<<".SetGlyphType("<<aParam<<")"<<endl;
switch(theServant->GetGlyphPos()){
- case Vectors::CENTER:
- aParam = "VISU.Vectors.CENTER";
- break;
- case Vectors::TAIL:
- aParam = "VISU.Vectors.TAIL";
- break;
- case Vectors::HEAD:
- aParam = "VISU.Vectors.HEAD";
- break;
+ case Vectors::CENTER:
+ aParam = "VISU.Vectors.CENTER";
+ break;
+ case Vectors::TAIL:
+ aParam = "VISU.Vectors.TAIL";
+ break;
+ case Vectors::HEAD:
+ aParam = "VISU.Vectors.HEAD";
+ break;
}
theStr<<thePrefix<<theName<<".SetGlyphPos("<<aParam<<")"<<endl;
return thePrefix;
}
-
-
+
+
//---------------------------------------------------------------------------
std::string
IsoSurfacesToPython(SALOMEDS::SObject_ptr theSObject,
- VISU::IsoSurfaces_i* theServant,
- std::ostream& theStr,
- const std::string& theName,
- TColoredPrs3dFactory& thePrsFactory,
- std::string thePrefix)
+ VISU::IsoSurfaces_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
{
thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
theStr<<thePrefix<<endl;
-
+
theStr<<thePrefix<<theName<<".SetNbSurfaces("<<theServant->GetNbSurfaces()<<")"<<endl;
theStr<<thePrefix<<theName<<".ShowLabels("<<theServant->IsLabeled()<<","<<theServant->GetNbLabels()<<")"<<endl;
-
+
return thePrefix;
}
-
-
+
+
//---------------------------------------------------------------------------
std::string
CutPlanesToPython(SALOMEDS::SObject_ptr theSObject,
- VISU::CutPlanes_i* theServant,
- std::ostream& theStr,
- const std::string& theName,
- TColoredPrs3dFactory& thePrsFactory,
- std::string thePrefix)
+ VISU::CutPlanes_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
{
thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
theStr<<thePrefix<<endl;
-
+
std::string aParam;
switch(theServant->GetOrientationType()){
- case CutPlanes::XY:
- aParam = "VISU.CutPlanes.XY";
- break;
- case CutPlanes::YZ:
- aParam = "VISU.CutPlanes.YZ";
- break;
- case CutPlanes::ZX:
- aParam = "VISU.CutPlanes.ZX";
- break;
+ case CutPlanes::XY:
+ aParam = "VISU.CutPlanes.XY";
+ break;
+ case CutPlanes::YZ:
+ aParam = "VISU.CutPlanes.YZ";
+ break;
+ case CutPlanes::ZX:
+ aParam = "VISU.CutPlanes.ZX";
+ break;
}
theStr<<thePrefix<<theName<<".SetOrientation("<<aParam<<", "<<theServant->GetRotateX()<<", "<<theServant->GetRotateY()<<")"<<endl;
for(CORBA::Long anId = 0; anId < aNbPlanes; anId++){
if(!theServant->IsDefault(anId))
- theStr<<thePrefix<<theName<<".SetPlanePosition("<<anId<<", "<<theServant->GetPlanePosition(anId)<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetPlanePosition("<<anId<<", "<<theServant->GetPlanePosition(anId)<<")"<<endl;
}
-
+
theStr<<thePrefix<<theName<<".UseDeformation("<<GetBoolean(theServant->IsDeformed())<<")"<<endl;
if(theServant->IsDeformed()){
theStr<< thePrefix << theName << ".SetScale(" << theServant->GetScale()<<")"<<endl;
std::string aStringEntity;
VISU::Entity anEntity = theServant->GetVectorialFieldEntity();
switch(anEntity){
- case NODE:
- aStringEntity = "VISU.NODE";
- break;
- case EDGE:
- aStringEntity = "VISU.EDGE";
- break;
- case FACE:
- aStringEntity = "VISU.FACE";
- break;
- case CELL:
- aStringEntity = "VISU.CELL";
- break;
+ case NODE:
+ aStringEntity = "VISU.NODE";
+ break;
+ case EDGE:
+ aStringEntity = "VISU.EDGE";
+ break;
+ case FACE:
+ aStringEntity = "VISU.FACE";
+ break;
+ case CELL:
+ aStringEntity = "VISU.CELL";
+ break;
}
theStr<< thePrefix << theName << ".SetVectorialField("<<aStringEntity<<", '" << theServant->GetVectorialFieldName() <<"')"<<endl;
}
return thePrefix;
}
-
-
+
+
//---------------------------------------------------------------------------
std::string
CutLinesToPython(SALOMEDS::SObject_ptr theSObject,
- VISU::CutLines_i* theServant,
- std::ostream& theStr,
- const std::string& theName,
- TColoredPrs3dFactory& thePrsFactory,
- std::string thePrefix)
+ VISU::CutLines_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
{
thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
theStr<<thePrefix<<endl;
-
+
std::string aParam;
switch(theServant->GetOrientationType()){
- case CutPlanes::XY:
- aParam = "VISU.CutPlanes.XY";
- break;
- case CutPlanes::YZ:
- aParam = "VISU.CutPlanes.YZ";
- break;
- case CutPlanes::ZX:
- aParam = "VISU.CutPlanes.ZX";
- break;
+ case CutPlanes::XY:
+ aParam = "VISU.CutPlanes.XY";
+ break;
+ case CutPlanes::YZ:
+ aParam = "VISU.CutPlanes.YZ";
+ break;
+ case CutPlanes::ZX:
+ aParam = "VISU.CutPlanes.ZX";
+ break;
}
theStr<<thePrefix<<theName<<".SetOrientation("<<aParam<<", "<<theServant->GetRotateX()<<", "<<theServant->GetRotateY()<<")"<<endl;
switch(theServant->GetOrientationType2()){
- case CutPlanes::XY:
- aParam = "VISU.CutPlanes.XY";
- break;
- case CutPlanes::YZ:
- aParam = "VISU.CutPlanes.YZ";
- break;
- case CutPlanes::ZX:
- aParam = "VISU.CutPlanes.ZX";
- break;
+ case CutPlanes::XY:
+ aParam = "VISU.CutPlanes.XY";
+ break;
+ case CutPlanes::YZ:
+ aParam = "VISU.CutPlanes.YZ";
+ break;
+ case CutPlanes::ZX:
+ aParam = "VISU.CutPlanes.ZX";
+ break;
}
theStr<<thePrefix<<theName<<".SetOrientation2("<<aParam<<", "<<theServant->GetRotateX2()<<", "<<theServant->GetRotateY2()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetNbLines("<<aNbLines<<")"<<endl;
for(CORBA::Long anId = 0; anId < aNbLines; anId++){
if(!theServant->IsDefaultPosition(anId))
- theStr<<thePrefix<<theName<<".SetLinePosition("<<anId<<", "<<theServant->GetLinePosition(anId)<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetLinePosition("<<anId<<", "<<theServant->GetLinePosition(anId)<<")"<<endl;
}
return thePrefix;
}
-
-
+
+
+ //---------------------------------------------------------------------------
+ std::string
+ CutSegmentToPython(SALOMEDS::SObject_ptr theSObject,
+ VISU::CutSegment_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
+ {
+ thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+ theStr<<thePrefix<<endl;
+
+ double x1, y1, z1, x2, y2, z2;
+ theServant->GetPoint1(x1, y1, z1);
+ theServant->GetPoint2(x2, y2, z2);
+ theStr<<thePrefix<<theName<<".SetPoint1("<<x1<<", "<<y1<<", "<<z1<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetPoint2("<<x2<<", "<<y2<<", "<<z2<<")"<<endl;
+
+ CORBA::Boolean aUseAbsLength = theServant->IsUseAbsoluteLength();
+ theStr<<thePrefix<<theName<<".SetUseAbsoluteLength("<<aUseAbsLength<<")"<<endl;
+
+ return thePrefix;
+ }
+
+
//---------------------------------------------------------------------------
std::string
Plot3DToPython(SALOMEDS::SObject_ptr theSObject,
- VISU::Plot3D_i* theServant,
- std::ostream& theStr,
- const std::string& theName,
- TColoredPrs3dFactory& thePrsFactory,
- std::string thePrefix)
+ VISU::Plot3D_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
{
thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
theStr<<thePrefix<<endl;
-
+
std::string aParam;
switch(theServant->GetOrientationType()){
- case CutPlanes::XY:
- aParam = "VISU.Plot3D.XY";
- break;
- case CutPlanes::YZ:
- aParam = "VISU.Plot3D.YZ";
- break;
- case CutPlanes::ZX:
- aParam = "VISU.Plot3D.ZX";
- break;
+ case CutPlanes::XY:
+ aParam = "VISU.Plot3D.XY";
+ break;
+ case CutPlanes::YZ:
+ aParam = "VISU.Plot3D.YZ";
+ break;
+ case CutPlanes::ZX:
+ aParam = "VISU.Plot3D.ZX";
+ break;
}
theStr<<thePrefix<<theName<<".SetOrientation("<<aParam<<", "<<theServant->GetRotateX()<<", "<<theServant->GetRotateY()<<")"<<endl;
-
+
theStr<<thePrefix<<theName<<".SetPlanePosition("<<theServant->GetPlanePosition()<<", "<<theServant->IsPositionRelative()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetScaleFactor("<<theServant->GetScaleFactor()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetContourPrs("<<theServant->GetIsContourPrs()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetNbOfContours("<<theServant->GetNbOfContours()<<")"<<endl;
-
+
return thePrefix;
}
-
+
//---------------------------------------------------------------------------
// declaration
void DumpChildrenToPython(SALOMEDS::Study_ptr theStudy,
- CORBA::Boolean theIsPublished,
- CORBA::Boolean& theIsValidScript,
- SALOMEDS::SObject_ptr theSObject,
- std::ostream& theStr,
- TName2EntryMap& theName2EntryMap,
- TEntry2NameMap& theEntry2NameMap,
- std::string theArgumentName,
- std::string thePrefix);
-
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript,
+ SALOMEDS::SObject_ptr theSObject,
+ std::ostream& theStr,
+ TName2EntryMap& theName2EntryMap,
+ TEntry2NameMap& theEntry2NameMap,
+ std::string theArgumentName,
+ std::string thePrefix);
+
//---------------------------------------------------------------------------
template<class TTableAttr>
void
TableAttrToPython(SALOMEDS::Study_ptr theStudy,
- CORBA::Boolean theIsPublished,
- CORBA::Boolean& theIsValidScript,
- SALOMEDS::SObject_ptr theSObject,
- TTableAttr theTableAttr,
- const std::string& theAttrName,
- std::ostream& theStr,
- TName2EntryMap& theName2EntryMap,
- TEntry2NameMap& theEntry2NameMap,
- std::string theArgumentName,
- std::string thePrefix)
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript,
+ SALOMEDS::SObject_ptr theSObject,
+ TTableAttr theTableAttr,
+ const std::string& theAttrName,
+ std::ostream& theStr,
+ TName2EntryMap& theName2EntryMap,
+ TEntry2NameMap& theEntry2NameMap,
+ std::string theArgumentName,
+ std::string thePrefix)
{
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::SObject_var aFatherSObject = theSObject->GetFather();
if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){
SALOMEDS::AttributeString_var aComment =
- SALOMEDS::AttributeString::_narrow(anAttr);
+ SALOMEDS::AttributeString::_narrow(anAttr);
CORBA::String_var aValue = aComment->Value();
Storable::TRestoringMap aMap;
Storable::StringToMap(aValue.in(),aMap);
bool anIsExist;
QString aMethodName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist);
if(anIsExist){
- if(strcmp(aMethodName.toLatin1().data(),"ImportTables") == 0){
- return;
- }
+ if(strcmp(aMethodName.toLatin1().data(),"ImportTables") == 0){
+ return;
+ }
}
}
-
+
std::string aSObjectName = GetName(theSObject);
- theStr<<thePrefix<<aSObjectName<<" = aBuilder.NewObject(aSComponent)"<<endl;
+ if(theArgumentName.empty())
+ theArgumentName = "aSComponent";
+ theStr<<thePrefix<<aSObjectName<<" = aBuilder.NewObject("<<theArgumentName<<")"<<endl;
theStr<<thePrefix<<"if "<<aSObjectName<<":"<<endl;
thePrefix += PREFIX;
-
+
theStr<<thePrefix<<"aBuilder.SetName("<<aSObjectName<<", \""<<theSObject->GetName()<<"\")"<<endl; // Fix for IPAL13165
std::string aName = "aTableAttr";
theStr<<thePrefix<<aName<<" = aBuilder.FindOrCreateAttribute("<<
- aSObjectName<<", '"<<theAttrName<<"')"<<endl;
-
+ aSObjectName<<", '"<<theAttrName<<"')"<<endl;
+
theStr<<thePrefix<<"if "<<aName<<":"<<endl;
std::string aPrefix = thePrefix;
thePrefix += PREFIX;
-
+
CORBA::String_var aString = theTableAttr->GetTitle();
theStr<<thePrefix<<aName<<".SetTitle('"<<aString.in()<<"')"<<endl;
-
+
CORBA::Long aNbColumns = theTableAttr->GetNbColumns();
theStr<<thePrefix<<aName<<".SetNbColumns("<<aNbColumns<<")"<<endl;
-
+
CORBA::Long aNbRows = theTableAttr->GetNbRows();
-
+
// push values and their indices into streams
- strstream values, rows, columns;
+ stringstream values, rows, columns;
string comma = "";
for(CORBA::Long i = 1; i <= aNbColumns; i++){
for(CORBA::Long j = aNbRows; j > 0; j--){
- if(theTableAttr->HasValue(j,i)){
- values << comma << theTableAttr->GetValue(j,i);
+ if(theTableAttr->HasValue(j,i)){
+ values << comma << theTableAttr->GetValue(j,i);
rows << comma << j;
columns << comma << i;
if ( comma.empty() )
comma = ",";
- }
+ }
}
}
// push titles and units into streams
- strstream rowUnits, rowTitles, colTitles;
+ stringstream rowUnits, rowTitles, colTitles;
SALOMEDS::StringSeq_var aRowUnits = theTableAttr->GetRowUnits();
SALOMEDS::StringSeq_var aRowTitles = theTableAttr->GetRowTitles();
comma = "";
if ( comma.empty() )
comma = ",";
}
+ /*
values << '\0';
rows << '\0';
columns << '\0';
rowUnits << '\0';
rowTitles << '\0';
colTitles << '\0';
+ */
// write FillTable command
theStr<< thePrefix << aName << "_values = [" << values.str() << "]" << endl;
theStr<< thePrefix << aName << "_rows = [" << rows.str() << "]" << endl;
theStr<< thePrefix << aName << "_rTitles = [" << rowTitles.str() << "]" << endl;
theStr<< thePrefix << aName << "_cTitles = [" << colTitles.str() << "]" << endl;
theStr<< thePrefix << "visu.FillTable( "
- << aName << ", "
- << aName << "_values, "
- << aName << "_rows, "
- << aName << "_columns, "
- << aName << "_rTitles, "
- << aName << "_rUnits, "
- << aName << "_cTitles )" << endl;
-
+ << aName << ", "
+ << aName << "_values, "
+ << aName << "_rows, "
+ << aName << "_columns, "
+ << aName << "_rTitles, "
+ << aName << "_rUnits, "
+ << aName << "_cTitles )" << endl;
+
if(theSObject->FindAttribute(anAttr,"AttributeIOR")){
theStr<<thePrefix<<endl;
std::string aName = "aTable";
theStr<<thePrefix<<"anID = "<<aSObjectName<<".GetID()"<<endl;
theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
theArgumentName = aName;
-
+
theStr<<thePrefix<<"if "<<aName<<":"<<endl;
std::string aPrefix2 = thePrefix + PREFIX;
-
+
// Set name (as this object could be renamed by user)
CORBA::String_var aNameInStudy = theSObject->GetName();
theStr<<aPrefix2<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 1"<<endl;
-
+
DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- aPrefix2);
-
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ aPrefix2);
+
theStr<<aPrefix2<<"pass"<<endl<<endl;
}
-
+
theStr<<thePrefix<<"pass"<<endl<<endl;
theStr<<aPrefix<<"pass"<<endl<<endl;
}
-
-
+
+
//---------------------------------------------------------------------------
void
DumpChildrenToPython(SALOMEDS::Study_ptr theStudy,
- CORBA::Boolean theIsPublished,
- CORBA::Boolean& theIsValidScript,
- SALOMEDS::SObject_ptr theSObject,
- std::ostream& theStr,
- TName2EntryMap& theName2EntryMap,
- TEntry2NameMap& theEntry2NameMap,
- std::string theArgumentName,
- std::string thePrefix)
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript,
+ SALOMEDS::SObject_ptr theSObject,
+ std::ostream& theStr,
+ TName2EntryMap& theName2EntryMap,
+ TEntry2NameMap& theEntry2NameMap,
+ std::string theArgumentName,
+ std::string thePrefix)
{
SALOMEDS::ChildIterator_var aChildItet = theStudy->NewChildIterator(theSObject);
for(aChildItet->InitEx(false); aChildItet->More(); aChildItet->Next()){
SALOMEDS::SObject_var aSObject = aChildItet->Value();
DumpToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- aSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
+ theIsPublished,
+ theIsValidScript,
+ aSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
}
}
-
-
+
+
//---------------------------------------------------------------------------
void
DumpTableAttrToPython(SALOMEDS::Study_ptr theStudy,
- CORBA::Boolean theIsPublished,
- CORBA::Boolean& theIsValidScript,
- SALOMEDS::SObject_ptr theSObject,
- std::ostream& theStr,
- TName2EntryMap& theName2EntryMap,
- TEntry2NameMap& theEntry2NameMap,
- std::string theArgumentName,
- std::string thePrefix)
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript,
+ SALOMEDS::SObject_ptr theSObject,
+ std::ostream& theStr,
+ TName2EntryMap& theName2EntryMap,
+ TEntry2NameMap& theEntry2NameMap,
+ std::string theArgumentName,
+ std::string thePrefix)
{
SALOMEDS::GenericAttribute_var anAttr;
if(theSObject->FindAttribute(anAttr,"AttributeTableOfInteger")){
SALOMEDS::AttributeTableOfInteger_var aTableAttr =
- SALOMEDS::AttributeTableOfInteger::_narrow(anAttr);
-
+ SALOMEDS::AttributeTableOfInteger::_narrow(anAttr);
+
TableAttrToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- aTableAttr,
- "AttributeTableOfInteger",
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
-
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ aTableAttr,
+ "AttributeTableOfInteger",
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
}else if(theSObject->FindAttribute(anAttr,"AttributeTableOfReal")){
SALOMEDS::AttributeTableOfReal_var aTableAttr =
- SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
-
+ SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
+
TableAttrToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- aTableAttr,
- "AttributeTableOfReal",
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ aTableAttr,
+ "AttributeTableOfReal",
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
}
}
-
-
-
+
+
+
//---------------------------------------------------------------------------
void
DumpToPython(SALOMEDS::Study_ptr theStudy,
- CORBA::Boolean theIsPublished,
- CORBA::Boolean& theIsValidScript,
- SALOMEDS::SObject_ptr theSObject,
- std::ostream& theStr,
- TName2EntryMap& theName2EntryMap,
- TEntry2NameMap& theEntry2NameMap,
- std::string theArgumentName,
- std::string thePrefix)
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript,
+ SALOMEDS::SObject_ptr theSObject,
+ std::ostream& theStr,
+ TName2EntryMap& theName2EntryMap,
+ TEntry2NameMap& theEntry2NameMap,
+ std::string theArgumentName,
+ std::string thePrefix)
{
std::string aName = GetName(theSObject);
if (aName == "")
return;
-
+
CORBA::String_var anID = theSObject->GetID();
CORBA::String_var aNameInStudy = theSObject->GetName();
-
+
CORBA::Object_var anObj = SObjectToObject(theSObject);
if (!CORBA::is_nil(anObj)) {
VISU::Base_var aBase = VISU::Base::_narrow(anObj);
if(!CORBA::is_nil(aBase)){
- std::string aName = GenerateName(theSObject, theName2EntryMap, theEntry2NameMap);
-
+ std::string aName = GenerateName(theSObject, theName2EntryMap, theEntry2NameMap);
+
VISU::VISUType aType = aBase->GetType();
switch(aType){
- case VISU::TRESULT:
- if(Result_i* aServant = dynamic_cast<Result_i*>(GetServant(anObj).in())){
- std::string aFileName = aServant->GetInitFileName();
- Result_i::ECreationId anId = aServant->GetCreationId();
- if(anId == Result_i::eImportFile || anId == Result_i::eCopyAndImportFile){
- switch(anId){
- case Result_i::eImportFile:
- theStr<<thePrefix<<aName<<" = aVisu.CreateResult('"<<aFileName<<"')"<<endl;
-
- theStr<<thePrefix<<aName<<".SetBuildGroups("<<
- GetBoolean(aServant->IsGroupsDone())<<")"<<
- endl;
-
- theStr<<thePrefix<<aName<<".SetBuildFields("<<
- GetBoolean(aServant->IsFieldsDone())<<", "<<
- GetBoolean(aServant->IsMinMaxDone())<<")"<<
- endl;
-
- theStr<<thePrefix<<aName<<".Build(False, True)"<<endl;
-
- theStr<<thePrefix<<"if "<<aName<<".IsDone() :"<<endl;
- break;
- case Result_i::eCopyAndImportFile:
- theStr<<thePrefix<<aName<<" = aVisu.CopyAndImportFile('"<<aFileName<<"')"<<endl;
- theStr<<thePrefix<<"if "<<aName<<":"<<endl;
- break;
- }
-
- thePrefix += PREFIX;
- {
- VISU::Result::EntityNames_var aMeshNames = aServant->GetMeshNames();
- if (aMeshNames->length() > 0) {
- for(size_t aMeshId = 0; aMeshId < aMeshNames->length(); aMeshId++){
- CORBA::String_var aMeshName = aMeshNames[aMeshId];
- VISU::Result::EntityNames_var aParts = aServant->GetPartNames(aMeshName);
- if (aParts->length() > 0) {
- for(size_t aPartId = 0; aPartId < aParts->length(); aPartId++){
- CORBA::String_var aPart = aParts[aPartId];
- VISU::Result::Resolution aResolution = aServant->GetResolution(aMeshName, aPart);
- std::string aParam;
- switch(aResolution){
- case VISU::Result::FULL:
- aParam = "VISU.Result.FULL";
- break;
- case VISU::Result::MEDIUM:
- aParam = "VISU.Result.MEDIUM";
- break;
- case VISU::Result::LOW:
- aParam = "VISU.Result.LOW";
- break;
- case VISU::Result::HIDDEN:
- aParam = "VISU.Result.HIDDEN";
- break;
- }
- theStr<<thePrefix<<aName<<".SetResolution('"<<aMeshName.in()<<"', '"<<aPart.in()<<"', "<<aParam<<")"<<endl;
- }
- theStr<<thePrefix<<endl;
- }
- }
- }
- }
-
- theArgumentName = aName;
- DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
-
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }else{
- SALOMEDS::SObject_var aRefSObj;
- if(theSObject->FindSubObject(1,aRefSObj)){
- SALOMEDS::SObject_var aTargetRefSObj;
- if(aRefSObj->ReferencedObject(aTargetRefSObj)){
- CORBA::String_var aString = aTargetRefSObj->GetName();
- theStr<<thePrefix<<"aSObject = theStudy.FindObject('"<<aString.in()<<"')"<<endl;
- theStr<<thePrefix<<"if aSObject:"<<endl;
- thePrefix += PREFIX;
- theStr<<thePrefix<<"anObject = aSObject.GetObject()"<<endl;
- theStr<<thePrefix<<"if anObject:"<<endl;
- std::string aPrefix1 = thePrefix;
- thePrefix += PREFIX;
-
- switch(anId){
- case Result_i::eImportMed:
- theStr<<thePrefix<<aName<<" = aVisu.ImportMed(aSObject)"<<endl;
- break;
- case Result_i::eImportMedField:
- theStr<<thePrefix<<aName<<" = aVisu.ImportMedField(anObject)"<<endl;
- break;
- }
-
- theStr<<thePrefix<<"if "<<aName<<":"<<endl;
- std::string aPrefix2 = thePrefix;
- thePrefix += PREFIX;
-
- theArgumentName = aName;
- DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
-
- theStr<<thePrefix<<"pass"<<endl<<endl;
- theStr<<aPrefix2<<"pass"<<endl<<endl;
- theStr<<aPrefix1<<"pass"<<endl<<endl;
- }
- }
- }
- }
- return;
- case VISU::TMESH:
- if(Mesh_i* aServant = dynamic_cast<Mesh_i*>(GetServant(anObj).in())){
- VISU::Entity anEntity = aServant->GetEntity();
- const std::string& aSubMeshName = aServant->GetSubMeshName();
- if(anEntity >= 0){
- std::string aParam;
- switch(anEntity){
- case NODE:
- aParam = "VISU.NODE";
- break;
- case EDGE:
- aParam = "VISU.EDGE";
- break;
- case FACE:
- aParam = "VISU.FACE";
- break;
- case CELL:
- aParam = "VISU.CELL";
- break;
- }
-
- if(aSubMeshName == "")
- theStr<<thePrefix<<aName<<" = aVisu.MeshOnEntity("<<theArgumentName<<
- ", '"<<aServant->GetCMeshName()<<"'"<<
- ", "<<aParam<<
- ")"<<endl;
- else
- theStr<<thePrefix<<aName<<" = aVisu.FamilyMeshOnEntity("<<theArgumentName<<
- ", '"<<aServant->GetCMeshName()<<"'"<<
- ", "<<aParam<<
- ", '"<<aSubMeshName<<"'"<<
- ")"<<endl;
- }else
- theStr<<thePrefix<<aName<<" = aVisu.GroupMesh("<<theArgumentName<<
- ", '"<<aServant->GetCMeshName()<<"'"<<
- ", '"<<aSubMeshName<<"'"<<
- ")"<<endl;
-
- theStr<<thePrefix<<"if "<<aName<<":"<<endl;
- thePrefix += PREFIX;
-
- // Add to Name->Object map
- theStr<<thePrefix<<"aName2ObjectMap['"<<aName<<"'] = "<<aName<<endl;
-
- // Set name (as this object could be renamed by user)
- theStr<<thePrefix<<"visu.SetName("<<aName<<", '"<<aNameInStudy.in()<<"')"<<endl;
-
- // Set parameters common for all Prs3d objects (offset values)
- Prs3dToPython(aServant,theStr,aName,thePrefix);
-
- // Set presentation parameters
- SALOMEDS::Color aColor;
- aColor = aServant->GetCellColor();
- theStr<<thePrefix<<aName<<".SetCellColor(SALOMEDS.Color("<<
- aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
-
- aColor = aServant->GetNodeColor();
- theStr<<thePrefix<<aName<<".SetNodeColor(SALOMEDS.Color("<<
- aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
-
- aColor = aServant->GetLinkColor();
- theStr<<thePrefix<<aName<<".SetLinkColor(SALOMEDS.Color("<<
- aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
-
- std::string aParam;
- switch(aServant->GetPresentationType()){
- case POINT:
- aParam = "VISU.POINT";
- break;
- case WIREFRAME:
- aParam = "VISU.WIREFRAME";
- break;
- case SHADED:
- aParam = "VISU.SHADED";
- break;
- case INSIDEFRAME:
- aParam = "VISU.INSIDEFRAME";
- break;
- case SURFACEFRAME:
- aParam = "VISU.SURFACEFRAME";
- break;
- case SHRINK:
- aParam = "VISU.SHRINK";
- break;
- }
- theStr<<thePrefix<<aName<<".SetPresentationType("<<aParam<<")"<<endl;
- theStr<<thePrefix<<aName<<".SetShrink("<<(aServant->IsShrank()? "True" : "False")<<")"<<endl;
- theStr<<thePrefix<<endl;
-
- DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
-
- theStr<<thePrefix<<"pass"<<endl<<endl;
- return;
- }
- break;
- case VISU::TSCALARMAP:
- if(ScalarMap_i* aServant = dynamic_cast<ScalarMap_i*>(GetServant(anObj).in())){
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "ScalarMapOnField", theArgumentName);
- thePrefix = ScalarMapToPython(theSObject, aServant, theStr,aName, aPrsFactory, thePrefix);
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TDEFORMEDSHAPE:
- if(DeformedShape_i* aServant = dynamic_cast<DeformedShape_i*>(GetServant(anObj).in())){
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "DeformedShapeOnField", theArgumentName);
- thePrefix = DeformedShapeToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TSTREAMLINES:
- if(StreamLines_i* aServant = dynamic_cast<StreamLines_i*>(GetServant(anObj).in())){
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "StreamLinesOnField", theArgumentName);
- thePrefix = StreamLinesToPython(theSObject, aServant, theStr, theEntry2NameMap, aName, aPrsFactory, thePrefix);
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TSCALARMAPONDEFORMEDSHAPE:
- case VISU::TDEFORMEDSHAPEANDSCALARMAP:
- if(DeformedShapeAndScalarMap_i* aServant = dynamic_cast<DeformedShapeAndScalarMap_i*>(GetServant(anObj).in())){
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "DeformedShapeAndScalarMapOnField", theArgumentName);
- thePrefix = DeformedShapeAndScalarMapToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TVECTORS:
- if(Vectors_i* aServant = dynamic_cast<Vectors_i*>(GetServant(anObj).in())){
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "VectorsOnField", theArgumentName);
- thePrefix = VectorsToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TISOSURFACES:
- if(IsoSurfaces_i* aServant = dynamic_cast<IsoSurfaces_i*>(GetServant(anObj).in())){
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "IsoSurfacesOnField", theArgumentName);
- thePrefix = IsoSurfacesToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TCUTPLANES:
- if(CutPlanes_i* aServant = dynamic_cast<CutPlanes_i*>(GetServant(anObj).in())){
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "CutPlanesOnField", theArgumentName);
- thePrefix = CutPlanesToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TCUTLINES:
- if(CutLines_i* aServant = dynamic_cast<CutLines_i*>(GetServant(anObj).in())){
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "CutLinesOnField", theArgumentName);
- thePrefix = CutLinesToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
-
- theArgumentName = aName;
- DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
-
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TPLOT3D:
- if (Plot3D_i* aServant = dynamic_cast<Plot3D_i*>(GetServant(anObj).in())) {
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "Plot3DOnField", theArgumentName);
- thePrefix = Plot3DToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TPOINTMAP3D:
- if (PointMap3d_i* aServant = dynamic_cast<PointMap3d_i*>(GetServant(anObj).in())) {
- CORBA::Short aTag = theSObject->Tag();
- theStr<<thePrefix<<"anIsFound, aSObject = "<<theArgumentName<<".FindSubObject("<<aTag<<")"<<endl;
- theStr<<thePrefix<<"if anIsFound:"<<endl;
- thePrefix += PREFIX;
-
- theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
- theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
-
- // Set name (as this object could be renamed by user)
- theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 3"<<endl;
-
- // Set PointMap3D Properties
-
- theStr<<thePrefix<<aName<<".SetScaleFactor("<<aServant->GetScaleFactor()<<")"<<endl;
- theStr<<thePrefix<<aName<<".SetContourPrs("<<aServant->GetIsContourPrs()<<")"<<endl;
- theStr<<thePrefix<<aName<<".SetNbOfContours("<<aServant->GetNbOfContours()<<")"<<endl;
-
- std::string aParam;
- switch(aServant->GetScaling()){
- case LINEAR:
- aParam = "VISU.LINEAR";
- break;
- case LOGARITHMIC:
- aParam = "VISU.LOGARITHMIC";
- break;
- }
- theStr<<thePrefix<<aName<<".SetScaling("<<aParam<<")"<<endl;
-
- theStr<<thePrefix<<aName<<".SetNbColors("<<aServant->GetNbColors()<<")"<<endl;
- theStr<<thePrefix<<aName<<".SetLabels("<<aServant->GetLabels()<<")"<<endl;
-
- switch(aServant->GetBarOrientation()){
- case ColoredPrs3dBase::HORIZONTAL:
- aParam = "VISU.ColoredPrs3d.HORIZONTAL";
- break;
- case ColoredPrs3dBase::VERTICAL:
- aParam = "VISU.ColoredPrs3d.VERTICAL";
- break;
- }
- theStr<<thePrefix<<aName<<".SetBarOrientation("<<aParam<<")"<<endl;
-
- if(aServant->IsRangeFixed())
- theStr<<thePrefix<<aName<<".SetRange("<<aServant->GetMin()<<", "<<aServant->GetMax()<<")"<<endl;
- else
- theStr<<thePrefix<<aName<<".SetSourceRange()"<<endl;
-
- theStr<<thePrefix<<aName<<".SetPosition("<<aServant->GetPosX()<<", "<<aServant->GetPosY()<<")"<<endl;
- theStr<<thePrefix<<aName<<".SetSize("<<aServant->GetWidth()<<", "<<aServant->GetHeight()<<")"<<endl;
-
- float dx, dy, dz;
- aServant->GetOffset(dx, dy, dz);
- theStr<<thePrefix<<aName<<".SetOffset("<<dx<<", "<<dy<<", "<<dz<<")"<<endl;
-
-
- theStr<<thePrefix<<endl;
-
- theArgumentName = aName;
- DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
-
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TGAUSSPOINTS:
- if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(GetServant(anObj).in())){
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "GaussPointsOnField", theArgumentName);
- thePrefix = GaussPointsToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TCURVE:
- if(Curve_i* aServant = dynamic_cast<Curve_i*>(GetServant(anObj).in()))
- {
- bool withZ = aServant->GetZRow()>0;
-
- theStr << thePrefix << "aName2ObjectMap['" << aName << "'] = visu.CreateCurve";
- if( withZ )
- theStr << "WithZ";
- theStr << "(" <<
+ case VISU::TRESULT:
+ if(Result_i* aServant = dynamic_cast<Result_i*>(GetServant(anObj).in())){
+ std::string aFileName = aServant->GetInitFileName();
+ Result_i::ECreationId anId = aServant->GetCreationId();
+ if(anId == Result_i::eImportFile || anId == Result_i::eCopyAndImportFile){
+ switch(anId){
+ case Result_i::eImportFile:
+ theStr<<thePrefix<<aName<<" = aVisu.CreateResult('"<<aFileName<<"')"<<endl;
+
+ theStr<<thePrefix<<aName<<".SetBuildGroups("<<
+ GetBoolean(aServant->IsGroupsDone())<<")"<<
+ endl;
+
+ theStr<<thePrefix<<aName<<".SetBuildFields("<<
+ GetBoolean(aServant->IsFieldsDone())<<", "<<
+ GetBoolean(aServant->IsMinMaxDone())<<")"<<
+ endl;
+
+ theStr<<thePrefix<<aName<<".Build(False, True)"<<endl;
+
+ theStr<<thePrefix<<"if "<<aName<<".IsDone() :"<<endl;
+ break;
+ case Result_i::eCopyAndImportFile:
+ theStr<<thePrefix<<aName<<" = aVisu.CopyAndImportFile('"<<aFileName<<"')"<<endl;
+ theStr<<thePrefix<<"if "<<aName<<":"<<endl;
+ break;
+ }
+
+ thePrefix += PREFIX;
+ {
+ VISU::Result::EntityNames_var aMeshNames = aServant->GetMeshNames();
+ if (aMeshNames->length() > 0) {
+ for(size_t aMeshId = 0; aMeshId < aMeshNames->length(); aMeshId++){
+ CORBA::String_var aMeshName = aMeshNames[aMeshId];
+ VISU::Result::EntityNames_var aParts = aServant->GetPartNames(aMeshName);
+ if (aParts->length() > 0) {
+ for(size_t aPartId = 0; aPartId < aParts->length(); aPartId++){
+ CORBA::String_var aPart = aParts[aPartId];
+ VISU::Result::Resolution aResolution = aServant->GetResolution(aMeshName, aPart);
+ std::string aParam;
+ switch(aResolution){
+ case VISU::Result::FULL:
+ aParam = "VISU.Result.FULL";
+ break;
+ case VISU::Result::MEDIUM:
+ aParam = "VISU.Result.MEDIUM";
+ break;
+ case VISU::Result::LOW:
+ aParam = "VISU.Result.LOW";
+ break;
+ case VISU::Result::HIDDEN:
+ aParam = "VISU.Result.HIDDEN";
+ break;
+ }
+ theStr<<thePrefix<<aName<<".SetResolution('"<<aMeshName.in()<<"', '"<<aPart.in()<<"', "<<aParam<<")"<<endl;
+ }
+ theStr<<thePrefix<<endl;
+ }
+ }
+ }
+ }
+
+ theArgumentName = aName;
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }else{
+ SALOMEDS::SObject_var aRefSObj;
+ if(theSObject->FindSubObject(1,aRefSObj)){
+ SALOMEDS::SObject_var aTargetRefSObj;
+ if(aRefSObj->ReferencedObject(aTargetRefSObj)){
+ CORBA::String_var aString = aTargetRefSObj->GetName();
+ theStr<<thePrefix<<"aSObject = theStudy.FindObject('"<<aString.in()<<"')"<<endl;
+ theStr<<thePrefix<<"if aSObject:"<<endl;
+ thePrefix += PREFIX;
+ theStr<<thePrefix<<"anObject = aSObject.GetObject()"<<endl;
+ theStr<<thePrefix<<"if anObject:"<<endl;
+ std::string aPrefix1 = thePrefix;
+ thePrefix += PREFIX;
+
+ switch(anId){
+ case Result_i::eImportMed:
+ theStr<<thePrefix<<aName<<" = aVisu.ImportMed(aSObject)"<<endl;
+ break;
+ case Result_i::eImportMedField:
+ theStr<<thePrefix<<aName<<" = aVisu.ImportMedField(anObject)"<<endl;
+ break;
+ }
+
+ theStr<<thePrefix<<"if "<<aName<<":"<<endl;
+ std::string aPrefix2 = thePrefix;
+ thePrefix += PREFIX;
+
+ theArgumentName = aName;
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ theStr<<aPrefix2<<"pass"<<endl<<endl;
+ theStr<<aPrefix1<<"pass"<<endl<<endl;
+ }
+ }
+ }
+ }
+ return;
+ case VISU::TMESH:
+ if(Mesh_i* aServant = dynamic_cast<Mesh_i*>(GetServant(anObj).in())){
+ VISU::Entity anEntity = aServant->GetEntity();
+ const std::string& aSubMeshName = aServant->GetSubMeshName();
+ if(anEntity >= 0){
+ std::string aParam;
+ switch(anEntity){
+ case NODE:
+ aParam = "VISU.NODE";
+ break;
+ case EDGE:
+ aParam = "VISU.EDGE";
+ break;
+ case FACE:
+ aParam = "VISU.FACE";
+ break;
+ case CELL:
+ aParam = "VISU.CELL";
+ break;
+ }
+
+ if(aSubMeshName == "")
+ theStr<<thePrefix<<aName<<" = aVisu.MeshOnEntity("<<theArgumentName<<
+ ", '"<<aServant->GetCMeshName()<<"'"<<
+ ", "<<aParam<<
+ ")"<<endl;
+ else
+ theStr<<thePrefix<<aName<<" = aVisu.FamilyMeshOnEntity("<<theArgumentName<<
+ ", '"<<aServant->GetCMeshName()<<"'"<<
+ ", "<<aParam<<
+ ", '"<<aSubMeshName<<"'"<<
+ ")"<<endl;
+ }else
+ theStr<<thePrefix<<aName<<" = aVisu.GroupMesh("<<theArgumentName<<
+ ", '"<<aServant->GetCMeshName()<<"'"<<
+ ", '"<<aSubMeshName<<"'"<<
+ ")"<<endl;
+
+ theStr<<thePrefix<<"if "<<aName<<":"<<endl;
+ thePrefix += PREFIX;
+
+ // Add to Name->Object map
+ theStr<<thePrefix<<"aName2ObjectMap['"<<aName<<"'] = "<<aName<<endl;
+
+ // Set name (as this object could be renamed by user)
+ theStr<<thePrefix<<"visu.SetName("<<aName<<", '"<<aNameInStudy.in()<<"')"<<endl;
+
+ // Set parameters common for all Prs3d objects (offset values)
+ Prs3dToPython(aServant,theStr,aName,thePrefix);
+
+ // Set presentation parameters
+ SALOMEDS::Color aColor;
+ aColor = aServant->GetCellColor();
+ theStr<<thePrefix<<aName<<".SetCellColor(SALOMEDS.Color("<<
+ aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
+
+ aColor = aServant->GetNodeColor();
+ theStr<<thePrefix<<aName<<".SetNodeColor(SALOMEDS.Color("<<
+ aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
+
+ aColor = aServant->GetLinkColor();
+ theStr<<thePrefix<<aName<<".SetLinkColor(SALOMEDS.Color("<<
+ aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
+
+ std::string aParam;
+ switch(aServant->GetPresentationType()){
+ case POINT:
+ aParam = "VISU.POINT";
+ break;
+ case WIREFRAME:
+ aParam = "VISU.WIREFRAME";
+ break;
+ case SHADED:
+ aParam = "VISU.SHADED";
+ break;
+ case INSIDEFRAME:
+ aParam = "VISU.INSIDEFRAME";
+ break;
+ case SURFACEFRAME:
+ aParam = "VISU.SURFACEFRAME";
+ break;
+ case SHRINK:
+ aParam = "VISU.SHRINK";
+ break;
+ }
+ theStr<<thePrefix<<aName<<".SetPresentationType("<<aParam<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetShrink("<<(aServant->IsShrank()? "True" : "False")<<")"<<endl;
+ theStr<<thePrefix<<endl;
+
+ std::string aQuad2DPresent;
+ switch(aServant->GetQuadratic2DPresentationType()){
+ case LINES:
+ aQuad2DPresent = "VISU.LINES";
+ break;
+ case ARCS:
+ aQuad2DPresent = "VISU.ARCS";
+ break;
+ }
+
+ theStr<<thePrefix<<aName<<".SetQuadratic2DPresentationType("<<aQuad2DPresent<<")"<<endl;
+
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ return;
+ }
+ break;
+ case VISU::TSCALARMAP:
+ if(ScalarMap_i* aServant = dynamic_cast<ScalarMap_i*>(GetServant(anObj).in())){
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "ScalarMapOnField", theArgumentName);
+ thePrefix = ScalarMapToPython(theSObject, aServant, theStr,aName, aPrsFactory, thePrefix);
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TDEFORMEDSHAPE:
+ if(DeformedShape_i* aServant = dynamic_cast<DeformedShape_i*>(GetServant(anObj).in())){
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "DeformedShapeOnField", theArgumentName);
+ thePrefix = DeformedShapeToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TSTREAMLINES:
+ if(StreamLines_i* aServant = dynamic_cast<StreamLines_i*>(GetServant(anObj).in())){
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "StreamLinesOnField", theArgumentName);
+ thePrefix = StreamLinesToPython(theSObject, aServant, theStr, theEntry2NameMap, aName, aPrsFactory, thePrefix);
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TSCALARMAPONDEFORMEDSHAPE:
+ case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+ if(DeformedShapeAndScalarMap_i* aServant = dynamic_cast<DeformedShapeAndScalarMap_i*>(GetServant(anObj).in())){
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "DeformedShapeAndScalarMapOnField", theArgumentName);
+ thePrefix = DeformedShapeAndScalarMapToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TVECTORS:
+ if(Vectors_i* aServant = dynamic_cast<Vectors_i*>(GetServant(anObj).in())){
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "VectorsOnField", theArgumentName);
+ thePrefix = VectorsToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TISOSURFACES:
+ if(IsoSurfaces_i* aServant = dynamic_cast<IsoSurfaces_i*>(GetServant(anObj).in())){
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "IsoSurfacesOnField", theArgumentName);
+ thePrefix = IsoSurfacesToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TCUTPLANES:
+ if(CutPlanes_i* aServant = dynamic_cast<CutPlanes_i*>(GetServant(anObj).in())){
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "CutPlanesOnField", theArgumentName);
+ thePrefix = CutPlanesToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TCUTLINES:
+ if(CutLines_i* aServant = dynamic_cast<CutLines_i*>(GetServant(anObj).in())){
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "CutLinesOnField", theArgumentName);
+ thePrefix = CutLinesToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+
+ theArgumentName = aName;
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TCUTSEGMENT:
+ if(CutSegment_i* aServant = dynamic_cast<CutSegment_i*>(GetServant(anObj).in())){
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "CutSegmentOnField", theArgumentName);
+ thePrefix = CutSegmentToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+
+ theArgumentName = aName;
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TPLOT3D:
+ if (Plot3D_i* aServant = dynamic_cast<Plot3D_i*>(GetServant(anObj).in())) {
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "Plot3DOnField", theArgumentName);
+ thePrefix = Plot3DToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TPOINTMAP3D:
+ if (PointMap3d_i* aServant = dynamic_cast<PointMap3d_i*>(GetServant(anObj).in())) {
+
+ SALOMEDS::GenericAttribute_var anAttr;
+ if(theSObject->FindAttribute(anAttr,"AttributeString")){
+ using namespace SALOMEDS;
+ AttributeString_var aComment = AttributeString::_narrow(anAttr);
+ CORBA::String_var aValue = aComment->Value();
+ Storable::TRestoringMap aMap;
+ Storable::StringToMap(aValue.in(),aMap);
+ bool anIsExist;
+ QString aSourceId = VISU::Storable::FindValue(aMap,"mySourceId",&anIsExist);
+ if(anIsExist) {
+ if( aSourceId == "TableAttr" ) {
+ DumpTableAttrToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+ }
+ }
+ }
+
+ CORBA::Short aTag = theSObject->Tag();
+ theStr<<thePrefix<<"anIsFound, aSObject = "<<(theArgumentName.empty() ? "aSComponent" : theArgumentName)<<".FindSubObject("<<aTag<<")"<<endl;
+ theStr<<thePrefix<<"if anIsFound:"<<endl;
+ thePrefix += PREFIX;
+
+ theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
+ theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
+
+ // Set name (as this object could be renamed by user)
+ theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 3"<<endl;
+
+ // Set PointMap3D Properties
+
+ theStr<<thePrefix<<aName<<".SetScaleFactor("<<aServant->GetScaleFactor()<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetContourPrs("<<aServant->GetIsContourPrs()<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetNbOfContours("<<aServant->GetNbOfContours()<<")"<<endl;
+
+ std::string aParam;
+ switch(aServant->GetScaling()){
+ case LINEAR:
+ aParam = "VISU.LINEAR";
+ break;
+ case LOGARITHMIC:
+ aParam = "VISU.LOGARITHMIC";
+ break;
+ }
+ theStr<<thePrefix<<aName<<".SetScaling("<<aParam<<")"<<endl;
+
+ theStr<<thePrefix<<aName<<".SetNbColors("<<aServant->GetNbColors()<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetLabels("<<aServant->GetLabels()<<")"<<endl;
+
+ switch(aServant->GetBarOrientation()){
+ case ColoredPrs3dBase::HORIZONTAL:
+ aParam = "VISU.ColoredPrs3d.HORIZONTAL";
+ break;
+ case ColoredPrs3dBase::VERTICAL:
+ aParam = "VISU.ColoredPrs3d.VERTICAL";
+ break;
+ }
+ theStr<<thePrefix<<aName<<".SetBarOrientation("<<aParam<<")"<<endl;
+
+ if(aServant->IsRangeFixed())
+ theStr<<thePrefix<<aName<<".SetRange("<<aServant->GetMin()<<", "<<aServant->GetMax()<<")"<<endl;
+ else
+ theStr<<thePrefix<<aName<<".SetSourceRange()"<<endl;
+
+ theStr<<thePrefix<<aName<<".SetPosition("<<aServant->GetPosX()<<", "<<aServant->GetPosY()<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetSize("<<aServant->GetWidth()<<", "<<aServant->GetHeight()<<")"<<endl;
+
+ float dx, dy, dz;
+ aServant->GetOffset(dx, dy, dz);
+ theStr<<thePrefix<<aName<<".SetOffset("<<dx<<", "<<dy<<", "<<dz<<")"<<endl;
+
+
+ theStr<<thePrefix<<endl;
+
+ theArgumentName = aName;
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TGAUSSPOINTS:
+ if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(GetServant(anObj).in())){
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "GaussPointsOnField", theArgumentName);
+ thePrefix = GaussPointsToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TCURVE:
+ if(Curve_i* aServant = dynamic_cast<Curve_i*>(GetServant(anObj).in()))
+ {
+ bool withZ = aServant->GetZRow()>0;
+ bool isV2 = aServant->GetIsV2();
+
+ theStr << thePrefix << "aName2ObjectMap['" << aName << "'] = visu.CreateCurve";
+ if( isV2 )
+ theStr << "WithZExt";
+ else if( withZ )
+ theStr << "WithZ";
+ theStr << "(" <<
theArgumentName<< // table
", "<<aServant->GetHRow()<< // H row
- ", "<<aServant->GetVRow(); // V row
- if( withZ )
- theStr << ", " << aServant->GetZRow(); // Z row
-
- theStr << ", '"<<aServant->GetTitle()<<"'"; // title
- SALOMEDS::Color aColor = aServant->GetColor();
- theStr << ",SALOMEDS.Color("<<
- aColor.R<<", "<<aColor.G<<", "<<aColor.B<<")"; // color
-
- std::string aParam;
- switch(aServant->GetMarker()){
- case Curve::NONE: aParam = "VISU.Curve.NONE"; break;
- case Curve::CIRCLE: aParam = "VISU.Curve.CIRCLE"; break;
- case Curve::RECTANGLE: aParam = "VISU.Curve.RECTANGLE"; break;
- case Curve::DIAMOND: aParam = "VISU.Curve.DIAMOND"; break;
- case Curve::DTRIANGLE: aParam = "VISU.Curve.DTRIANGLE"; break;
- case Curve::UTRIANGLE: aParam = "VISU.Curve.UTRIANGLE"; break;
- case Curve::LTRIANGLE: aParam = "VISU.Curve.LTRIANGLE"; break;
- case Curve::RTRIANGLE: aParam = "VISU.Curve.RTRIANGLE"; break;
- case Curve::CROSS: aParam = "VISU.Curve.CROSS"; break;
- case Curve::XCROSS: aParam = "VISU.Curve.XCROSS"; break;
- }
- theStr<<", "<<aParam; // marker
-
- switch(aServant->GetLine()){
- case Curve::VOIDLINE: aParam = "VISU.Curve.VOIDLINE"; break;
- case Curve::SOLIDLINE: aParam = "VISU.Curve.SOLIDLINE"; break;
- case Curve::DASHLINE: aParam = "VISU.Curve.DASHLINE"; break;
- case Curve::DOTLINE: aParam = "VISU.Curve.DOTLINE"; break;
- case Curve::DASHDOTLINE: aParam = "VISU.Curve.DASHDOTLINE"; break;
- case Curve::DASHDOTDOTLINE: aParam = "VISU.Curve.DASHDOTDOTLINE"; break;
- }
- theStr<<", "<<aParam<<", "<<aServant->GetLineWidth()<<")"<<endl; // line type,width
- }
- return;
- case VISU::TTABLE:
- if(dynamic_cast<Table_i*>(GetServant(anObj).in())){
- SALOMEDS::GenericAttribute_var anAttr;
- if(theSObject->FindAttribute(anAttr,"AttributeString")){
- using namespace SALOMEDS;
- AttributeString_var aComment = AttributeString::_narrow(anAttr);
- CORBA::String_var aValue = aComment->Value();
- Storable::TRestoringMap aMap;
- Storable::StringToMap(aValue.in(),aMap);
- bool anIsExist;
- QString aSourceId = VISU::Storable::FindValue(aMap,"mySourceId",&anIsExist);
- if(anIsExist){
- if( aSourceId == "CutLines" ){
- theStr<<thePrefix<<"if aName2ObjectMap.has_key('"<<theArgumentName<<"'):"<<endl;
- thePrefix += PREFIX;
-
- theStr<<thePrefix<<"anObject = aName2ObjectMap['"<<theArgumentName<<"']"<<endl;
- theStr<<thePrefix<<"anIOR = anObject.GetID()"<<endl;
- theStr<<thePrefix<<"aSObject = theStudy.FindObjectIOR(anIOR)"<<endl;
- theStr<<thePrefix<<"if aSObject:"<<endl;
- std::string aPrefix = thePrefix;
- thePrefix += PREFIX;
-
- theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
- theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
-
- // Set name (as this object could be renamed by user)
- theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 2"<<endl;
-
- theStr<<thePrefix<<endl;
-
- theArgumentName = aName;
- DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
-
- theStr<<thePrefix<<"pass"<<endl<<endl;
- theStr<<aPrefix<<"pass"<<endl<<endl;
- }else if( aSourceId == "TableFile" ){
- CORBA::Short aTag = theSObject->Tag();
- theStr<<thePrefix<<"anIsFound, aSObject = "<<theArgumentName<<".FindSubObject("<<aTag<<")"<<endl;
- theStr<<thePrefix<<"if anIsFound:"<<endl;
- thePrefix += PREFIX;
-
- theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
- theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
-
- // Set name (as this object could be renamed by user)
- theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 3"<<endl;
-
- theStr<<thePrefix<<endl;
-
- theArgumentName = aName;
- DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
-
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }else if( aSourceId == "TableAttr" ){
- theArgumentName = aName;
- DumpTableAttrToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
- }
- }
- }
- }
- return;
- }
+ ", "<<aServant->GetVRow(); // V row
+ if( withZ || isV2 )
+ theStr << ", " << aServant->GetZRow(); // Z row
+ if( isV2 )
+ theStr << ", " << aServant->GetIsV2(); // right axis
+
+ theStr << ", '"<<aServant->GetTitle()<<"'"; // title
+ SALOMEDS::Color aColor = aServant->GetColor();
+ theStr << ",SALOMEDS.Color("<<
+ aColor.R<<", "<<aColor.G<<", "<<aColor.B<<")"; // color
+
+ std::string aParam;
+ switch(aServant->GetMarker()){
+ case Curve::NONE: aParam = "VISU.Curve.NONE"; break;
+ case Curve::CIRCLE: aParam = "VISU.Curve.CIRCLE"; break;
+ case Curve::RECTANGLE: aParam = "VISU.Curve.RECTANGLE"; break;
+ case Curve::DIAMOND: aParam = "VISU.Curve.DIAMOND"; break;
+ case Curve::DTRIANGLE: aParam = "VISU.Curve.DTRIANGLE"; break;
+ case Curve::UTRIANGLE: aParam = "VISU.Curve.UTRIANGLE"; break;
+ case Curve::LTRIANGLE: aParam = "VISU.Curve.LTRIANGLE"; break;
+ case Curve::RTRIANGLE: aParam = "VISU.Curve.RTRIANGLE"; break;
+ case Curve::CROSS: aParam = "VISU.Curve.CROSS"; break;
+ case Curve::XCROSS: aParam = "VISU.Curve.XCROSS"; break;
+ }
+ theStr<<", "<<aParam; // marker
+
+ switch(aServant->GetLine()){
+ case Curve::VOIDLINE: aParam = "VISU.Curve.VOIDLINE"; break;
+ case Curve::SOLIDLINE: aParam = "VISU.Curve.SOLIDLINE"; break;
+ case Curve::DASHLINE: aParam = "VISU.Curve.DASHLINE"; break;
+ case Curve::DOTLINE: aParam = "VISU.Curve.DOTLINE"; break;
+ case Curve::DASHDOTLINE: aParam = "VISU.Curve.DASHDOTLINE"; break;
+ case Curve::DASHDOTDOTLINE: aParam = "VISU.Curve.DASHDOTDOTLINE"; break;
+ }
+ theStr<<", "<<aParam<<", "<<aServant->GetLineWidth()<<")"<<endl; // line type,width
+ }
+ return;
+ case VISU::TTABLE:
+ if(dynamic_cast<Table_i*>(GetServant(anObj).in())){
+ SALOMEDS::GenericAttribute_var anAttr;
+ if(theSObject->FindAttribute(anAttr,"AttributeString")){
+ using namespace SALOMEDS;
+ AttributeString_var aComment = AttributeString::_narrow(anAttr);
+ CORBA::String_var aValue = aComment->Value();
+ Storable::TRestoringMap aMap;
+ Storable::StringToMap(aValue.in(),aMap);
+ bool anIsExist;
+ QString aSourceId = VISU::Storable::FindValue(aMap,"mySourceId",&anIsExist);
+ if(anIsExist){
+ if( aSourceId == "CutLines" ){
+ theStr<<thePrefix<<"if aName2ObjectMap.has_key('"<<theArgumentName<<"'):"<<endl;
+ thePrefix += PREFIX;
+
+ theStr<<thePrefix<<"anObject = aName2ObjectMap['"<<theArgumentName<<"']"<<endl;
+ theStr<<thePrefix<<"anIOR = anObject.GetID()"<<endl;
+ theStr<<thePrefix<<"aSObject = theStudy.FindObjectIOR(anIOR)"<<endl;
+ theStr<<thePrefix<<"if aSObject:"<<endl;
+ std::string aPrefix = thePrefix;
+ thePrefix += PREFIX;
+
+ theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
+ theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
+
+ // Set name (as this object could be renamed by user)
+ theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 2"<<endl;
+
+ theStr<<thePrefix<<endl;
+
+ theArgumentName = aName;
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ theStr<<aPrefix<<"pass"<<endl<<endl;
+ }else if( aSourceId == "TableFile" ){
+ CORBA::Short aTag = theSObject->Tag();
+ theStr<<thePrefix<<"anIsFound, aSObject = "<<theArgumentName<<".FindSubObject("<<aTag<<")"<<endl;
+ theStr<<thePrefix<<"if anIsFound:"<<endl;
+ thePrefix += PREFIX;
+
+ theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
+ theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
+
+ // Set name (as this object could be renamed by user)
+ theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 3"<<endl;
+
+ theStr<<thePrefix<<endl;
+
+ theArgumentName = aName;
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }else if( aSourceId == "TableAttr" ){
+ //theArgumentName = aName;
+ DumpTableAttrToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+ }
+ }
+ }
+ }
+ return;
+ }
}
} else { /*if(!CORBA::is_nil(anObj))*/
SALOMEDS::GenericAttribute_var anAttr;
if (theSObject->FindAttribute(anAttr,"AttributeString")) {
- SALOMEDS::AttributeString_var aComment =
- SALOMEDS::AttributeString::_narrow(anAttr);
- CORBA::String_var aValue = aComment->Value();
- Storable::TRestoringMap aMap;
- Storable::StringToMap(aValue.in(),aMap);
- bool anIsExist;
- QString aTypeName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist);
- if (anIsExist) {
- if (aTypeName == "ImportTables") {
- QString aFileName = VISU::Storable::FindValue(aMap,"myFileName",&anIsExist);
- if(anIsExist){
- std::string aName = GenerateName(theSObject,theName2EntryMap,theEntry2NameMap);
- theStr<<thePrefix<<aName<<" = aVisu.ImportTables('"<<aFileName.toLatin1().data()<<"')"<<endl;
- theStr<<thePrefix<<"if "<<aName<<":"<<endl;
- thePrefix += PREFIX;
-
- theArgumentName = aName;
- DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
-
- theStr<<thePrefix<<"pass"<<endl<<endl;
- return;
- }
- } else if (aTypeName == "VIEW3D") {
- std::string aName = GetName(theSObject);
- theStr<<thePrefix<<aName<<" = aBuilder.NewObject(aSComponent)"<<endl;
-
- theStr<<thePrefix<<"if "<<aName<<":"<<endl;
- thePrefix += PREFIX;
-
- theStr<<thePrefix<<"anAttr = aBuilder.FindOrCreateAttribute("<<aName<<",'AttributeName')"<<endl;
- theStr<<thePrefix<<"anAttr.SetValue('"<<aName<<"')"<<endl;
-
- theStr<<thePrefix<<"anAttr = aBuilder.FindOrCreateAttribute("<<aName<<",'AttributeString')"<<endl;
- theStr<<thePrefix<<"anAttr.SetValue('"<<aValue.in()<<"')"<<endl;
-
- theStr<<thePrefix<<"pass"<<endl<<endl;
- return;
- } else if (aTypeName == "ENTITY" || aTypeName == "FAMILY" || aTypeName == "GROUP") {
- // Set name (as this object could be renamed by user)
- string aMeshName = VISU::Storable::FindValue(aMap,"myMeshName").toLatin1().data();
- string aSubMeshName = VISU::Storable::FindValue(aMap,"myName").toLatin1().data();
- string anEntityTypeKey = "myEntityId";
- if (aTypeName == "ENTITY") anEntityTypeKey = "myId";
- int anEntity = VISU::Storable::FindValue(aMap,anEntityTypeKey,"0").toInt();
- std::string anEntityType;
- switch ((TEntity)anEntity) {
- case NODE_ENTITY: anEntityType = "VISU.NODE"; break;
- case EDGE_ENTITY: anEntityType = "VISU.EDGE"; break;
- case FACE_ENTITY: anEntityType = "VISU.FACE"; break;
- case CELL_ENTITY: anEntityType = "VISU.CELL"; break;
- }
-
- if (aTypeName == "ENTITY" ) {
- theStr<<thePrefix<<"aVisu.RenameEntityInStudy("<<theArgumentName<<", '"<<aMeshName
- <<"', "<<anEntityType<<", '"<<aNameInStudy.in()<<"')"<<endl;
- }
- else if (aTypeName == "FAMILY") {
- if (aSubMeshName != aNameInStudy.in()) {
- theStr<<thePrefix<<"aVisu.RenameFamilyInStudy("<<theArgumentName<<", '"<<aMeshName
- <<"', "<<anEntityType<<", '"<<aSubMeshName<<"', '"<<aNameInStudy.in()<<"')"<<endl;
- }
- }
- else { // "GROUP"
- if (aSubMeshName != aNameInStudy.in()) {
- theStr<<thePrefix<<"aVisu.RenameGroupInStudy("<<theArgumentName<<", '"<<aMeshName
- <<"', '"<<aSubMeshName<<"', '"<<aNameInStudy.in()<<"')"<<endl;
- }
- }
- }
- }
+ SALOMEDS::AttributeString_var aComment =
+ SALOMEDS::AttributeString::_narrow(anAttr);
+ CORBA::String_var aValue = aComment->Value();
+ Storable::TRestoringMap aMap;
+ Storable::StringToMap(aValue.in(),aMap);
+ bool anIsExist;
+ QString aTypeName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist);
+ if (anIsExist) {
+ if (aTypeName == "ImportTables") {
+ QString aFileName = VISU::Storable::FindValue(aMap,"myFileName",&anIsExist);
+ if(anIsExist){
+ std::string aName =
+ GenerateName(theSObject,theName2EntryMap,theEntry2NameMap);
+ QString aFirstStrAsTitle =
+ VISU::Storable::FindValue(aMap,"myFirstStrAsTitle",&anIsExist).trimmed().toLower();
+ if ( aFirstStrAsTitle == "1" || aFirstStrAsTitle == "true" )
+ aFirstStrAsTitle = "True";
+ else
+ aFirstStrAsTitle = "False";
+ theStr<<thePrefix<<aName<<" = aVisu.ImportTables('"
+ <<aFileName.toLatin1().data()<<"',"
+ <<aFirstStrAsTitle.toLatin1().data()<<")"<<endl;
+ theStr<<thePrefix<<"if "<<aName<<":"<<endl;
+ thePrefix += PREFIX;
+
+ theArgumentName = aName;
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ return;
+ }
+ } else if (aTypeName == "VIEW3D") {
+ std::string aName = GetName(theSObject);
+ theStr<<thePrefix<<aName<<" = aBuilder.NewObject(aSComponent)"<<endl;
+
+ theStr<<thePrefix<<"if "<<aName<<":"<<endl;
+ thePrefix += PREFIX;
+
+ theStr<<thePrefix<<"anAttr = aBuilder.FindOrCreateAttribute("<<aName<<",'AttributeName')"<<endl;
+ theStr<<thePrefix<<"anAttr.SetValue('"<<aName<<"')"<<endl;
+
+ theStr<<thePrefix<<"anAttr = aBuilder.FindOrCreateAttribute("<<aName<<",'AttributeString')"<<endl;
+ theStr<<thePrefix<<"anAttr.SetValue('"<<aValue.in()<<"')"<<endl;
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ return;
+ } else if (aTypeName == "ENTITY" || aTypeName == "FAMILY" || aTypeName == "GROUP") {
+ // Set name (as this object could be renamed by user)
+ string aMeshName = VISU::Storable::FindValue(aMap,"myMeshName").toLatin1().data();
+ string aSubMeshName = VISU::Storable::FindValue(aMap,"myName").toLatin1().data();
+ string anEntityTypeKey = "myEntityId";
+ if (aTypeName == "ENTITY") anEntityTypeKey = "myId";
+ int anEntity = VISU::Storable::FindValue(aMap,anEntityTypeKey,"0").toInt();
+ std::string anEntityType;
+ switch ((TEntity)anEntity) {
+ case NODE_ENTITY: anEntityType = "VISU.NODE"; break;
+ case EDGE_ENTITY: anEntityType = "VISU.EDGE"; break;
+ case FACE_ENTITY: anEntityType = "VISU.FACE"; break;
+ case CELL_ENTITY: anEntityType = "VISU.CELL"; break;
+ }
+
+ if (aTypeName == "ENTITY" ) {
+ theStr<<thePrefix<<"aVisu.RenameEntityInStudy("<<theArgumentName<<", '"<<aMeshName
+ <<"', "<<anEntityType<<", '"<<aNameInStudy.in()<<"')"<<endl;
+ }
+ else if (aTypeName == "FAMILY") {
+ if (aSubMeshName != aNameInStudy.in()) {
+ theStr<<thePrefix<<"aVisu.RenameFamilyInStudy("<<theArgumentName<<", '"<<aMeshName
+ <<"', "<<anEntityType<<", '"<<aSubMeshName<<"', '"<<aNameInStudy.in()<<"')"<<endl;
+ }
+ }
+ else { // "GROUP"
+ if (aSubMeshName != aNameInStudy.in()) {
+ theStr<<thePrefix<<"aVisu.RenameGroupInStudy("<<theArgumentName<<", '"<<aMeshName
+ <<"', '"<<aSubMeshName<<"', '"<<aNameInStudy.in()<<"')"<<endl;
+ }
+ }
+ }
+ }
} else {
- DumpTableAttrToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
+ DumpTableAttrToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
}
}
-
+
DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
}
//---------------------------------------------------------------------------
void
DumpCurveToPython(SALOMEDS::Study_ptr theStudy,
- CORBA::Boolean theIsPublished,
- CORBA::Boolean& theIsValidScript,
- SALOMEDS::SObject_ptr theSObject,
- std::ostream& theStr,
- TName2EntryMap& theName2EntryMap,
- TEntry2NameMap& theEntry2NameMap,
- std::string theArgumentName,
- std::string thePrefix)
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript,
+ SALOMEDS::SObject_ptr theSObject,
+ std::ostream& theStr,
+ TName2EntryMap& theName2EntryMap,
+ TEntry2NameMap& theEntry2NameMap,
+ std::string theArgumentName,
+ std::string thePrefix)
{
SALOMEDS::SObject_var aTargetRefSObj;
if(theSObject->ReferencedObject(aTargetRefSObj)){
CORBA::Object_var anObj = SObjectToObject(aTargetRefSObj);
if(CORBA::is_nil(anObj))
- return;
-
+ return;
+
VISU::Base_var aBase = VISU::Base::_narrow(anObj);
if(CORBA::is_nil(aBase))
- return;
-
+ return;
+
if(aBase->GetType() == VISU::TCURVE){
- CORBA::String_var anID = aTargetRefSObj->GetID();
- std::string anArg = theEntry2NameMap[anID.in()];
- theStr<<thePrefix<<"if aName2ObjectMap.has_key('"<<anArg<<"'):"<<endl;
- thePrefix += PREFIX;
- theStr<<thePrefix<<"anObject = aName2ObjectMap['"<<anArg<<"']"<<endl;
- theStr<<thePrefix<<"if anObject: " <<theArgumentName<<".AddCurve(anObject)"<<endl;
- theStr<<thePrefix<<"pass"<<endl<<endl;
+ CORBA::String_var anID = aTargetRefSObj->GetID();
+ std::string anArg = theEntry2NameMap[anID.in()];
+ theStr<<thePrefix<<"if aName2ObjectMap.has_key('"<<anArg<<"'):"<<endl;
+ thePrefix += PREFIX;
+ theStr<<thePrefix<<"anObject = aName2ObjectMap['"<<anArg<<"']"<<endl;
+ theStr<<thePrefix<<"if anObject: " <<theArgumentName<<".AddCurve(anObject)"<<endl;
+ theStr<<thePrefix<<"pass"<<endl<<endl;
}
}
}
//---------------------------------------------------------------------------
void
DumpContainersToPython(SALOMEDS::Study_ptr theStudy,
- CORBA::Boolean theIsPublished,
- CORBA::Boolean& theIsValidScript,
- SALOMEDS::SObject_ptr theSObject,
- std::ostream& theStr,
- TName2EntryMap& theName2EntryMap,
- TEntry2NameMap& theEntry2NameMap,
- std::string theArgumentName,
- std::string thePrefix)
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript,
+ SALOMEDS::SObject_ptr theSObject,
+ std::ostream& theStr,
+ TName2EntryMap& theName2EntryMap,
+ TEntry2NameMap& theEntry2NameMap,
+ std::string theArgumentName,
+ std::string thePrefix)
{
SALOMEDS::ChildIterator_var aChildItet = theStudy->NewChildIterator(theSObject);
for(aChildItet->InitEx(false); aChildItet->More(); aChildItet->Next()){
SALOMEDS::SObject_var aSObject = aChildItet->Value();
CORBA::Object_var anObj = SObjectToObject(aSObject);
if(CORBA::is_nil(anObj))
- continue;
-
+ continue;
+
VISU::Base_var aBase = VISU::Base::_narrow(anObj);
if(CORBA::is_nil(aBase))
- continue;
-
+ continue;
+
if(aBase->GetType() == VISU::TCONTAINER){
- theStr<<thePrefix<<endl;
- std::string aName = GenerateName(aSObject,theName2EntryMap,theEntry2NameMap);
- theStr<<thePrefix<<aName<<" = aVisu.CreateContainer()"<<endl;
- theStr<<thePrefix<<"if "<<aName<<":"<<endl;
- std::string aPrefix = thePrefix + PREFIX;
- theArgumentName = aName;
-
- // Set name (as this object could be renamed by user)
- CORBA::String_var aNameInStudy = aSObject->GetName();
- theStr<<aPrefix<<"visu.SetName("<<aName<<", '"<<aNameInStudy.in()<<"')"<<endl;
-
- SALOMEDS::ChildIterator_var aCurveIter = theStudy->NewChildIterator(aSObject);
- for(aCurveIter->InitEx(false); aCurveIter->More(); aCurveIter->Next()){
- SALOMEDS::SObject_var aRefSObj = aCurveIter->Value();
- DumpCurveToPython(theStudy,theIsPublished,theIsValidScript,aRefSObj,theStr,theName2EntryMap,theEntry2NameMap,theArgumentName,aPrefix);
- }
-
- theStr<<aPrefix<<"pass"<<endl<<endl;
+ theStr<<thePrefix<<endl;
+ std::string aName = GenerateName(aSObject,theName2EntryMap,theEntry2NameMap);
+ theStr<<thePrefix<<aName<<" = aVisu.CreateContainer()"<<endl;
+ theStr<<thePrefix<<"if "<<aName<<":"<<endl;
+ std::string aPrefix = thePrefix + PREFIX;
+ theArgumentName = aName;
+
+ // Set name (as this object could be renamed by user)
+ CORBA::String_var aNameInStudy = aSObject->GetName();
+ theStr<<aPrefix<<"visu.SetName("<<aName<<", '"<<aNameInStudy.in()<<"')"<<endl;
+
+ SALOMEDS::ChildIterator_var aCurveIter = theStudy->NewChildIterator(aSObject);
+ for(aCurveIter->InitEx(false); aCurveIter->More(); aCurveIter->Next()){
+ SALOMEDS::SObject_var aRefSObj = aCurveIter->Value();
+ DumpCurveToPython(theStudy,theIsPublished,theIsValidScript,aRefSObj,theStr,theName2EntryMap,theEntry2NameMap,theArgumentName,aPrefix);
+ }
+
+ theStr<<aPrefix<<"pass"<<endl<<endl;
}
}
}
//---------------------------------------------------------------------------
void
DumpPrs3dCacheToPython(SALOMEDS::Study_ptr theStudy,
- CORBA::Boolean theIsPublished,
- CORBA::Boolean& theIsValidScript,
- SALOMEDS::SObject_ptr theSObject,
- std::ostream& theStr,
- TName2EntryMap& theName2EntryMap,
- TEntry2NameMap& theEntry2NameMap,
- std::string theArgumentName,
- std::string thePrefix)
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript,
+ SALOMEDS::SObject_ptr theSObject,
+ std::ostream& theStr,
+ TName2EntryMap& theName2EntryMap,
+ TEntry2NameMap& theEntry2NameMap,
+ std::string theArgumentName,
+ std::string thePrefix)
{
-
+
SALOMEDS::ChildIterator_var anIter = theStudy->NewChildIterator(theSObject);
for(anIter->InitEx(false); anIter->More(); anIter->Next()){
SALOMEDS::SObject_var aSObject = anIter->Value();
CORBA::Object_var anObj = SObjectToObject(aSObject);
if(CORBA::is_nil(anObj))
- continue;
-
+ continue;
+
VISU::Base_var aBase = VISU::Base::_narrow(anObj);
if(CORBA::is_nil(aBase))
- continue;
-
+ continue;
+
if(aBase->GetType() == VISU::TCOLOREDPRS3DCACHE){
- ColoredPrs3dCache_i* aCache = dynamic_cast<ColoredPrs3dCache_i*>(GetServant(aBase).in());
- theStr<<thePrefix<<"aCache = aVisu.GetColoredPrs3dCache(aVisu.GetCurrentStudy())"<<endl;
- theStr<<thePrefix<<"if aCache != None:"<<endl;
- {
- std::string aPrefix = thePrefix + PREFIX;
- std::string anArgument;
- VISU::ColoredPrs3dCache::MemoryMode aMode = aCache->GetMemoryMode();
- switch(aMode){
- case VISU::ColoredPrs3dCache::MINIMAL : anArgument = "VISU.ColoredPrs3dCache.MINIMAL"; break;
- case VISU::ColoredPrs3dCache::LIMITED : anArgument = "VISU.ColoredPrs3dCache.LIMITED"; break;
- }
- theStr<<aPrefix<<"aCache.SetMemoryMode("<<anArgument<<")"<<endl;
-
- if(aMode == VISU::ColoredPrs3dCache::LIMITED)
- theStr<<aPrefix<<"aCache.SetLimitedMemory("<<aCache->GetLimitedMemory()<<") # (Mb)"<<endl;
-
- SALOMEDS::ChildIterator_var aChildIter = theStudy->NewChildIterator(aSObject);
- for(aChildIter->InitEx(false); aChildIter->More(); aChildIter->Next()){
- SALOMEDS::SObject_var aSObject = aChildIter->Value();
- CORBA::Object_var anObject = SObjectToObject(aSObject);
- if (CORBA::is_nil(anObject))
- continue;
-
- ColoredPrs3dHolder_i* aServant = dynamic_cast<ColoredPrs3dHolder_i*>(GetServant(anObject).in());
- if(!aServant)
- continue;
-
- ColoredPrs3d_i* aDevice = aServant->GetPrs3dDevice();
- if(!aDevice)
+ ColoredPrs3dCache_i* aCache = dynamic_cast<ColoredPrs3dCache_i*>(GetServant(aBase).in());
+ theStr<<thePrefix<<"aCache = aVisu.GetColoredPrs3dCache(aVisu.GetCurrentStudy())"<<endl;
+ theStr<<thePrefix<<"if aCache != None:"<<endl;
+ {
+ std::string aPrefix = thePrefix + PREFIX;
+ std::string anArgument;
+ VISU::ColoredPrs3dCache::MemoryMode aMode = aCache->GetMemoryMode();
+ switch(aMode){
+ case VISU::ColoredPrs3dCache::MINIMAL : anArgument = "VISU.ColoredPrs3dCache.MINIMAL"; break;
+ case VISU::ColoredPrs3dCache::LIMITED : anArgument = "VISU.ColoredPrs3dCache.LIMITED"; break;
+ }
+ theStr<<aPrefix<<"aCache.SetMemoryMode("<<anArgument<<")"<<endl;
+
+ if(aMode == VISU::ColoredPrs3dCache::LIMITED)
+ theStr<<aPrefix<<"aCache.SetLimitedMemory("<<aCache->GetLimitedMemory()<<") # (Mb)"<<endl;
+
+ SALOMEDS::ChildIterator_var aChildIter = theStudy->NewChildIterator(aSObject);
+ for(aChildIter->InitEx(false); aChildIter->More(); aChildIter->Next()){
+ SALOMEDS::SObject_var aSObject = aChildIter->Value();
+ CORBA::Object_var anObject = SObjectToObject(aSObject);
+ if (CORBA::is_nil(anObject))
+ continue;
+
+ ColoredPrs3dHolder_i* aServant = dynamic_cast<ColoredPrs3dHolder_i*>(GetServant(anObject).in());
+ if(!aServant)
+ continue;
+
+ ColoredPrs3d_i* aDevice = aServant->GetPrs3dDevice();
+ if(!aDevice)
+ continue;
+
+ Result_i* aResult = aDevice->GetCResult();
+ if (!aResult)
continue;
-
- Result_i* aResult = aDevice->GetCResult();
- std::string aResultEntry = aResult->GetEntry();
- std::string aResultName = theEntry2NameMap[aResultEntry];
-
- ColoredPrs3dHolder::BasicInput_var anInput = aServant->GetBasicInput();
- std::string anEntity;
- switch(anInput->myEntity){
- case VISU::NODE : anEntity = "VISU.NODE"; break;
- case VISU::EDGE : anEntity = "VISU.EDGE"; break;
- case VISU::FACE : anEntity = "VISU.FACE"; break;
- case VISU::CELL : anEntity = "VISU.CELL"; break;
- }
-
-
- theStr<<aPrefix<<"anInput = VISU.ColoredPrs3dHolder.BasicInput("<<
- aResultName<<", '"<<
- anInput->myMeshName<<"', "<<
- anEntity<<", '"<<
- anInput->myFieldName<<"', "<<
- anInput->myTimeStampNumber<<")"<<
- endl;
-
- std::string aComment = aDevice->GetComment();
- theStr<<aPrefix<<"aHolder = aCache.CreateHolder(VISU.T"<<aComment<<", anInput)"<<endl;
- theStr<<aPrefix<<"if aHolder != None:"<<endl;
- {
- std::string aPrefix2 = aPrefix + PREFIX;
- CORBA::String_var aNameInStudy = aSObject->GetName();
- theStr<<aPrefix2<<"visu.SetName(aHolder, '"<<aNameInStudy.in()<<"')"<<endl;
- theStr<<aPrefix2<<"aDevice = aHolder.GetDevice()"<<endl;
- theStr<<aPrefix2<<"if aDevice != None:"<<endl;
- {
- std::string aPrefix3 = aPrefix2 + PREFIX;
- TColoredPrs3dFactory aPrsFactory;
- switch(aDevice->GetType()){
- case VISU::TSCALARMAP:
- if(ScalarMap_i* aServant = dynamic_cast<ScalarMap_i*>(aDevice)){
- ScalarMapToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
- break;
- }
- case VISU::TDEFORMEDSHAPE:
- if(DeformedShape_i* aServant = dynamic_cast<DeformedShape_i*>(aDevice)){
- DeformedShapeToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
- break;
- }
- case VISU::TSTREAMLINES:
- if(StreamLines_i* aServant = dynamic_cast<StreamLines_i*>(aDevice)){
- StreamLinesToPython(aSObject, aServant, theStr, theEntry2NameMap, "aDevice", aPrsFactory, aPrefix3);
- break;
- }
- case VISU::TSCALARMAPONDEFORMEDSHAPE:
- case VISU::TDEFORMEDSHAPEANDSCALARMAP:
- if(DeformedShapeAndScalarMap_i* aServant = dynamic_cast<DeformedShapeAndScalarMap_i*>(aDevice)){
- DeformedShapeAndScalarMapToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
- break;
- }
- case VISU::TVECTORS:
- if(Vectors_i* aServant = dynamic_cast<Vectors_i*>(aDevice)){
- VectorsToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
- break;
- }
- case VISU::TISOSURFACES:
- if(IsoSurfaces_i* aServant = dynamic_cast<IsoSurfaces_i*>(aDevice)){
- IsoSurfacesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
- break;
- }
- case VISU::TCUTPLANES:
- if(CutPlanes_i* aServant = dynamic_cast<CutPlanes_i*>(aDevice)){
- CutPlanesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
- break;
- }
- case VISU::TCUTLINES:
- if(CutLines_i* aServant = dynamic_cast<CutLines_i*>(aDevice)){
- CutLinesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
- break;
- }
- case VISU::TPLOT3D:
- if(Plot3D_i* aServant = dynamic_cast<Plot3D_i*>(aDevice)){
- Plot3DToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
- break;
- }
- case VISU::TGAUSSPOINTS:
- if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(aDevice)){
- GaussPointsToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
- break;
- }
- }
- theStr<<aPrefix3<<"pass"<<endl;
- }
- theStr<<aPrefix2<<"pass"<<endl<<endl;
- }
- }
- theStr<<aPrefix<<"pass"<<endl;
- }
+
+ std::string aResultEntry = aResult->GetEntry();
+ std::string aResultName = theEntry2NameMap[aResultEntry];
+
+ ColoredPrs3dHolder::BasicInput_var anInput = aServant->GetBasicInput();
+ std::string anEntity;
+ switch(anInput->myEntity){
+ case VISU::NODE : anEntity = "VISU.NODE"; break;
+ case VISU::EDGE : anEntity = "VISU.EDGE"; break;
+ case VISU::FACE : anEntity = "VISU.FACE"; break;
+ case VISU::CELL : anEntity = "VISU.CELL"; break;
+ }
+
+
+ theStr<<aPrefix<<"anInput = VISU.ColoredPrs3dHolder.BasicInput("<<
+ aResultName<<", '"<<
+ anInput->myMeshName<<"', "<<
+ anEntity<<", '"<<
+ anInput->myFieldName<<"', "<<
+ anInput->myTimeStampNumber<<")"<<
+ endl;
+
+ std::string aComment = aDevice->GetComment();
+ theStr<<aPrefix<<"aHolder = aCache.CreateHolder(VISU.T"<<aComment<<", anInput)"<<endl;
+ theStr<<aPrefix<<"if aHolder != None:"<<endl;
+ {
+ std::string aPrefix2 = aPrefix + PREFIX;
+ CORBA::String_var aNameInStudy = aSObject->GetName();
+ theStr<<aPrefix2<<"visu.SetName(aHolder, '"<<aNameInStudy.in()<<"')"<<endl;
+ theStr<<aPrefix2<<"aDevice = aHolder.GetDevice()"<<endl;
+ theStr<<aPrefix2<<"if aDevice != None:"<<endl;
+ {
+ std::string aPrefix3 = aPrefix2 + PREFIX;
+ TColoredPrs3dFactory aPrsFactory;
+ switch(aDevice->GetType()){
+ case VISU::TSCALARMAP:
+ if(ScalarMap_i* aServant = dynamic_cast<ScalarMap_i*>(aDevice)){
+ ScalarMapToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+ break;
+ }
+ case VISU::TDEFORMEDSHAPE:
+ if(DeformedShape_i* aServant = dynamic_cast<DeformedShape_i*>(aDevice)){
+ DeformedShapeToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+ break;
+ }
+ case VISU::TSTREAMLINES:
+ if(StreamLines_i* aServant = dynamic_cast<StreamLines_i*>(aDevice)){
+ StreamLinesToPython(aSObject, aServant, theStr, theEntry2NameMap, "aDevice", aPrsFactory, aPrefix3);
+ break;
+ }
+ case VISU::TSCALARMAPONDEFORMEDSHAPE:
+ case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+ if(DeformedShapeAndScalarMap_i* aServant = dynamic_cast<DeformedShapeAndScalarMap_i*>(aDevice)){
+ DeformedShapeAndScalarMapToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+ break;
+ }
+ case VISU::TVECTORS:
+ if(Vectors_i* aServant = dynamic_cast<Vectors_i*>(aDevice)){
+ VectorsToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+ break;
+ }
+ case VISU::TISOSURFACES:
+ if(IsoSurfaces_i* aServant = dynamic_cast<IsoSurfaces_i*>(aDevice)){
+ IsoSurfacesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+ break;
+ }
+ case VISU::TCUTPLANES:
+ if(CutPlanes_i* aServant = dynamic_cast<CutPlanes_i*>(aDevice)){
+ CutPlanesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+ break;
+ }
+ case VISU::TCUTLINES:
+ if(CutLines_i* aServant = dynamic_cast<CutLines_i*>(aDevice)){
+ CutLinesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+ break;
+ }
+ case VISU::TCUTSEGMENT:
+ if(CutSegment_i* aServant = dynamic_cast<CutSegment_i*>(aDevice)){
+ CutSegmentToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+ break;
+ }
+ case VISU::TPLOT3D:
+ if(Plot3D_i* aServant = dynamic_cast<Plot3D_i*>(aDevice)){
+ Plot3DToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+ break;
+ }
+ case VISU::TGAUSSPOINTS:
+ if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(aDevice)){
+ GaussPointsToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+ break;
+ }
+ }
+ theStr<<aPrefix3<<"pass"<<endl;
+ }
+ theStr<<aPrefix2<<"pass"<<endl<<endl;
+ }
+ }
+ theStr<<aPrefix<<"pass"<<endl;
+ }
}
}
}
+
+ //---------------------------------------------------------------------------
+ void
+ DumpEvolutionsToPython(SALOMEDS::Study_ptr theStudy,
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript,
+ SALOMEDS::SObject_ptr theSObject,
+ std::ostream& theStr,
+ TName2EntryMap& theName2EntryMap,
+ TEntry2NameMap& theEntry2NameMap,
+ std::string thePrefix)
+ {
+ if(!theIsPublished) return;
+ SALOMEDS::ChildIterator_var aChildItet = theStudy->NewChildIterator(theSObject);
+ for(aChildItet->InitEx(false); aChildItet->More(); aChildItet->Next()){
+ SALOMEDS::SObject_var aSObject = aChildItet->Value();
+
+ SALOMEDS::GenericAttribute_var anAttr;
+ if (!aSObject->FindAttribute(anAttr, "AttributeString")) continue;
+
+ SALOMEDS::AttributeString_var aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr);
+ QString value (aStringAttr->Value());
+ if(value.isEmpty()) continue;
+
+ VISU::Storable::TRestoringMap aMap;
+ VISU::Storable::StringToMap(value, aMap);
+ bool isExist;
+
+ QString aTypeName = VISU::Storable::FindValue(aMap,"myComment",&isExist);
+ if(!isExist || aTypeName != "EVOLUTION") continue;
+
+ //EVOLUTION
+ theStr<<thePrefix<<endl;
+ QString evolutionName = aSObject->GetName();
+ theStr<<thePrefix<<"#Evolution: "<<evolutionName.toLatin1().data()<<endl;
+ theStr<<thePrefix<<endl;
+ theStr<<thePrefix<<"evolutionSO = aBuilder.NewObject(aSComponent)"<<endl;
+ theStr<<thePrefix<<"aBuilder.SetName(evolutionSO, '"<<evolutionName.toLatin1().data()<<"')"<< endl;
+ theStr<<thePrefix<<"strAttr = aBuilder.FindOrCreateAttribute(evolutionSO, 'AttributeString')"<< endl;
+ theStr<<thePrefix<<"strAttr.SetValue('"<<value.toLatin1().data()<<"')"<< endl;
+
+ SALOMEDS::ChildIterator_var anIter = theStudy->NewChildIterator(aSObject);
+ for (anIter->Init(); anIter->More(); anIter->Next()) {
+ SALOMEDS::SObject_var anObj = anIter->Value();
+
+ //FIELD
+ theStr<<thePrefix<<"fieldSO = aBuilder.NewObject(evolutionSO)"<<endl;
+ if (anObj->FindAttribute(anAttr, "AttributeString")) {
+ aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr);
+ theStr<<thePrefix<<"strAttr = aBuilder.FindOrCreateAttribute(fieldSO, 'AttributeString')"<< endl;
+ theStr<<thePrefix<<"strAttr.SetValue('"<<aStringAttr->Value()<<"')"<< endl;
+ }
+
+ SALOMEDS::SObject_var refObj;
+ if(anObj->ReferencedObject(refObj)) {
+ SALOMEDS::SObject_var father = refObj->GetFather();
+ value = refObj->GetName();
+ QString path(theStudy->GetObjectPath(father));
+ //The following code requierd as a field name can contain '/' character
+ theStr<<thePrefix<<"aBuilder.Addreference(fieldSO,visu.getSObjectByFatherPathAndName(theStudy, '"<<
+ path.toLatin1().data()<<"', '"<<value.toLatin1().data()<<"'))"<<endl;
+ }
+ value = anObj->GetName();
+ if(!value.isEmpty()) theStr<<thePrefix<<"aBuilder.SetName(fieldSO, '"<<value.toLatin1().data()<<"')"<< endl;
+
+ //TABLE
+ SALOMEDS::ChildIterator_var aChildItet = theStudy->NewChildIterator(anObj);
+ for(aChildItet->InitEx(false); aChildItet->More(); aChildItet->Next()){
+ SALOMEDS::SObject_var aSObject = aChildItet->Value();
+
+ std::string anArgumentName = "fieldSO";
+ DumpTableAttrToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ aSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ anArgumentName,
+ thePrefix);
+ }
+ }
+
+ }
+
+ theStr<<thePrefix<<endl;
+ }
+
+
//---------------------------------------------------------------------------
void
DumpAnimationsToPython(SALOMEDS::Study_ptr theStudy,
- CORBA::Boolean theIsPublished,
- CORBA::Boolean& theIsValidScript,
- SALOMEDS::SObject_ptr theSObject,
- std::ostream& theStr,
- std::string thePrefix)
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript,
+ SALOMEDS::SObject_ptr theSObject,
+ std::ostream& theStr,
+ std::string thePrefix)
{
-
+
if(!theIsPublished) return;
-
+
SALOMEDS::ChildIterator_var aChildItet = theStudy->NewChildIterator(theSObject);
for(aChildItet->InitEx(false); aChildItet->More(); aChildItet->Next()){
SALOMEDS::SObject_var aSObject = aChildItet->Value();
-
+
SALOMEDS::GenericAttribute_var anAttr;
if (!aSObject->FindAttribute(anAttr, "AttributeString")) continue;
-
- SALOMEDS::AttributeString_var aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr);
+
+ SALOMEDS::AttributeString_var aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr);
QString value (aStringAttr->Value());
if(value.isEmpty()) continue;
-
- VISU::Storable::TRestoringMap aMap;
+
+ VISU::Storable::TRestoringMap aMap;
VISU::Storable::StringToMap(value, aMap);
bool isExist;
QString aTypeName = VISU::Storable::FindValue(aMap,"myComment",&isExist);
if(!isExist || aTypeName != "ANIMATION") continue;
-
- //ANIMATION
+
+ //ANIMATION
theStr<<thePrefix<<endl;
QString animName = aSObject->GetName();
theStr<<thePrefix<<"#Animation: "<<animName.toLatin1().data()<<endl;
theStr<<thePrefix<<"aBuilder.SetName(animSO, '"<<animName.toLatin1().data()<<"')"<< endl;
theStr<<thePrefix<<"strAttr = aBuilder.FindOrCreateAttribute(animSO, 'AttributeString')"<< endl;
theStr<<thePrefix<<"strAttr.SetValue('"<<value.toLatin1().data()<<"')"<< endl;
-
-
-
+
+
+
SALOMEDS::ChildIterator_var anIter = theStudy->NewChildIterator(aSObject);
for (anIter->Init(); anIter->More(); anIter->Next()) {
- SALOMEDS::SObject_var anObj = anIter->Value();
-
- //FIELD
- theStr<<thePrefix<<"fieldSO = aBuilder.NewObject(animSO)"<<endl;
- if (anObj->FindAttribute(anAttr, "AttributeString")) {
- aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr);
- theStr<<thePrefix<<"strAttr = aBuilder.FindOrCreateAttribute(fieldSO, 'AttributeString')"<< endl;
- theStr<<thePrefix<<"strAttr.SetValue('"<<aStringAttr->Value()<<"')"<< endl;
- }
-
- SALOMEDS::SObject_var refObj;
- if(anObj->ReferencedObject(refObj)) {
- SALOMEDS::SObject_var father = refObj->GetFather();
- value = refObj->GetName();
- QString path(theStudy->GetObjectPath(father));
- //The following code requierd as a field name can contain '/' character
- theStr<<thePrefix<<"aBuilder.Addreference(fieldSO,getSObjectByFatherPathAndName(theStudy, '"<<path.toLatin1().data()<<"', '"<<value.toLatin1().data()<<"'))"<<endl;
- }
- value = anObj->GetName();
- if(!value.isEmpty()) theStr<<thePrefix<<"aBuilder.SetName(fieldSO, '"<<value.toLatin1().data()<<"')"<< endl;
-
- //SCALARMAP,...
- SALOMEDS::ChildIterator_var aSubIter = theStudy->NewChildIterator(anObj);
- for (aSubIter->Init(); aSubIter->More(); aSubIter->Next()) {
- SALOMEDS::SObject_var aSubObj = aSubIter->Value();
-
- theStr<<thePrefix<<"subSO = aBuilder.NewObject(fieldSO)"<<endl;
- value = aSubObj->GetName();
- if(!value.isEmpty()) theStr<<thePrefix<<"aBuilder.SetName(subSO, '"<<value.toLatin1().data()<<"')"<< endl;
- if (aSubObj->FindAttribute(anAttr, "AttributeString")) {
- aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr);
- theStr<<thePrefix<<"strAttr = aBuilder.FindOrCreateAttribute(subSO, 'AttributeString')"<< endl;
- theStr<<thePrefix<<"strAttr.SetValue('"<<aStringAttr->Value()<<"')"<< endl;
- }
- }
-
+ SALOMEDS::SObject_var anObj = anIter->Value();
+
+ //FIELD
+ theStr<<thePrefix<<"fieldSO = aBuilder.NewObject(animSO)"<<endl;
+ if (anObj->FindAttribute(anAttr, "AttributeString")) {
+ aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr);
+ theStr<<thePrefix<<"strAttr = aBuilder.FindOrCreateAttribute(fieldSO, 'AttributeString')"<< endl;
+ theStr<<thePrefix<<"strAttr.SetValue('"<<aStringAttr->Value()<<"')"<< endl;
+ }
+
+ SALOMEDS::SObject_var refObj;
+ if(anObj->ReferencedObject(refObj)) {
+ SALOMEDS::SObject_var father = refObj->GetFather();
+ value = refObj->GetName();
+ QString path(theStudy->GetObjectPath(father));
+ //The following code requierd as a field name can contain '/' character
+ theStr<<thePrefix<<"aBuilder.Addreference(fieldSO,visu.getSObjectByFatherPathAndName(theStudy, '"<<
+ path.toLatin1().data()<<"', '"<<value.toLatin1().data()<<"'))"<<endl;
+ }
+ value = anObj->GetName();
+ if(!value.isEmpty()) theStr<<thePrefix<<"aBuilder.SetName(fieldSO, '"<<value.toLatin1().data()<<"')"<< endl;
+
+ //SCALARMAP,...
+ SALOMEDS::ChildIterator_var aSubIter = theStudy->NewChildIterator(anObj);
+ for (aSubIter->Init(); aSubIter->More(); aSubIter->Next()) {
+ SALOMEDS::SObject_var aSubObj = aSubIter->Value();
+
+ theStr<<thePrefix<<"subSO = aBuilder.NewObject(fieldSO)"<<endl;
+ value = aSubObj->GetName();
+ if(!value.isEmpty()) theStr<<thePrefix<<"aBuilder.SetName(subSO, '"<<value.toLatin1().data()<<"')"<< endl;
+ if (aSubObj->FindAttribute(anAttr, "AttributeString")) {
+ aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr);
+ theStr<<thePrefix<<"strAttr = aBuilder.FindOrCreateAttribute(subSO, 'AttributeString')"<< endl;
+ theStr<<thePrefix<<"strAttr.SetValue('"<<aStringAttr->Value()<<"')"<< endl;
+ }
+ }
+
}
}
-
+
theStr<<thePrefix<<endl;
}
void
DumpClippingPlanesToPython(SALOMEDS::Study_ptr theStudy,
- CORBA::Boolean theIsPublished,
- CORBA::Boolean& theIsValidScript,
- SALOMEDS::SObject_ptr theSObject,
- std::ostream& theStr,
- std::string thePrefix,
- VISU_ClippingPlaneMgr& thePlaneMgr)
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript,
+ SALOMEDS::SObject_ptr theSObject,
+ std::ostream& theStr,
+ std::string thePrefix,
+ VISU_ClippingPlaneMgr& thePlaneMgr)
{
-
+
if(!theIsPublished) return;
-
+
VISU_CutPlaneFunction* aPlane;
double aOrigin[3], aDir[3];
for (int i = 0; i < thePlaneMgr.GetClippingPlanesNb(); i++) {
aPlane = thePlaneMgr.GetClippingPlane(i);
aPlane->GetOrigin(aOrigin);
aPlane->GetNormal(aDir);
-
+
theStr<<thePrefix<<"aVisu.CreateClippingPlane("<<
- aOrigin[0]<<","<<aOrigin[1]<<","<<aOrigin[2]<<","<<
- aDir[0]<<","<<aDir[1]<<","<<aDir[2]<<","<<
- aPlane->isAuto()<<",\""<<aPlane->getName()<<"\")"<<endl;
+ aOrigin[0]<<","<<aOrigin[1]<<","<<aOrigin[2]<<","<<
+ aDir[0]<<","<<aDir[1]<<","<<aDir[2]<<","<<
+ aPlane->isAuto()<<",\""<<aPlane->getName()<<"\")"<<endl;
+ }
+ theStr<<endl;
+ }
+
+
+ void
+ DumpTextureMapToPython(SALOMEDS::Study_ptr theStudy,
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript,
+ SALOMEDS::SObject_ptr theSObject,
+ std::ostream& theStr,
+ std::string thePrefix,
+ const StudyId2MarkerMap& theMarkerMap)
+ {
+ if(!theIsPublished)
+ return;
+
+ if(CORBA::is_nil(theStudy))
+ return;
+
+ StudyId2MarkerMap::const_iterator anIter = theMarkerMap.find(theStudy->StudyId());
+ if(anIter == theMarkerMap.end())
+ return;
+
+ theStr<<thePrefix<<"texture_map = {}"<<endl<<endl;
+
+ const VTK::MarkerMap& aMarkerMap = anIter->second;
+ VTK::MarkerMap::const_iterator aMarkerIter = aMarkerMap.begin();
+ for(; aMarkerIter != aMarkerMap.end(); aMarkerIter++) {
+ int aMarkerId = aMarkerIter->first;
+ std::string aMarkerTexture = aMarkerIter->second.first;
+ theStr<<thePrefix<<"texture_map["<<aMarkerId<<"] = aVisu.LoadTexture(\""<<aMarkerTexture<<"\")"<<endl;
}
theStr<<endl;
}
Engines::TMPFile*
VISU_Gen_i::
DumpPython(CORBA::Object_ptr theStudy,
- CORBA::Boolean theIsPublished,
- CORBA::Boolean& theIsValidScript)
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean theIsMultiFile,
+ CORBA::Boolean& theIsValidScript)
{
theIsValidScript = false;
-
+
SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(theStudy);
if(CORBA::is_nil(aStudy))
return new Engines::TMPFile(0);
-
+
TName2EntryMap aName2EntryMap;
TEntry2NameMap aEntry2NameMap;
-
+
#ifndef COUT
ostringstream aStr;
#else
#define aStr cout
#endif
-
- std::string aPrefix(PREFIX);
- aStr<<"### This file is generated by SALOME automatically by dump python functionality"
- " of VISU component"<<endl<<endl;
- aStr<<"def RebuildData(theStudy):"<<endl;
+
+ std::string aPrefix = theIsMultiFile ? PREFIX : "";
+ if( theIsMultiFile )
+ aStr<<"def RebuildData(theStudy):"<<endl;
aStr<<aPrefix<<"from batchmode_salome import orb, naming_service, lcc, myStudyManager"<<endl;
aStr<<aPrefix<<"import SALOME_MED"<<endl;
aStr<<aPrefix<<"import SALOMEDS"<<endl;
aStr<<aPrefix<<"aBuilder = theStudy.NewBuilder()"<<endl;
aStr<<aPrefix<<"aName2ObjectMap = {}"<<endl;
aStr<<endl;
-
+
SALOMEDS::SComponent_var aComponent = FindOrCreateVisuComponent(aStudy);
-
+
VISU::DumpClippingPlanesToPython(aStudy,
- theIsPublished,
- theIsValidScript,
- aComponent.in(),
- aStr,
- aPrefix,
- myClippingPlaneMgr);
-
-
+ theIsPublished,
+ theIsValidScript,
+ aComponent.in(),
+ aStr,
+ aPrefix,
+ myClippingPlaneMgr);
+
+ VISU::DumpTextureMapToPython(aStudy,
+ theIsPublished,
+ theIsValidScript,
+ aComponent.in(),
+ aStr,
+ aPrefix,
+ myMarkerMap);
+
VISU::DumpChildrenToPython(aStudy,
- theIsPublished,
- theIsValidScript,
- aComponent.in(),
- aStr,
- aName2EntryMap,
- aEntry2NameMap,
- "",
- aPrefix);
-
+ theIsPublished,
+ theIsValidScript,
+ aComponent.in(),
+ aStr,
+ aName2EntryMap,
+ aEntry2NameMap,
+ "",
+ aPrefix);
+
+ VISU::DumpEvolutionsToPython(aStudy,
+ theIsPublished,
+ theIsValidScript,
+ aComponent.in(),
+ aStr,
+ aName2EntryMap,
+ aEntry2NameMap,
+ aPrefix);
+
VISU::DumpContainersToPython(aStudy,
- theIsPublished,
- theIsValidScript,
- aComponent.in(),
- aStr,
- aName2EntryMap,
- aEntry2NameMap,
- "",
- aPrefix);
-
+ theIsPublished,
+ theIsValidScript,
+ aComponent.in(),
+ aStr,
+ aName2EntryMap,
+ aEntry2NameMap,
+ "",
+ aPrefix);
+
VISU::DumpPrs3dCacheToPython(aStudy,
- theIsPublished,
- theIsValidScript,
- aComponent.in(),
- aStr,
- aName2EntryMap,
- aEntry2NameMap,
- "",
- aPrefix);
-
+ theIsPublished,
+ theIsValidScript,
+ aComponent.in(),
+ aStr,
+ aName2EntryMap,
+ aEntry2NameMap,
+ "",
+ aPrefix);
+
VISU::DumpAnimationsToPython(aStudy,
- theIsPublished,
- theIsValidScript,
- aComponent.in(),
- aStr,
- aPrefix);
-
-
+ theIsPublished,
+ theIsValidScript,
+ aComponent.in(),
+ aStr,
+ aPrefix);
+
+ if (theIsPublished)
+ {
+ SALOMEDS::AttributeParameter_var ap = aStudy->GetModuleParameters("Interface Applicative", "Post-Pro", -1);
+ if(!CORBA::is_nil(ap)) {
+ std::map<std::string,std::string>::iterator it = aEntry2NameMap.begin();
+ for( ;it != aEntry2NameMap.end(); it++ ) {
+ //1. Encode entry
+ if ( ((*it).first).length() < 7 ) continue;
+ std::string tail( (*it).first, 6, ((*it).first).length()-1 );
+ std::string newEntry(ComponentDataType());
+ newEntry+=("_"+tail);
+
+ CORBA::String_var anEntry = CORBA::string_dup(newEntry.c_str());
+
+ if( ap->IsSet(anEntry, 6) ) { //6 Means string array, see SALOMEDS_Attributes.idl AttributeParameter interface
+ std::string idCommand = std::string("visu.getObjectID(") + (*it).second + std::string(")");
+ SALOMEDS::StringSeq_var aSeq= ap->GetStrArray(anEntry);
+ int oldLenght = aSeq->length();
+ aSeq->length(oldLenght+2);
+ aSeq[oldLenght] = CORBA::string_dup("_PT_OBJECT_ID_");
+ aSeq[oldLenght + 1] = CORBA::string_dup(idCommand.c_str());
+ ap->SetStrArray( anEntry, aSeq );
+ }
+ }
+ }
+ }
+
+
//Output the script that sets up the visul parameters.
if(theIsPublished) {
char* script = aStudy->GetDefaultScript("Post-Pro", aPrefix.c_str());
if(script && strlen(script) > 0) {
- aStr << script;
- CORBA::string_free(script);
+ aStr << script;
+ CORBA::string_free(script);
}
}
-
- aStr<<aPrefix<<"pass"<<endl;
-
- if(theIsPublished) { //SRN: define function for Animation
-
- //Define a function that find a SObject by its father's path and its name
- aStr<<endl;
- aStr<<endl;
-
- aStr<<"def getSObjectByFatherPathAndName(theStudy, thePath, theName):"<<endl;
- aStr<<aPrefix<<"father = theStudy.FindObjectByPath(thePath)"<<endl;
- aStr<<aPrefix<<"itr = theStudy.NewChildIterator(father)"<<endl;
- aStr<<aPrefix<<"while itr.More():"<<endl;
- aStr<<aPrefix<<aPrefix<<"so = itr.Value()"<<endl;
- aStr<<aPrefix<<aPrefix<<"if so.GetName()==theName: return so"<<endl;
- aStr<<aPrefix<<aPrefix<<"itr.Next()"<<endl;
- aStr<<aPrefix<<aPrefix<<"pass"<<endl;
- aStr<<aPrefix<<"return None"<<endl;
-
- aStr<<endl;
- }
-
+
+ if( theIsMultiFile )
+ aStr<<aPrefix<<"pass"<<endl;
+
// theIsValidScript currently is not used by internal dump methods (DumpChildrenToPython(), etc.)
// If the situation changes, then the following line should be removed, and theIsValidScript
// should be set properly by those internal methods
theIsValidScript = true;
-
+
#ifndef COUT
std::string aResult = aStr.str();
//ofstream anFStream("/tmp/dump.py");
//anFStream<<aResult<<endl;
-
+
CORBA::ULong aSize = aResult.size() + 1;
char* aBuffer = new char[aSize];
strcpy(aBuffer,&aResult[0]);
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VISU_Evolution.cxx
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#include "VISU_Evolution.h"
+
+#include "VISU_Tools.h"
+#include "VISU_Gen_i.hh"
+#include "VISU_Result_i.hh"
+#include "VISU_Table_i.hh"
+#include "VISU_View_i.hh"
+
+#include <VISU_MeshValue.hxx>
+#include <VISU_Structures_impl.hxx>
+#include <VISU_VTKTypeList.hxx>
+
+#include <SUIT_Session.h>
+
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+
+#include <SALOME_Event.h>
+
+//------------------------------------------------------------------------
+template<int EDataType> bool ProcessValForTime( VISU::PValForTimeImpl theValForTime,
+ VISU::Elem2Comp2Value& theElem2Comp2Value )
+{
+ theElem2Comp2Value.clear();
+
+ typedef typename VISU::TL::TEnum2VTKBasicType< EDataType >::TResult TVTKBasicType;
+ typedef VISU::TTMeshValue< TVTKBasicType > TMeshValue;
+ typedef MED::SharedPtr< TMeshValue > TMeshValuePtr;
+
+ const TMeshValuePtr aMeshValue = theValForTime->GetMeshValue( VISU::ePOINT1 );
+ if( !aMeshValue )
+ return false;
+
+ vtkIdType aNbElem = aMeshValue->GetNbElem();
+ vtkIdType aNbComp = aMeshValue->GetNbComp();
+ vtkIdType aNbGauss = aMeshValue->GetNbGauss();
+
+ for( vtkIdType iElem = 0; iElem < aNbElem; iElem++ )
+ {
+ typename TMeshValue::TCValueSliceArr aMValueSliceArr = aMeshValue->GetCompValueSliceArr( iElem );
+ VISU::Comp2Value& aComp2Value = theElem2Comp2Value[ iElem ];
+
+ vtkFloatingPointType& aModulusValue = aComp2Value[ 0 ];
+ aModulusValue = 0.0;
+
+ for( vtkIdType iComp = 0; iComp < aNbComp; iComp++ )
+ {
+ const typename TMeshValue::TCValueSlice& aMValueSlice = aMValueSliceArr[ iComp ];
+
+ vtkFloatingPointType& aValue = aComp2Value[ iComp+1 ];
+ aValue = 0.0;
+
+ for(vtkIdType iGauss = 0; iGauss < aNbGauss; iGauss++)
+ {
+ const vtkFloatingPointType& aVal = aMValueSlice[iGauss];
+ aValue += aVal;
+ }
+ if( aNbGauss != 0 )
+ aValue /= aNbGauss;
+
+ aModulusValue += aValue * aValue;
+ }
+ aModulusValue = sqrt( aModulusValue );
+ }
+
+ return true;
+}
+
+//------------------------------------------------------------------------
+template<int EDataType> int GetNbPoints( VISU::PValForTimeImpl theValForTime )
+{
+ typedef typename VISU::TL::TEnum2VTKBasicType< EDataType >::TResult TVTKBasicType;
+ typedef VISU::TTMeshValue< TVTKBasicType > TMeshValue;
+ typedef MED::SharedPtr< TMeshValue > TMeshValuePtr;
+
+ const TMeshValuePtr aMeshValue = theValForTime->GetMeshValue( VISU::ePOINT1 );
+ if( !aMeshValue )
+ return 0;
+
+ return aMeshValue->GetNbElem();
+}
+
+//------------------------------------------------------------------------
+VISU_Evolution::VISU_Evolution( _PTR(Study) theStudy,
+ VISU::XYPlot_ptr theXYPlot )
+{
+ myStudy = theStudy;
+ myView = 0;
+
+ if( !CORBA::is_nil( theXYPlot ) )
+ {
+ VISU::XYPlot_i* pPlot = dynamic_cast<VISU::XYPlot_i*>( GetServant( theXYPlot ).in() );
+ Plot2d_ViewFrame* aVF = pPlot->GetView();
+ setViewer( aVF );
+ }
+
+ myFieldEntry = "";
+ myEvolutionEntry = "";
+ myMeshName = "";
+ myEntity = VISU::NODE_ENTITY;
+ myFieldName = "";
+
+ myPointId = 0;
+ myComponentId = 0;
+}
+
+//------------------------------------------------------------------------
+VISU_Evolution::~VISU_Evolution()
+{
+}
+
+//------------------------------------------------------------------------
+bool VISU_Evolution::setField( _PTR(SObject) theField )
+{
+ myField = theField;
+ if( !theField )
+ return false;
+
+ myFieldEntry = theField->GetID();
+
+ VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap( theField );
+ if( aRestoringMap.empty() )
+ return false;
+
+ VISU::VISUType aType = VISU::Storable::RestoringMap2Type( aRestoringMap );
+ if( aType != VISU::TFIELD )
+ return false;
+
+ myMeshName = aRestoringMap["myMeshName"].toStdString();
+ myEntity = VISU::TEntity( aRestoringMap["myEntityId"].toInt() );
+ myFieldName = aRestoringMap["myName"].toStdString();
+
+ if( myEntity != VISU::NODE_ENTITY )
+ return false;
+
+ VISU::Result_var aResult = VISU::FindResult( VISU::GetSObject( theField ).in() );
+ if( CORBA::is_nil( aResult.in() ) )
+ return false;
+
+ myResult = dynamic_cast<VISU::Result_i*>( VISU::GetServant( aResult ).in() );
+ if( !myResult )
+ return false;
+
+ const VISU::TMeshMap& aMeshMap = myResult->GetInput()->GetMeshMap();
+ if( aMeshMap.empty() )
+ return false;
+
+ VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.find( myMeshName );
+ if( aMeshIter == aMeshMap.end() )
+ return false;
+
+ const VISU::PMesh& aMesh = aMeshIter->second;
+ const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+ if( aMeshOnEntityMap.empty() )
+ return false;
+
+ VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityIter = aMeshOnEntityMap.find( myEntity );
+ if( aMeshOnEntityIter == aMeshOnEntityMap.end() )
+ return false;
+
+ const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityIter->second;
+ const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ if( aFieldMap.empty() )
+ return false;
+
+ VISU::TFieldMap::const_iterator aFieldIter = aFieldMap.find( myFieldName );
+ if( aFieldIter == aFieldMap.end() )
+ return false;
+
+ myFieldImpl = aFieldIter->second;
+ const VISU::TNames& aCompNames = myFieldImpl->myCompNames;
+ const VISU::TNames& aUnitNames = myFieldImpl->myUnitNames;
+ int aNbComp = myFieldImpl->myNbComp;
+
+ // fill myComponentDataList
+ myComponentDataList.clear();
+
+ QString aModulusComponent( "<Modulus>" );
+ myComponentDataList.append( VISU::ComponentData( aModulusComponent, "" ) );
+ for( int i = 0; i < aNbComp; i++ )
+ {
+ QString aComponent = QString( aCompNames[i].c_str() ).simplified();
+ if( aComponent.isEmpty() )
+ aComponent = "Component " + QString::number( i+1 );
+
+ QString anUnit = QString( aUnitNames[i].c_str() ).simplified();
+
+ myComponentDataList.append( VISU::ComponentData( aComponent, anUnit ) );
+ }
+
+ return true;
+}
+
+//------------------------------------------------------------------------
+bool VISU_Evolution::setField( SALOMEDS::SObject_ptr theField )
+{
+ SALOMEDS::SObject_var theFieldDup = SALOMEDS::SObject::_duplicate( theField );
+ _PTR(SObject) aField = VISU::GetClientSObject( theFieldDup, myStudy );
+ return setField( aField );
+}
+
+//------------------------------------------------------------------------
+void VISU_Evolution::setPointId( int thePointId )
+{
+ myPointId = thePointId;
+}
+
+//------------------------------------------------------------------------
+void VISU_Evolution::setComponentId( int theComponentId )
+{
+ myComponentId = theComponentId;
+}
+
+//------------------------------------------------------------------------
+int VISU_Evolution::getNbPoints() const
+{
+ if( !myFieldImpl )
+ return 0;
+
+ vtkIdType aDataType = myFieldImpl->GetDataType();
+ const VISU::TValField& aValField = myFieldImpl->myValField;
+ if( aValField.empty() )
+ return 0;
+
+ VISU::TValField::const_iterator aValFieldIter = aValField.begin();
+ for( ; aValFieldIter != aValField.end(); aValFieldIter++ )
+ {
+ const vtkIdType& aTimeStamp = aValFieldIter->first;
+ VISU::PValForTimeImpl aValForTime = aValFieldIter->second;
+
+ // to force method VISU::MedConvertor::FillValForTime() to be called
+ myResult->GetInput()->GetTimeStampOnMesh( myMeshName, myEntity, myFieldName, aTimeStamp );
+
+ switch( aDataType )
+ {
+ case VTK_DOUBLE : return GetNbPoints<VTK_DOUBLE>( aValForTime );
+ case VTK_FLOAT : return GetNbPoints<VTK_FLOAT>( aValForTime );
+ case VTK_INT : return GetNbPoints<VTK_INT>( aValForTime );
+ case VTK_LONG: return GetNbPoints<VTK_LONG>( aValForTime );
+ default: return 0;
+ }
+ }
+
+ return 0;
+}
+
+//------------------------------------------------------------------------
+bool VISU_Evolution::extractData( int thePointId,
+ int theComponentId,
+ VISU::TimeStampValueList& theTimeStampValueList )
+{
+ theTimeStampValueList.clear();
+ myTimeStampDataList.clear();
+
+ if( !myFieldImpl )
+ return false;
+
+ vtkIdType aDataType = myFieldImpl->GetDataType();
+ const VISU::TValField& aValField = myFieldImpl->myValField;
+ if( aValField.empty() )
+ return false;
+
+ typedef QList< VISU::Elem2Comp2Value > TimeStamp2Elem2Comp2Value;
+ typedef QListIterator< VISU::Elem2Comp2Value > TimeStamp2Elem2Comp2ValueIterator;
+ TimeStamp2Elem2Comp2Value aData;
+
+ VISU::TValField::const_iterator aValFieldIter = aValField.begin();
+ for( ; aValFieldIter != aValField.end(); aValFieldIter++ )
+ {
+ const vtkIdType& aTimeStamp = aValFieldIter->first;
+ VISU::PValForTimeImpl aValForTime = aValFieldIter->second;
+ VISU::TTime aTime = aValForTime->myTime;
+ double aTimeValue = aTime.first;
+ std::string aTimeUnits = aTime.second;
+
+ // to force method VISU::MedConvertor::FillValForTime() to be called
+ // (we need data of all timestamps of the result)
+ myResult->GetInput()->GetTimeStampOnMesh( myMeshName, myEntity, myFieldName, aTimeStamp );
+
+ // data should be sorted by time value
+ int anOrder = 0;
+ VISU::TimeStampDataListIterator anIter( myTimeStampDataList );
+ while( anIter.hasNext() )
+ {
+ VISU::TimeStampData aTimeStampData = anIter.next();
+ if( aTimeValue > aTimeStampData.first )
+ anOrder++;
+ }
+
+ VISU::Elem2Comp2Value anElem2Comp2Value;
+
+ bool ok = false;
+ switch( aDataType )
+ {
+ case VTK_DOUBLE : ok = ProcessValForTime<VTK_DOUBLE>( aValForTime, anElem2Comp2Value ); break;
+ case VTK_FLOAT : ok = ProcessValForTime<VTK_FLOAT>( aValForTime, anElem2Comp2Value ); break;
+ case VTK_INT : ok = ProcessValForTime<VTK_INT>( aValForTime, anElem2Comp2Value ); break;
+ case VTK_LONG: ok = ProcessValForTime<VTK_LONG>( aValForTime, anElem2Comp2Value ); break;
+ default: break;
+ }
+
+ if( !ok )
+ return false;
+
+ aData.insert( anOrder, anElem2Comp2Value );
+ myTimeStampDataList.insert( anOrder, VISU::TimeStampData( aTimeValue, aTimeUnits ) );
+ }
+
+ if( theComponentId < 0 || theComponentId >= myComponentDataList.size() )
+ return false;
+
+ int aTimeStamp = 0;
+ TimeStamp2Elem2Comp2ValueIterator it1( aData );
+ while( it1.hasNext() )
+ {
+ VISU::Elem2Comp2Value anElem2Comp2Value = it1.next();
+ VISU::Elem2Comp2Value::const_iterator it2 = anElem2Comp2Value.find( thePointId );
+ if( it2 != anElem2Comp2Value.end() )
+ {
+ VISU::Comp2Value aComp2Value = it2.value();
+ VISU::Comp2Value::const_iterator it3 = aComp2Value.find( theComponentId );
+ if( it3 != aComp2Value.end() )
+ {
+ vtkFloatingPointType aValue = it3.value();
+ theTimeStampValueList.append( aValue );
+ }
+ }
+ aTimeStamp++;
+ }
+
+ if( theTimeStampValueList.size() != myTimeStampDataList.size() )
+ return false;
+
+ return true;
+}
+
+//------------------------------------------------------------------------
+bool VISU_Evolution::showEvolution()
+{
+ return ProcessEvent(new TMemFunEvent<VISU_Evolution,bool>
+ (this,&VISU_Evolution::_showEvolution));
+}
+
+//------------------------------------------------------------------------
+bool VISU_Evolution::_showEvolution()
+{
+ bool isEdit = ( myEvolutionEntry != "" );
+
+ // 1) extract data
+ VISU::TimeStampValueList aTimeStampValueList;
+ if( !extractData( myPointId, myComponentId, aTimeStampValueList ) )
+ return false;
+
+ // 2) publish new objects in study (or edit them)
+ _PTR(StudyBuilder) aStudyBuilder = myStudy->NewBuilder();
+ aStudyBuilder->NewCommand(); // open transaction
+
+ QString anEvolutionComment;
+ anEvolutionComment.sprintf( "myComment=EVOLUTION;myPointId=%d;myComponentId=%d",
+ myPointId,
+ myComponentId );
+
+ _PTR(SObject) anEvolutionObject, aFieldRefObject, aTableObject;
+ if( !isEdit ) // creation mode
+ {
+ _PTR(SComponent) aSComponent = VISU::ClientFindOrCreateVisuComponent( myStudy );
+ std::string aSComponentEntry = aSComponent->GetID();
+
+ // create an evolution object
+ myEvolutionEntry = VISU::CreateAttributes( myStudy,
+ aSComponentEntry.c_str(),
+ VISU::NO_ICON,
+ VISU::NO_IOR,
+ VISU::GenerateName( "Evolution", 0 ).toLatin1().constData(),
+ VISU::NO_PERFSITENT_REF,
+ anEvolutionComment.toLatin1().constData(),
+ true );
+ anEvolutionObject = myStudy->FindObjectID( myEvolutionEntry.c_str() );
+
+ // create a reference to the field object
+ aFieldRefObject = aStudyBuilder->NewObject( anEvolutionObject );
+ aStudyBuilder->Addreference( aFieldRefObject, myField );
+
+ // create a table object
+ std::string aTableEntry = VISU::CreateAttributes( myStudy,
+ aFieldRefObject->GetID().c_str(),
+ VISU::NO_ICON,
+ VISU::NO_IOR,
+ VISU::GenerateName( "Table", 0 ).toLatin1().constData(),
+ VISU::NO_PERFSITENT_REF,
+ "myComment=TABLE",
+ true );
+ aTableObject = myStudy->FindObjectID( aTableEntry.c_str() );
+ }
+ else // edition mode
+ {
+ // edit an evolution object
+ anEvolutionObject = myStudy->FindObjectID( myEvolutionEntry.c_str() );
+ _PTR(GenericAttribute) anAttr;
+ anAttr = aStudyBuilder->FindOrCreateAttribute( anEvolutionObject, "AttributeString" );
+ _PTR(AttributeString) aComment( anAttr );
+ aComment->SetValue( anEvolutionComment.toLatin1().constData() );
+
+ // get a reference to the field object
+ _PTR(ChildIterator) anIter = myStudy->NewChildIterator( anEvolutionObject );
+ anIter->Init();
+ if( anIter->More() )
+ aFieldRefObject = anIter->Value();
+
+ // get a table object
+ anIter = myStudy->NewChildIterator( aFieldRefObject );
+ anIter->Init();
+ if( anIter->More() )
+ aTableObject = anIter->Value();
+ }
+
+ aStudyBuilder->CommitCommand(); // commit transaction
+
+ // 3) update table attribute of the table object
+ _PTR(GenericAttribute) anAttr = aStudyBuilder->FindOrCreateAttribute( aTableObject, "AttributeTableOfReal" );
+ _PTR(AttributeTableOfReal) aTableOfReal( anAttr );
+
+ aTableOfReal->SetNbColumns( aTimeStampValueList.size() );
+
+ QString aTimeRowUnits;
+ int aTimeStamp = 0;
+ VISU::TimeStampValueListIterator it( aTimeStampValueList );
+ while( it.hasNext() )
+ {
+ vtkFloatingPointType aValue = it.next();
+
+ VISU::TimeStampData aTimeStampData = myTimeStampDataList[ aTimeStamp ];
+ double aTimeValue = aTimeStampData.first;
+ std::string aTimeUnits = aTimeStampData.second;
+
+ if( aTimeRowUnits.isEmpty() )
+ aTimeRowUnits = QString( aTimeUnits.c_str() ).simplified();
+
+ aTableOfReal->SetColumnTitle( aTimeStamp+1, QString::number( aTimeStamp+1 ).toLatin1().constData() );
+ aTableOfReal->PutValue( aTimeValue, 1, aTimeStamp+1 );
+ aTableOfReal->PutValue( aValue, 2, aTimeStamp+1 );
+
+ aTimeStamp++;
+ }
+
+ if( aTimeRowUnits.isEmpty() )
+ aTimeRowUnits = "s";
+
+ aTableOfReal->SetRowTitle( 1, "Time" );
+ aTableOfReal->SetRowUnit( 1, aTimeRowUnits.toLatin1().constData() );
+
+ const VISU::ComponentData& aComponentData = myComponentDataList[ myComponentId ];
+ QString aValueTitle = QString( "Point %1" ).arg( myPointId );
+ aTableOfReal->SetRowTitle( 2, aValueTitle.toLatin1().constData() );
+ aTableOfReal->SetRowUnit( 2, aComponentData.second.toLatin1().constData() );
+
+ QString aTitle = QString( "%1, %2" ).arg( myFieldName.c_str() ).arg( aComponentData.first );
+ aTableOfReal->SetTitle( aTitle.toLatin1().constData() );
+
+ // 4) get active study
+ SalomeApp_Study* aSalomeStudy = NULL;
+ SUIT_Session* aSession = SUIT_Session::session();
+ QList<SUIT_Application*> anApplications = aSession->applications();
+ QList<SUIT_Application*>::Iterator anIter = anApplications.begin();
+ while ( anIter != anApplications.end() ) {
+ SUIT_Application* anApp = *anIter;
+ if (SUIT_Study* aSStudy = anApp->activeStudy()) {
+ if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
+ if (_PTR(Study) aCStudy = aStudy->studyDS()) {
+ if (aCStudy->Name() == myStudy->Name()) {
+ aSalomeStudy = aStudy;
+ break;
+ }
+ }
+ }
+ anIter++;
+ }
+ }
+
+ // 5) create curves and plot
+ if( aSalomeStudy )
+ {
+ // 5.1) remove old curves (edition mode)
+ if( isEdit ) {
+ _PTR(GenericAttribute) anAttr;
+ if(aTableObject->FindAttribute( anAttr, "AttributeName" ) ) {
+ _PTR(ChildIterator) aChildIter = myStudy->NewChildIterator( aTableObject );
+ for( aChildIter->InitEx( false ); aChildIter->More(); aChildIter->Next() ) {
+ aSalomeStudy->deleteReferencesTo( aChildIter->Value() );
+ _PTR(SObject) aCurveObject = aChildIter->Value();
+ if(aCurveObject) {
+ VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aCurveObject);
+ if (aRestoringMap["myComment"] == "CURVE") {
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aCurveObject);
+ if(!CORBA::is_nil(aCORBAObject)) {
+ PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aServant.in())){
+ if(SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(aSalomeStudy->application()))
+ VISU::PlotRemoveCurve(anApp, aCurve);
+ }
+ }
+ }
+ aStudyBuilder->RemoveObject( aCurveObject );
+ }
+ }
+ }
+ }
+
+ // 5.2) create new curves
+ VISU::VISU_Gen_i* aVisuGen = VISU::VISU_Gen_i::GetVisuGenImpl();
+ aVisuGen->CreateTable( aTableObject->GetID().c_str() );
+
+ // 5.3) create plot
+ VISU::CreatePlot( aVisuGen, getViewer(), aTableObject );
+ }
+
+ return true;
+}
+
+//------------------------------------------------------------------------
+void VISU_Evolution::restoreFromStudy( SALOMEDS::SObject_ptr theObj )
+{
+ _PTR(SObject) anEvolutionObject = VISU::GetClientSObject( theObj, myStudy );
+ restoreFromStudy( anEvolutionObject );
+}
+
+//------------------------------------------------------------------------
+void VISU_Evolution::restoreFromStudy( _PTR(SObject) theObj )
+{
+ VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap( theObj );
+ if( aMap.empty() )
+ return;
+
+ bool isExist;
+ myPointId = VISU::Storable::FindValue( aMap, "myPointId", &isExist ).toInt();
+ myComponentId = VISU::Storable::FindValue( aMap, "myComponentId", &isExist ).toInt();
+
+ _PTR(ChildIterator) anIter = myStudy->NewChildIterator( theObj );
+ for( anIter->Init(); anIter->More(); anIter->Next() )
+ {
+ _PTR(SObject) aRefObj = anIter->Value();
+ _PTR(SObject) aFieldObj;
+
+ if( !aRefObj->ReferencedObject( aFieldObj ) )
+ continue;
+
+ int nbAttr = aFieldObj->GetAllAttributes().size();
+ if( nbAttr < 1 )
+ continue;
+
+ setField( aFieldObj );
+ break;
+ }
+
+ myEvolutionEntry = theObj->GetID();
+}
+
+//------------------------------------------------------------------------
+struct TNewEvolutionEvent: public SALOME_Event
+{
+ std::string myStudyName;
+ VISU::XYPlot_ptr myXYPlot;
+
+ typedef VISU_Evolution* TResult;
+ TResult myResult;
+
+ TNewEvolutionEvent (std::string theStudyName, VISU::XYPlot_ptr theXYPlot):
+ myStudyName(theStudyName),
+ myXYPlot(VISU::XYPlot::_duplicate(theXYPlot)),
+ myResult(NULL)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ SUIT_Session* aSession = SUIT_Session::session();
+ QList<SUIT_Application*> anApplications = aSession->applications();
+ QList<SUIT_Application*>::Iterator anIter = anApplications.begin();
+ while ( anIter != anApplications.end() ) {
+ SUIT_Application* anApp = *anIter;
+ if (SUIT_Study* aSStudy = anApp->activeStudy()) {
+ if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
+ if (_PTR(Study) aCStudy = aStudy->studyDS()) {
+ if (myStudyName == aCStudy->Name()) {
+ myResult = new VISU_Evolution (aCStudy, myXYPlot);
+ break;
+ }
+ }
+ }
+ }
+ anIter++;
+ }
+ }
+};
+
+//------------------------------------------------------------------------
+VISU_Evolution_i::VISU_Evolution_i( SALOMEDS::Study_ptr theStudy,
+ VISU::XYPlot_ptr theXYPlot )
+{
+ std::string aStudyName = theStudy->Name();
+ myEngine = ProcessEvent( new TNewEvolutionEvent( aStudyName, theXYPlot ) );
+}
+
+//------------------------------------------------------------------------
+VISU_Evolution_i::~VISU_Evolution_i()
+{
+ delete myEngine;
+}
+
+//------------------------------------------------------------------------
+bool VISU_Evolution_i::setField( SALOMEDS::SObject_ptr theField )
+{
+ return myEngine->setField( theField );
+}
+
+//------------------------------------------------------------------------
+void VISU_Evolution_i::setPointId( CORBA::Long thePointId )
+{
+ myEngine->setPointId( thePointId );
+}
+
+//------------------------------------------------------------------------
+void VISU_Evolution_i::setComponentId( CORBA::Long theComponentId )
+{
+ myEngine->setComponentId( theComponentId );
+}
+
+//------------------------------------------------------------------------
+CORBA::Boolean VISU_Evolution_i::showEvolution()
+{
+ return myEngine->showEvolution();
+}
+
+//------------------------------------------------------------------------
+void VISU_Evolution_i::restoreFromStudy( SALOMEDS::SObject_ptr theObj )
+{
+ myEngine->restoreFromStudy( theObj );
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VISU_Evolution.h
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#ifndef VISU_EVOLUTION_H
+#define VISU_EVOLUTION_H
+
+#include "VISUConfig.hh"
+
+#include <VISU_ConvertorDef_impl.hxx>
+#include <SALOMEDSClient_Study.hxx>
+
+#include <QList>
+#include <QMap>
+#include <QPair>
+
+#include <vtkType.h>
+
+#include <string>
+
+class Plot2d_ViewFrame;
+
+namespace VISU
+{
+ class Result_i;
+};
+
+namespace VISU
+{
+ typedef QMap< vtkIdType, vtkFloatingPointType > Comp2Value;
+ typedef QMapIterator< vtkIdType, vtkFloatingPointType > Comp2ValueIterator;
+
+ typedef QMap< vtkIdType, Comp2Value > Elem2Comp2Value;
+ typedef QMapIterator< vtkIdType, Comp2Value > Elem2Comp2ValueIterator;
+
+ typedef QPair< double, std::string > TimeStampData;
+ typedef QList< TimeStampData > TimeStampDataList;
+ typedef QListIterator< TimeStampData > TimeStampDataListIterator;
+
+ typedef QPair< QString, QString > ComponentData;
+ typedef QList< ComponentData > ComponentDataList;
+ typedef QListIterator< ComponentData > ComponentDataListIterator;
+
+ typedef QList< vtkFloatingPointType > TimeStampValueList;
+ typedef QListIterator< vtkFloatingPointType > TimeStampValueListIterator;
+};
+
+class VISU_I_EXPORT VISU_Evolution
+{
+protected:
+ bool _showEvolution();
+
+public:
+ VISU_Evolution( _PTR(Study) theStudy,
+ VISU::XYPlot_ptr theXYPlot = VISU::XYPlot::_nil() );
+ ~VISU_Evolution();
+
+ virtual VISU::VISUType GetType() { return VISU::TNONE; }
+
+ _PTR(Study) getStudy() const { return myStudy; }
+
+ bool setField( _PTR(SObject) theField );
+ bool setField( SALOMEDS::SObject_ptr theField );
+
+ int getNbPoints() const;
+
+ void setPointId( int thePointId );
+ int getPointId() const { return myPointId; }
+
+ void setComponentId( int theComponentId );
+ int getComponentId() const { return myComponentId; }
+
+ bool showEvolution();
+
+ void setViewer( Plot2d_ViewFrame* theView ) { myView = theView; }
+ Plot2d_ViewFrame* getViewer() const { return myView; }
+
+ VISU::Result_i* getResult() const { return myResult; }
+ const VISU::PFieldImpl& getField() const { return myFieldImpl; }
+
+ std::string getFieldEntry() const { return myFieldEntry; }
+ std::string getEvolutionEntry() const { return myEvolutionEntry; }
+ std::string getMeshName() const { return myMeshName; }
+ VISU::TEntity getEntity() const { return myEntity; }
+ std::string getFieldName() const { return myFieldName; }
+
+ const VISU::TimeStampDataList& getTimeStampDataList() const { return myTimeStampDataList; }
+ const VISU::ComponentDataList& getComponentDataList() const { return myComponentDataList; }
+
+ void restoreFromStudy( SALOMEDS::SObject_ptr theObj );
+ void restoreFromStudy( _PTR(SObject) theObj );
+
+private:
+ bool extractData( int thePointId,
+ int theComponentId,
+ VISU::TimeStampValueList& theTimeStampValueList );
+
+private:
+ _PTR(Study) myStudy;
+ _PTR(SObject) myField;
+
+ int myPointId;
+ int myComponentId;
+
+ Plot2d_ViewFrame* myView;
+
+ VISU::Result_i* myResult;
+ VISU::PFieldImpl myFieldImpl;
+
+ std::string myFieldEntry;
+ std::string myEvolutionEntry;
+ std::string myMeshName;
+ VISU::TEntity myEntity;
+ std::string myFieldName;
+
+ VISU::TimeStampDataList myTimeStampDataList;
+ VISU::ComponentDataList myComponentDataList;
+};
+
+
+class VISU_I_EXPORT VISU_Evolution_i: public virtual POA_VISU::Evolution,
+ public virtual VISU::Base_i
+{
+ VISU_Evolution* myEngine;
+public:
+ VISU_Evolution_i( SALOMEDS::Study_ptr theStudy,
+ VISU::XYPlot_ptr theXYPlot = VISU::XYPlot::_nil() );
+ ~VISU_Evolution_i();
+
+ virtual VISU::VISUType GetType() { return VISU::TEVOLUTION; }
+
+ virtual bool setField(SALOMEDS::SObject_ptr theField);
+
+ virtual void setPointId(CORBA::Long thePointId);
+
+ virtual void setComponentId(CORBA::Long theComponentId);
+
+ virtual CORBA::Boolean showEvolution();
+
+ virtual void restoreFromStudy(SALOMEDS::SObject_ptr theField);
+};
+
+#endif //VISU_EVOLUTION_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File :
// Author :
myIsActiveLocalScalarBar(true),
myIsDispGlobalScalarBar(true),
mySpacing(0.01),
- myFaceLimit(50000)
+ myFaceLimit(50000),
+ myShowBar(true)
{
if(MYDEBUG) MESSAGE("GaussPoints_i::GaussPoints_i - this = "<<this);
}
anAlphaTexture = aResourceMgr->stringValue( "VISU", "point_sprite_alpha_texture", anAlphaTexture );
SetTextures( aMainTexture.toLatin1().data(), anAlphaTexture.toLatin1().data() );
+
+ myShowBar = true;
return this;
}
SetColor(anOrigin->GetColor());
+ SetBarVisible(anOrigin->IsBarVisible());
+
SetTextures(anOrigin->GetMainTexture(), anOrigin->GetAlphaTexture());
}
}
CORBA::String_var aPixMapName = aPixmap->GetPixMap();
if(strcmp(GetIconName(), aPixMapName.in()) != 0)
aPixmap->SetPixMap(GetIconName());
+
+ QString aVal = VISU::Storable::FindValue(theMap,"myShowBar", "1");
+ SetBarVisible((aVal.toInt() == 1)? true : false);
SetIsActiveLocalScalarBar(Storable::FindValue(theMap,"myIsActiveLocalScalarBar").toInt());
SetIsDispGlobalScalarBar(Storable::FindValue(theMap,"myIsDispGlobalScalarBar").toInt());
Storable::DataToStream( theStr, "myAlphaTexture", GetQAlphaTexture() );
Storable::DataToStream( theStr, "myResolution", GetResolution() );
+ Storable::DataToStream( theStr, "myShowBar", (IsBarVisible()? 1:0) );
}
if(anIDMapper){
int aNbGroups = myGroupNames.size();
if(myGroupNames.find(theGroupName) == myGroupNames.end()){
- GetSpecificPL()->AddGeometry(anIDMapper->GetOutput());
+ GetSpecificPL()->AddGeometry(anIDMapper->GetOutput(), theGroupName);
myGroupNames.insert(theGroupName);
/*
if(aNbGroups == 0)
UpdateIcon();
*/
+ // To update scalar range according to the new input (IPAL21305)
+ if(!IsRangeFixed())
+ SetSourceRange();
}
}
}
return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
}
-
+void VISU::GaussPoints_i::SetBarVisible(CORBA::Boolean theVisible)
+{
+ if (myShowBar == theVisible)
+ return;
+ VISU::TSetModified aModified(this);
+ myShowBar = theVisible;
+ myParamsTime.Modified();
+}
+
//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
::CreateActor()
{
VISU_GaussPtsAct* anActor = VISU_GaussPtsAct::New();
+ anActor->SetBarVisibility(myShowBar);
if(OnCreateActor(anActor))
return anActor;
return NULL;
if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
VISU_ScalarBarCtrl *aScalarBarCtrl = anActor->GetScalarBarCtrl();
if(GetIsColored()){
- anActor->SetBarVisibility(true);
GetPipeLine()->GetMapper()->SetScalarVisibility(1);
if(IsRangeFixed()){
aScalarBarCtrl->Update();
}else{
- anActor->SetBarVisibility(false);
-
GetPipeLine()->GetMapper()->SetScalarVisibility(0);
anActor->GetProperty()->SetColor(myColor.red() / 255.0,
myColor.green() / 255.0,
myColor.blue() / 255.0);
}
+
+ anActor->SetBarVisibility(myShowBar && GetIsColored());
if( GetSpecificPL()->GetPrimitiveType() != VISU_OpenGLPointSpriteMapper::GeomSphere )
theActor->SetRepresentation( VTK_POINTS );
myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
myResult = aRange[0];
}else{
- VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode() );
+ VISU::TNames aGroupNames = myColoredPrs3d->GetSpecificPL()->GetGeometryNames();
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode(), aGroupNames );
myResult = aTMinMax.first;
}
}
myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
myResult = aRange[1];
}else{
- VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode() );
+ VISU::TNames aGroupNames = myColoredPrs3d->GetSpecificPL()->GetGeometryNames();
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode(), aGroupNames );
myResult = aTMinMax.second;
}
}
}
//----------------------------------------------------------------------------
-struct TGetComponentMin: public SALOME_Event
+struct TGaussGetComponentMin: public SALOME_Event
{
VISU::ColoredPrs3d_i* myColoredPrs3d;
vtkIdType myCompID;
typedef CORBA::Double TResult;
TResult myResult;
- TGetComponentMin( VISU::ColoredPrs3d_i* theColoredPrs3d,
- vtkIdType theCompID ):
+ TGaussGetComponentMin( VISU::ColoredPrs3d_i* theColoredPrs3d,
+ vtkIdType theCompID ):
myColoredPrs3d( theColoredPrs3d ),
myCompID( theCompID )
{}
void
Execute()
{
+ VISU::TNames aGroupNames;
+ if(VISU::GaussPoints_i* aPrs3d = dynamic_cast<VISU::GaussPoints_i*>(myColoredPrs3d))
+ aGroupNames = aPrs3d->GetSpecificPL()->GetGeometryNames();
+
VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
if ( aMinMaxController ) {
myResult = aMinMaxController->GetComponentMin( myCompID );
} else {
- VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID );
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID, aGroupNames );
myResult = aTMinMax.first;
}
}
VISU::GaussPoints_i
::GetComponentMin(vtkIdType theCompID)
{
- return ProcessEvent( new TGetComponentMin( this, theCompID ) );
+ return ProcessEvent( new TGaussGetComponentMin( this, theCompID ) );
}
//----------------------------------------------------------------------------
-struct TGetComponentMax: public SALOME_Event
+struct TGaussGetComponentMax: public SALOME_Event
{
VISU::ColoredPrs3d_i* myColoredPrs3d;
vtkIdType myCompID;
typedef CORBA::Double TResult;
TResult myResult;
- TGetComponentMax( VISU::ColoredPrs3d_i* theColoredPrs3d,
- vtkIdType theCompID ):
+ TGaussGetComponentMax( VISU::ColoredPrs3d_i* theColoredPrs3d,
+ vtkIdType theCompID ):
myColoredPrs3d( theColoredPrs3d ),
myCompID( theCompID )
{}
void
Execute()
{
+ VISU::TNames aGroupNames;
+ if(VISU::GaussPoints_i* aPrs3d = dynamic_cast<VISU::GaussPoints_i*>(myColoredPrs3d))
+ aGroupNames = aPrs3d->GetSpecificPL()->GetGeometryNames();
+
VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
if ( aMinMaxController ) {
myResult = aMinMaxController->GetComponentMax( myCompID );
} else {
- VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID );
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID, aGroupNames );
myResult = aTMinMax.second;
}
}
VISU::GaussPoints_i
::GetComponentMax(vtkIdType theCompID)
{
- return ProcessEvent( new TGetComponentMax( this, theCompID ) );
+ return ProcessEvent( new TGaussGetComponentMax( this, theCompID ) );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.hxx
// Author : Alexey PETROV
//! Get path to the image using for Main Point Sprite texture.
QString
GetQMainTexture();
-
+
char*
GetMainTexture();
{
return myGaussPointsPL;
}
+
+ virtual CORBA::Boolean IsBarVisible() { return myShowBar; }
+
+ virtual void SetBarVisible(CORBA::Boolean theVisible);
//----------------------------------------------------------------------------
//! Sets initial source geometry
virtual
void
UpdateFromActor(VISU_GaussPtsAct* theActor);
+
+ private:
+ bool myShowBar;
};
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Gen_i.cc
// Author : Alexey PETROV
// Module : VISU
-//
+
#include "VISU_Gen_i.hh"
#include "VISU_Result_i.hh"
#include "VISU_PrsObject_i.hh"
#include "VISU_ViewManager_i.hh"
+#include "VISU_ResultUtils.hh"
#include "VISU_Prs3d_i.hh"
#include "VISU_Mesh_i.hh"
#include "VISU_Table_i.hh"
#include "VISU_PointMap3d_i.hh"
#include "VISU_TimeAnimation.h"
+#include "VISU_Evolution.h"
#include "VISU_ColoredPrs3dFactory.hh"
#include "VISU_ColoredPrs3dCache_i.hh"
#include "VISU_Actor.h"
+#include "HDFOI.hxx"
#include "HDFascii.hxx"
#include "SALOMEDS_Tool.hxx"
#include "SalomeApp_Study.h"
#include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h"
+#include "VTKViewer_MarkerUtils.h"
#include "SVTK_ViewModel.h"
#include "SVTK_ViewWindow.h"
#include "SALOME_Event.h"
UNEXPECT_CATCH(SalomeException, SALOME::SALOME_Exception);
// STL Includes
-#include <strstream>
+#include <sstream>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
using namespace std;
-extern "C"
+extern "C"
VISU_I_EXPORT VISU::VISU_Gen_ptr
GetImpl(CORBA::ORB_ptr theORB,
- PortableServer::POA_ptr thePOA,
- SALOME_NamingService* theNamingService,
- QMutex* theMutex)
+ PortableServer::POA_ptr thePOA,
+ SALOME_NamingService* theNamingService,
+ QMutex* theMutex)
{
if(MYDEBUG) MESSAGE("extern 'C' GetImpl");
VISU::VISU_Gen_i *aVISU_Gen = new VISU::VISU_Gen_i(theORB,thePOA,theNamingService,theMutex);
static std::string VISU_TMP_DIR;
static CORBA::Boolean myIsMultiFile;
- const CORBA::Boolean IsMultiFile()
- {
+ const CORBA::Boolean IsMultiFile()
+ {
return myIsMultiFile;
}
//----------------------------------------------------------------------------
- _PTR(SComponent)
+ _PTR(SComponent)
ClientFindOrCreateVisuComponent (_PTR(Study) theStudyDocument)
{
_PTR(SComponent) aSComponent = theStudyDocument->FindComponent("VISU");
if (aLocked) theStudyDocument->GetProperties()->SetLocked(false);
aSComponent = aStudyBuilder->NewComponent("VISU");
_PTR(GenericAttribute) anAttr =
- aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeName");
+ aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeName");
_PTR(AttributeName) aName (anAttr);
CORBA::ORB_var anORB = Base_i::GetORB();
SALOME_NamingService *NamingService = new SALOME_NamingService( anORB );
CORBA::Object_var objVarN = NamingService->Resolve("/Kernel/ModulCatalog");
SALOME_ModuleCatalog::ModuleCatalog_var Catalogue =
- SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN);
+ SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN);
SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( "VISU" );
if (!Comp->_is_nil()) {
- aName->SetValue(Comp->componentusername());
+ aName->SetValue(Comp->componentusername());
}
anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributePixMap");
//----------------------------------------------------------------------------
- SALOMEDS::SComponent_var
+ SALOMEDS::SComponent_var
FindOrCreateVisuComponent(SALOMEDS::Study_ptr theStudyDocument)
{
SALOMEDS::SComponent_var aSComponent = theStudyDocument->FindComponent("VISU");
SALOME_ModuleCatalog::ModuleCatalog_var Catalogue = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN);
SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( "VISU" );
if ( !Comp->_is_nil() ) {
- aName->SetValue( Comp->componentusername() );
+ aName->SetValue( Comp->componentusername() );
}
anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributePixMap");
//----------------------------------------------------------------------------
void
- RegistryStorable()
+ RegistryStorable()
{
Storable::RegistryStorableEngine(Result_i::myComment.c_str(),&(Result_i::StorableEngine));
Storable::RegistryStorableEngine(DeformedShape_i::myComment.c_str(),&(StorableEngine<DeformedShape_i>));
Storable::RegistryStorableEngine(CutPlanes_i::myComment.c_str(),&(StorableEngine<CutPlanes_i>));
Storable::RegistryStorableEngine(CutLines_i::myComment.c_str(),&(StorableEngine<CutLines_i>));
+ Storable::RegistryStorableEngine(CutSegment_i::myComment.c_str(),&(StorableEngine<CutSegment_i>));
Storable::RegistryStorableEngine(IsoSurfaces_i::myComment.c_str(),&(StorableEngine<IsoSurfaces_i>));
Storable::RegistryStorableEngine(StreamLines_i::myComment.c_str(),&(StorableEngine<StreamLines_i>));
Storable::RegistryStorableEngine(Plot3D_i::myComment.c_str(),&(StorableEngine<Plot3D_i>));
if(!theFileNames.empty()){
aListOfFileNames->length(theFileNames.size());
for(int aCounter = theFileNames.size(); aCounter > 0; aCounter--)
- aListOfFileNames[aCounter-1] = theFileNames[aCounter-1].c_str();
+ aListOfFileNames[aCounter-1] = theFileNames[aCounter-1].c_str();
}
return aListOfFileNames._retn();
}
+ //----------------------------------------------------------------------------
+ bool
+ LoadMarkerMap(SALOMEDS::Study_ptr theStudy,
+ const char* theURL,
+ bool theIsMultiFile,
+ bool theIsASCII,
+ StudyId2MarkerMap& theStudyId2MarkerMap,
+ std::string& theMarkerMapFileName,
+ std::string& theMarkerMapFile)
+ {
+ std::string aPrefix;
+ if( theIsMultiFile ) {
+ CORBA::String_var anURL = theStudy->URL();
+ aPrefix = SALOMEDS_Tool::GetNameFromPath(anURL.in());
+ }
+
+ theMarkerMapFileName = aPrefix + "_textures";
+ theMarkerMapFile = VISU_TMP_DIR + theMarkerMapFileName;
+
+ if( theIsASCII && !HDFascii::ConvertFromASCIIToHDF( const_cast<char*>( theMarkerMapFile.c_str() ), true ) )
+ return false;
+
+ HDFfile* aFile;
+ HDFdataset* aDataset;
+ HDFgroup* aTopGroup;
+ HDFgroup* aGroup;
+ HDFgroup* aSubGroup;
+ HDFgroup* aSubSubGroup;
+ int aSize;
+
+ aFile = new HDFfile( (char*)theMarkerMapFile.c_str() );
+ try {
+ aFile->OpenOnDisk( HDF_RDONLY );
+ }
+ catch ( HDFexception ) {
+ INFOS( "Load(): " << theMarkerMapFile << " not found!" );
+ return false;
+ }
+
+ VTK::MarkerMap& aMarkerMap = theStudyId2MarkerMap[ theStudy->StudyId() ];
+
+ for( int i = 0, n = aFile->nInternalObjects(); i < n; i++ ) {
+ char markerGrpName[ HDF_NAME_MAX_LEN+1 ];
+ aFile->InternalObjectIndentify( i, markerGrpName );
+
+ int aMarkerId = 0;
+ std::string aMarkerFile;
+ VTK::MarkerTexture aMarkerTexture;
+
+ if( string( markerGrpName ).substr( 0, 6 ) == string( "Marker" ) ) {
+ aTopGroup = new HDFgroup( markerGrpName, aFile );
+ aTopGroup->OpenOnDisk();
+
+ aMarkerId = atoi( string( markerGrpName ).substr( 6 ).c_str() );
+ if( aMarkerId < 1 )
+ continue;
+
+ if( aTopGroup->ExistInternalObject( "File" ) ) {
+ aDataset = new HDFdataset( "File", aTopGroup );
+ aDataset->OpenOnDisk();
+ aSize = aDataset->GetSize();
+ char* aFileName = new char[ aSize ];
+ aDataset->ReadFromDisk( aFileName );
+ aMarkerFile = aFileName;
+ delete [] aFileName;
+ aDataset->CloseOnDisk();
+ }
+
+ if( aTopGroup->ExistInternalObject( "Texture" ) ) {
+ aDataset = new HDFdataset( "Texture", aTopGroup );
+ aDataset->OpenOnDisk();
+ aSize = aDataset->GetSize();
+ int* aTextureData = new int[ aSize ];
+ aDataset->ReadFromDisk( aTextureData );
+ for( int j = 0; j < aSize; j++ )
+ aMarkerTexture.push_back( aTextureData[j] );
+ delete [] aTextureData;
+ aDataset->CloseOnDisk();
+ }
+
+ aTopGroup->CloseOnDisk();
+ }
+
+ if( aMarkerId > 0 )
+ aMarkerMap[ aMarkerId ] = VTK::MarkerData( aMarkerFile, aMarkerTexture );
+ }
+
+ aFile->CloseOnDisk();
+ delete aFile;
+
+ return true;
+ }
+
+ //----------------------------------------------------------------------------
+ bool
+ SaveMarkerMap(SALOMEDS::Study_ptr theStudy,
+ const char* theURL,
+ bool theIsMultiFile,
+ bool theIsASCII,
+ const StudyId2MarkerMap& theStudyId2MarkerMap,
+ std::string& theMarkerMapFileName,
+ std::string& theMarkerMapFile)
+ {
+ VISU::StudyId2MarkerMap::const_iterator aMainIter = theStudyId2MarkerMap.find( theStudy->StudyId() );
+ if( aMainIter == theStudyId2MarkerMap.end() )
+ return false;
+
+ const VTK::MarkerMap& aMarkerMap = aMainIter->second;
+ if( aMarkerMap.empty() )
+ return false;
+
+ std::string aPrefix;
+ if( theIsMultiFile ) {
+ CORBA::String_var anURL = theStudy->URL();
+ aPrefix = SALOMEDS_Tool::GetNameFromPath(anURL.in());
+ }
+
+ theMarkerMapFileName = aPrefix + "_textures";
+ theMarkerMapFile = string( theURL ) + theMarkerMapFileName;
+
+ HDFfile* aFile;
+ HDFdataset* aDataset;
+ HDFgroup* aTopGroup;
+ HDFgroup* aGroup;
+ HDFgroup* aSubGroup;
+ HDFgroup* aSubSubGroup;
+ hdf_size aSize[ 1 ];
+
+ aFile = new HDFfile( (char*)theMarkerMapFile.c_str() );
+ aFile->CreateOnDisk();
+
+ VTK::MarkerMap::const_iterator aMarkerIter = aMarkerMap.begin();
+ for( ; aMarkerIter != aMarkerMap.end(); aMarkerIter++ ) {
+ int aMarkerId = aMarkerIter->first;
+ const VTK::MarkerData& aMarkerData = aMarkerIter->second;
+ std::string aMarkerFile = aMarkerData.first;
+ VTK::MarkerTexture aMarkerTexture = aMarkerData.second;
+
+ char markerGrpName[30];
+ sprintf( markerGrpName, "Marker %d", aMarkerId );
+ aTopGroup = new HDFgroup( markerGrpName, aFile );
+
+ aTopGroup->CreateOnDisk();
+
+ aSize[ 0 ] = aMarkerFile.length() + 1;
+ aDataset = new HDFdataset( "File", aTopGroup, HDF_STRING, aSize, 1 );
+ aDataset->CreateOnDisk();
+ aDataset->WriteOnDisk( ( char* )( aMarkerFile.c_str() ) );
+ aDataset->CloseOnDisk();
+
+ int* aTextureData = new int[ aMarkerTexture.size() ];
+ VTK::MarkerTexture::const_iterator anIter = aMarkerTexture.begin();
+ for( int i = 0; anIter != aMarkerTexture.end(); anIter++, i++ )
+ aTextureData[i] = *anIter;
+
+ aSize[0] = aMarkerTexture.size();
+ aDataset = new HDFdataset( "Texture", aTopGroup, HDF_INT32, aSize, 1 );
+ aDataset->CreateOnDisk();
+ aDataset->WriteOnDisk( aTextureData );
+ aDataset->CloseOnDisk();
+ delete [] aTextureData;
+
+ aTopGroup->CloseOnDisk();
+ }
+
+ aFile->CloseOnDisk();
+ delete aFile;
+
+ if( theIsASCII && !HDFascii::ConvertFromHDFToASCII( const_cast<char*>( theMarkerMapFile.c_str() ), true ) )
+ return false;
+
+ return true;
+ }
+
+
//----------------------------------------------------------------------------
VISU_Gen_i
::VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA,
- SALOME_NamingService* theNamingService, QMutex* theMutex) :
+ SALOME_NamingService* theNamingService, QMutex* theMutex) :
Engines_Component_i()
{
if(MYDEBUG) MESSAGE("VISU_Gen_i::VISU_Gen_i : "<<theMutex);
Prs3d_ptr
VISU_Gen_i
::CreatePrs3d(VISUType theType,
- SALOMEDS::Study_ptr theStudy)
+ SALOMEDS::Study_ptr theStudy)
{
if(ColoredPrs3d_i* aPrs3d = CreatePrs3d_i(theType, theStudy, ColoredPrs3d_i::EPublishIndependently))
return aPrs3d->_this();
//----------------------------------------------------------------------------
void
- CorrectSObjectType(SALOMEDS::SObject_ptr theSObject,
- SALOMEDS::StudyBuilder_ptr theBuilder)
+ CorrectSObjectType(SALOMEDS::SObject_ptr theSObject,
+ SALOMEDS::StudyBuilder_ptr theBuilder)
{
SALOMEDS::GenericAttribute_var anAttr;
bool isAttrStringFound = false;
if ( isAttrStringFound || theSObject->FindAttribute(anAttr, "AttributeString") ) {
SALOMEDS::AttributeString_var aAttComment = SALOMEDS::AttributeString::_narrow(anAttr);
if ( aAttComment ) {
- CORBA::String_var aValue = aAttComment->Value();
- std::string aString = Storable::CorrectPersistentString(aValue.in());
- aAttComment->SetValue( aString.c_str() );
+ CORBA::String_var aValue = aAttComment->Value();
+ std::string aString = Storable::CorrectPersistentString(aValue.in());
+ aAttComment->SetValue( aString.c_str() );
}
}
}
//----------------------------------------------------------------------------
- CORBA::Boolean
- VISU_Gen_i
- ::Load(SALOMEDS::SComponent_ptr theComponent,
- const SALOMEDS::TMPFile & theStream,
- const char* theURL,
- CORBA::Boolean theIsMultiFile)
+ CORBA::Boolean
+ LoadWithMarkerMap(SALOMEDS::SComponent_ptr theComponent,
+ const SALOMEDS::TMPFile & theStream,
+ const char* theURL,
+ CORBA::Boolean theIsMultiFile,
+ CORBA::Boolean theIsASCII,
+ StudyId2MarkerMap& theStudyId2MarkerMap)
{
- Mutex mt(myMutex);
SALOMEDS::Study_var aStudy = theComponent->GetStudy();
SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent);
for (anIter->InitEx(true); anIter->More(); anIter->Next()) {
SALOMEDS::SObject_var aSObject = anIter->Value();
- CorrectSObjectType(aSObject, aStudyBuilder);
+ CorrectSObjectType(aSObject, aStudyBuilder);
}
-
VISU_TMP_DIR = theIsMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
SALOMEDS::ListOfFileNames_var aSeq =
SALOMEDS_Tool::PutStreamToFiles(theStream, VISU_TMP_DIR, theIsMultiFile);
myIsMultiFile = theIsMultiFile;
+
+ // load textures of custom point markers
+ Result_i::TFileNames aTMPFileNames;
+ std::string aMarkerMapFileName, aMarkerMapFile;
+ if( LoadMarkerMap( aStudy, theURL, theIsMultiFile, theIsASCII,
+ theStudyId2MarkerMap, aMarkerMapFileName, aMarkerMapFile ) ) {
+ aTMPFileNames.push_back( aMarkerMapFileName );
+ }
+
+ if(!theIsMultiFile && !aTMPFileNames.empty()) {
+ SALOMEDS::ListOfFileNames_var aListOfTMPFileNames = GetListOfFileNames(aTMPFileNames);
+ SALOMEDS_Tool::RemoveTemporaryFiles(VISU_TMP_DIR, aListOfTMPFileNames, true );
+ }
+
return true;
}
//----------------------------------------------------------------------------
- CORBA::Boolean
+ CORBA::Boolean
+ VISU_Gen_i
+ ::Load(SALOMEDS::SComponent_ptr theComponent,
+ const SALOMEDS::TMPFile & theStream,
+ const char* theURL,
+ CORBA::Boolean theIsMultiFile)
+ {
+ Mutex mt(myMutex);
+ return LoadWithMarkerMap(theComponent, theStream, theURL, theIsMultiFile, false, myMarkerMap);
+ }
+
+
+ //----------------------------------------------------------------------------
+ CORBA::Boolean
VISU_Gen_i
::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
- const SALOMEDS::TMPFile & theStream,
- const char* theURL,
- bool theIsMultiFile)
+ const SALOMEDS::TMPFile & theStream,
+ const char* theURL,
+ bool theIsMultiFile)
{
- return Load(theComponent, theStream, theURL, theIsMultiFile);
+ Mutex mt(myMutex);
+ return LoadWithMarkerMap(theComponent, theStream, theURL, theIsMultiFile, true, myMarkerMap);
}
//----------------------------------------------------------------------------
- char*
+ char*
VISU_Gen_i
::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
- const char* theLocalPersistentID,
- CORBA::Boolean theIsMultiFile,
- CORBA::Boolean theIsASCII)
+ const char* theLocalPersistentID,
+ CORBA::Boolean theIsMultiFile,
+ CORBA::Boolean theIsASCII)
{
CORBA::String_var aString("");
if(strcmp(theLocalPersistentID,"") != 0) {
- Storable* aStorable = Storable::Create(theSObject,
- theLocalPersistentID,
- VISU_TMP_DIR,
- theIsMultiFile);
- if(aStorable != NULL)
- aString = aStorable->GetID();
+ Storable* aStorable = Storable::Create(theSObject,
+ theLocalPersistentID,
+ VISU_TMP_DIR,
+ theIsMultiFile);
+ if(aStorable != NULL)
+ aString = aStorable->GetID();
}
return aString._retn();
}
//----------------------------------------------------------------------------
- SALOMEDS::TMPFile*
+ SALOMEDS::TMPFile*
VISU_Gen_i
::Save(SALOMEDS::SComponent_ptr theComponent,
- const char* theURL,
- bool theIsMultiFile)
+ const char* theURL,
+ bool theIsMultiFile)
{
if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - theURL = '"<<theURL<<"'");
SALOMEDS::SObject_var aSObject = anIter->Value();
CORBA::Object_var anObj = SObjectToObject(aSObject);
if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(anObj).in())){
- aResult->Save(theComponent,
- theURL,
- theIsMultiFile,
- false,
- aFileNames,
- aFiles);
+ aResult->Save(theComponent,
+ theURL,
+ theIsMultiFile,
+ false,
+ aFileNames,
+ aFiles);
}
}
if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aFileNames.size() - "<<aFileNames.size());
+ // save textures of custom point markers
+ Result_i::TFileNames aTMPFileNames;
+ std::string aMarkerMapFileName, aMarkerMapFile;
+ if( SaveMarkerMap( aStudy, theURL, theIsMultiFile, false,
+ myMarkerMap, aMarkerMapFileName, aMarkerMapFile ) ) {
+ aTMPFileNames.push_back( aMarkerMapFileName );
+ aFileNames.push_back( aMarkerMapFileName );
+ aFiles.push_back( aMarkerMapFile );
+ }
+
SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0);
if(aFileNames.empty())
return aStreamFile._retn();
-
+
SALOMEDS::ListOfFileNames_var aListOfFileNames = GetListOfFileNames(aFileNames);
SALOMEDS::ListOfFileNames_var aListOfFiles = GetListOfFileNames(aFiles);
else
aStreamFile = SALOMEDS_Tool::PutFilesToStream(aListOfFiles.in(), aListOfFileNames.in());
+ if(!theIsMultiFile && !aTMPFileNames.empty()) {
+ SALOMEDS::ListOfFileNames_var aListOfTMPFileNames = GetListOfFileNames(aTMPFileNames);
+ SALOMEDS_Tool::RemoveTemporaryFiles(theURL, aListOfTMPFileNames, true);
+ }
+
return aStreamFile._retn();
}
//----------------------------------------------------------------------------
- SALOMEDS::TMPFile*
+ SALOMEDS::TMPFile*
VISU_Gen_i
::SaveASCII(SALOMEDS::SComponent_ptr theComponent,
- const char* theURL,
- bool theIsMultiFile)
+ const char* theURL,
+ bool theIsMultiFile)
{
std::string anURL = theIsMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
if(MYDEBUG) MESSAGE("VISU_Gen_i::SaveASCII - "<<anURL);
SALOMEDS::SObject_var aSObject = anIter->Value();
CORBA::Object_var anObj = SObjectToObject(aSObject);
if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(anObj).in())){
- aResult->Save(theComponent,
- anURL,
- theIsMultiFile,
- true,
- aFileNames,
- aFiles);
+ aResult->Save(theComponent,
+ anURL,
+ theIsMultiFile,
+ true,
+ aFileNames,
+ aFiles);
}
}
if(MYDEBUG) MESSAGE("VISU_Gen_i::SaveASCII - aFileNames.size() - "<<aFileNames.size());
+ // save textures of custom point markers
+ std::string aMarkerMapFileName, aMarkerMapFile;
+ if( SaveMarkerMap( aStudy, anURL.c_str(), theIsMultiFile, true,
+ myMarkerMap, aMarkerMapFileName, aMarkerMapFile ) ) {
+ aFileNames.push_back( aMarkerMapFileName );
+ aFiles.push_back( aMarkerMapFile );
+ }
+
SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0);
if(aFileNames.empty())
return aStreamFile._retn();
//----------------------------------------------------------------------------
- char*
+ char*
VISU_Gen_i
::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
- const char* theIORString,
- CORBA::Boolean theIsMultiFile,
- CORBA::Boolean theIsASCII)
+ const char* theIORString,
+ CORBA::Boolean theIsMultiFile,
+ CORBA::Boolean theIsASCII)
{
CORBA::String_var aString("");
if(strcmp(theIORString, "") != 0){
CORBA::Object_var anObj = GetORB()->string_to_object(theIORString);
if(Storable* aStorable = dynamic_cast<Storable*>(GetServant(anObj).in())){
- aString = aStorable->ToString().c_str();
- return aString._retn();
+ aString = aStorable->ToString().c_str();
+ return aString._retn();
}
}
return aString._retn();
//----------------------------------------------------------------------------
- char*
+ char*
VISU_Gen_i
::GetID()
{
std::string myStudyName;
public:
TEvent(const std::string theStudyName):myStudyName(theStudyName)
- {}
+ {}
virtual void Execute()
- {
- bool isActive = false;
- SUIT_Session* aSession = SUIT_Session::session();
- QList<SUIT_Application*> anApplications = aSession->applications();
- QList<SUIT_Application*>::Iterator anIter = anApplications.begin();
- SUIT_Application* aFirstApp = *anIter;
- while (anIter != anApplications.end()) {
- SUIT_Application* anApp = *anIter;
- if (SUIT_Study* aSStudy = anApp->activeStudy()) {
- if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
+ {
+ bool isActive = false;
+ SUIT_Session* aSession = SUIT_Session::session();
+ QList<SUIT_Application*> anApplications = aSession->applications();
+ QList<SUIT_Application*>::Iterator anIter = anApplications.begin();
+ SUIT_Application* aFirstApp = *anIter;
+ while (anIter != anApplications.end()) {
+ SUIT_Application* anApp = *anIter;
+ if (SUIT_Study* aSStudy = anApp->activeStudy()) {
+ if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
if (_PTR(Study) aCStudy = aStudy->studyDS()) {
- if(MYDEBUG) MESSAGE("There is an application with active study : StudyId = "
- << aCStudy->StudyId() << "; Name = '" << aCStudy->Name() << "'");
- if (myStudyName == aCStudy->Name()) {
- isActive = true;
- break;
- }
- }
- }
- }
- anIter++;
- }
- if (!isActive) {
- MESSAGE("!!! anApp->onLoadDoc(myStudyName) !!!");
- // Has to be loaded in an empty or in a new application
- SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(aFirstApp);
- anApp->onLoadDoc(myStudyName.c_str());
- }
- }
+ if(MYDEBUG) MESSAGE("There is an application with active study : StudyId = "
+ << aCStudy->StudyId() << "; Name = '" << aCStudy->Name() << "'");
+ if (myStudyName == aCStudy->Name()) {
+ isActive = true;
+ break;
+ }
+ }
+ }
+ }
+ anIter++;
+ }
+ if (!isActive) {
+ MESSAGE("!!! anApp->onLoadDoc(myStudyName) !!!");
+ // Has to be loaded in an empty or in a new application
+ SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(aFirstApp);
+ anApp->onLoadDoc(myStudyName.c_str());
+ }
+ }
};
if (!CORBA::is_nil(theStudy))
// Load MED component if necessary
if(!myStudyDocument->FindComponent("MED")->_is_nil())
- {
- SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService());
- Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","MED");
- SALOME_MED::MED_Gen_var aMedEngine = SALOME_MED::MED_Gen::_narrow(aComponent);
-
- if(!CORBA::is_nil(aMedEngine))
- {
- SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
- try {
- aStudyBuilder->LoadWith( myStudyDocument->FindComponent( "MED" ), aMedEngine );
- }
- catch( const SALOME::SALOME_Exception& ) {
- // Oops, something went wrong while loading
- // See also SalomeApp_Study::openDataModel()
- }
- }
- }
+ {
+ SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService());
+ Engines::EngineComponent_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","MED");
+ SALOME_MED::MED_Gen_var aMedEngine = SALOME_MED::MED_Gen::_narrow(aComponent);
+
+ if(!CORBA::is_nil(aMedEngine))
+ {
+ SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
+ try {
+ aStudyBuilder->LoadWith( myStudyDocument->FindComponent( "MED" ), aMedEngine );
+ }
+ catch( const SALOME::SALOME_Exception& ) {
+ // Oops, something went wrong while loading
+ // See also SalomeApp_Study::openDataModel()
+ }
+ }
+ }
} else {
INFOS("CORBA::is_nil(theStudy)");
}
//----------------------------------------------------------------------------
- SALOMEDS::Study_ptr
+ SALOMEDS::Study_ptr
VISU_Gen_i
::GetCurrentStudy()
{
//----------------------------------------------------------------------------
- ViewManager_ptr
+ ViewManager_ptr
VISU_Gen_i
::GetViewManager()
{
//----------------------------------------------------------------------------
- SALOMEDS::SObject_ptr
+ SALOMEDS::SObject_ptr
VISU_Gen_i
- ::ImportTables(const char* theFileName)
+ ::ImportTables(const char* theFileName, bool theFirstStrAsTitle)
{
if(myStudyDocument->GetProperties()->IsLocked())
return SALOMEDS::SObject::_nil();
- SALOMEDS::SObject_var aRes = VISU::ImportTables(theFileName,myStudyDocument);
+ SALOMEDS::SObject_var aRes = VISU::ImportTables(theFileName,myStudyDocument,
+ theFirstStrAsTitle);
SALOMEDS::Study_var aStudy = aRes->GetStudy();
SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(aRes);
CreateTable( SO->GetID() );
}
+ bool isDone;
+ ProcessVoidEvent(new TUpdateObjBrowser(aStudy->StudyId(),&isDone));
+
return aRes._retn();
}
//----------------------------------------------------------------------------
- CORBA::Boolean
+ CORBA::Boolean
VISU_Gen_i
::ExportTableToFile(SALOMEDS::SObject_ptr theTable,
- const char* theFileName)
+ const char* theFileName)
{
return VISU::ExportTableToFile(theTable, theFileName);
}
return Result::_nil();
Result_i* aResult = Result_i::New(myStudyDocument,
- Result_i::eFile,
- Result_i::eImportFile,
- true,
- true,
- true,
- true);
+ Result_i::eFile,
+ Result_i::eImportFile,
+ true,
+ true,
+ true,
+ true);
if(aResult->Create(theFileName) != NULL)
return aResult->_this();
return Result::_nil();
Result_i* aResult = Result_i::New(myStudyDocument,
- Result_i::eFile,
- Result_i::eImportFile,
- false,
- true,
- true,
- true);
+ Result_i::eFile,
+ Result_i::eImportFile,
+ false,
+ true,
+ true,
+ true);
if(aResult->Create(theFileName) != NULL)
return aResult->_this();
return Result::_nil();
Result_i* aResult = Result_i::New(myStudyDocument,
- Result_i::eRestoredFile,
- Result_i::eCopyAndImportFile,
- true,
- true,
- true,
- true);
+ Result_i::eRestoredFile,
+ Result_i::eCopyAndImportFile,
+ true,
+ true,
+ true,
+ true);
if(aResult->Create(theFileName) != NULL)
return aResult->_this();
else
return Result::_nil();
Result_i* aResult = Result_i::New(myStudyDocument,
- Result_i::eComponent,
- Result_i::eImportMed,
- true,
- true,
- true,
- true);
+ Result_i::eComponent,
+ Result_i::eImportMed,
+ true,
+ true,
+ true,
+ true);
if (aResult->Create(theMedSObject) != NULL)
{
return aResult->_this();
}
else
aResult->_remove_ref();
-
+
return VISU::Result::_nil();
}
return Result::_nil();
Result_i* aResult = Result_i::New(myStudyDocument,
- Result_i::eComponent,
- Result_i::eImportMedField,
- true,
- true,
- true,
- true);
+ Result_i::eComponent,
+ Result_i::eImportMedField,
+ true,
+ true,
+ true,
+ true);
if (aResult->Create(theField) != NULL)
return aResult->_this();
else
aResult->_remove_ref();
-
+
return VISU::Result::_nil();
}
void
VISU_Gen_i
::RenameMeshInStudy(Result_ptr theResult,
- const std::string& theMeshName,
- int theEntity, // -1 for group indication
- const std::string& theSubMeshName, // Family or Group name
- const std::string& theNewName)
+ const std::string& theMeshName,
+ int theEntity, // -1 for group indication
+ const std::string& theSubMeshName, // Family or Group name
+ const std::string& theNewName)
{
Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
- if (!aResult)
+ if (!aResult)
return;
SALOMEDS::Study_var aStudyDocument = aResult->GetStudyDocument();
- if (aStudyDocument->GetProperties()->IsLocked())
+ if (aStudyDocument->GetProperties()->IsLocked())
return;
VISU::VISUType aType;
if (theEntity >= 0)
if (theSubMeshName == "")
- aType = VISU::TENTITY;
+ aType = VISU::TENTITY;
else
- aType = VISU::TFAMILY;
+ aType = VISU::TFAMILY;
else
aType = VISU::TGROUP;
}
string anEntry = aResult->GetEntry(aRestoringMap);
- if (anEntry == "")
+ if (anEntry == "")
return;
SALOMEDS::SObject_ptr aSObject = aStudyDocument->FindObjectID(anEntry.c_str());
void
VISU_Gen_i
::RenameEntityInStudy(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theNewName)
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theNewName)
{
RenameMeshInStudy(theResult, theMeshName, (int)theEntity, "", theNewName);
}
void
VISU_Gen_i
::RenameFamilyInStudy(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFamilyName,
- const char* theNewName)
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFamilyName,
+ const char* theNewName)
{
RenameMeshInStudy(theResult, theMeshName, (int)theEntity, theFamilyName, theNewName);
}
//----------------------------------------------------------------------------
- void
+ void
VISU_Gen_i
::RenameGroupInStudy(Result_ptr theResult,
- const char* theMeshName,
- const char* theGroupName,
- const char* theNewName)
+ const char* theMeshName,
+ const char* theGroupName,
+ const char* theNewName)
{
RenameMeshInStudy(theResult, theMeshName, -1, theGroupName, theNewName);
}
Mesh_ptr
VISU_Gen_i
::MeshOnEntity(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity)
+ const char* theMeshName,
+ VISU::Entity theEntity)
{
Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
- if (!aResult)
+ if (!aResult)
return VISU::Mesh::_nil();
SALOMEDS::Study_var aStudyDocument = aResult->GetStudyDocument();
- if (aStudyDocument->GetProperties()->IsLocked())
+ if (aStudyDocument->GetProperties()->IsLocked())
return VISU::Mesh::_nil();
Mesh_i* aPresent = new Mesh_i();
//----------------------------------------------------------------------------
- Mesh_ptr
+ Mesh_ptr
VISU_Gen_i
::FamilyMeshOnEntity(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFamilyName)
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFamilyName)
{
Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
- if (!aResult)
+ if (!aResult)
return VISU::Mesh::_nil();
SALOMEDS::Study_var aStudyDocument = aResult->GetStudyDocument();
- if (aStudyDocument->GetProperties()->IsLocked())
+ if (aStudyDocument->GetProperties()->IsLocked())
return VISU::Mesh::_nil();
Mesh_i* aPresent = new Mesh_i();
Mesh_ptr
VISU_Gen_i
::GroupMesh(Result_ptr theResult,
- const char* theMeshName,
- const char* theGroupName)
+ const char* theMeshName,
+ const char* theGroupName)
{
Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
- if (!aResult)
+ if (!aResult)
return VISU::Mesh::_nil();
SALOMEDS::Study_var aStudyDocument = aResult->GetStudyDocument();
- if (aStudyDocument->GetProperties()->IsLocked())
+ if (aStudyDocument->GetProperties()->IsLocked())
return VISU::Mesh::_nil();
Mesh_i* aPresent = new Mesh_i();
//----------------------------------------------------------------------------
- ScalarMap_ptr
+ ScalarMap_ptr
VISU_Gen_i
::ScalarMapOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::ScalarMap_i>(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theIteration)._retn();
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
GaussPoints_ptr
VISU_Gen_i
::GaussPointsOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::GaussPoints_i>(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theIteration)._retn();
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
//---------------------------------------------------------------
- DeformedShape_ptr
+ DeformedShape_ptr
VISU_Gen_i
::DeformedShapeOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::DeformedShape_i>(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theIteration)._retn();
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
//---------------------------------------------------------------
- DeformedShapeAndScalarMap_ptr
+ DeformedShapeAndScalarMap_ptr
VISU_Gen_i
::ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return DeformedShapeAndScalarMapOnField(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theIteration);
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration);
}
-
+
//---------------------------------------------------------------
- DeformedShapeAndScalarMap_ptr
+ DeformedShapeAndScalarMap_ptr
VISU_Gen_i
::DeformedShapeAndScalarMapOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::DeformedShapeAndScalarMap_i>(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theIteration)._retn();
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
-
+
//---------------------------------------------------------------
- Vectors_ptr
+ Vectors_ptr
VISU_Gen_i
::VectorsOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::Vectors_i>(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theIteration)._retn();
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
//---------------------------------------------------------------
- IsoSurfaces_ptr
+ IsoSurfaces_ptr
VISU_Gen_i
::IsoSurfacesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::IsoSurfaces_i>(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theIteration)._retn();
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
//---------------------------------------------------------------
- StreamLines_ptr
+ StreamLines_ptr
VISU_Gen_i
::StreamLinesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::StreamLines_i>(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theIteration)._retn();
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
//---------------------------------------------------------------
- Plot3D_ptr
+ Plot3D_ptr
VISU_Gen_i
::Plot3DOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::Plot3D_i>(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theIteration)._retn();
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
CutPlanes_ptr
VISU_Gen_i
::CutPlanesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::CutPlanes_i>(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theIteration)._retn();
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
CutLines_ptr
VISU_Gen_i
::CutLinesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::CutLines_i>(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theIteration)._retn();
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
+ }
+
+ //---------------------------------------------------------------
+ CutSegment_ptr
+ VISU_Gen_i
+ ::CutSegmentOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
+ {
+ return Prs3dOnField<VISU::CutSegment_i>(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
//---------------------------------------------------------------
const char* myTableEntry;
typedef Table_ptr TResult;
TResult myResult;
-
+
CreateTableEvent(SALOMEDS::Study_var theStudy, const char* theTableEntry)
{
myStudyDocument = theStudy;
myTableEntry = theTableEntry;
myResult = Table::_nil();
}
-
+
virtual
void
Execute()
SALOMEDS::SObject_var SO = myStudyDocument->FindObjectID(myTableEntry);
SALOMEDS::GenericAttribute_var anAttr;
if ( SO->FindAttribute(anAttr, "AttributeTableOfReal") ) {
- SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
- if ( isSparseMatrix( aTableOfReal ) ) {
- PointMap3d_i* pPresent = new PointMap3d_i(myStudyDocument,myTableEntry);
- if(pPresent->Create() != NULL)
- myResult = pPresent->_this();
- else {
- pPresent->_remove_ref();
- myResult = VISU::Table::_nil();
- }
- return;
- }
+ SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
+ if ( isSparseMatrix( aTableOfReal ) ) {
+ PointMap3d_i* pPresent = new PointMap3d_i(myStudyDocument,myTableEntry);
+ if(pPresent->Create() != NULL)
+ myResult = pPresent->_this();
+ else {
+ pPresent->_remove_ref();
+ myResult = VISU::Table::_nil();
+ }
+ return;
+ }
}
Table_i* pPresent = new Table_i(myStudyDocument,myTableEntry);
if(pPresent->Create() != NULL)
- myResult = pPresent->_this();
+ myResult = pPresent->_this();
else {
- pPresent->_remove_ref();
- myResult = VISU::Table::_nil();
+ pPresent->_remove_ref();
+ myResult = VISU::Table::_nil();
}
}
{
int aCols = theTableOfReal->GetNbColumns();
int aRows = theTableOfReal->GetNbRows();
-
+
for (int i=1; i<=aCols; i++) {
- for (int j=1; j<=aRows; j++) {
- if ( !(theTableOfReal->HasValue(j, i)) )
- return false;
- }
+ for (int j=1; j<=aRows; j++) {
+ if ( !(theTableOfReal->HasValue(j, i)) )
+ return false;
+ }
}
return true;
}
{
TCollection_AsciiString tmp( (char*)theTableEntry ); // 11.06.2008 IPAL18844
if( myStudyDocument->GetProperties()->IsLocked() ||
- tmp.Length()==0 )
+ tmp.Length()==0 )
return Table::_nil();
return ProcessEvent(new CreateTableEvent(myStudyDocument, theTableEntry));
Curve_ptr
VISU_Gen_i
::CreateCurve(Table_ptr theTable,
- CORBA::Long theHRow,
- CORBA::Long theVRow)
+ CORBA::Long theHRow,
+ CORBA::Long theVRow)
{
- return CreateCurveWithZ( theTable, theHRow, theVRow, 0 );
+ return CreateCurveWithZExt( theTable, theHRow, theVRow, 0, false );
}
Curve_ptr
VISU_Gen_i
::CreateCurveWithZ(Table_ptr theTable,
- CORBA::Long theHRow,
- CORBA::Long theVRow,
- CORBA::Long theZRow)
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow)
+ {
+ return CreateCurveWithZExt( theTable, theHRow, theVRow, theZRow, false );
+ }
+
+
+ //---------------------------------------------------------------
+ Curve_ptr
+ VISU_Gen_i
+ ::CreateCurveWithZExt(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow,
+ CORBA::Boolean theIsV2)
{
if(myStudyDocument->GetProperties()->IsLocked())
return Curve::_nil();
Mutex mt(myMutex);
PortableServer::POA_ptr aPOA = GetPOA();
Table_i* pTable = dynamic_cast<Table_i*>(aPOA->reference_to_servant(theTable));
- Curve_i* pPresent = new Curve_i(myStudyDocument,pTable,theHRow,theVRow,theZRow);
+ Curve_i* pPresent = new Curve_i(myStudyDocument,pTable,theHRow,theVRow,theZRow,theIsV2);
if(pPresent->Create() != NULL)
return pPresent->_this();
else{
}
-
//---------------------------------------------------------------
Container_ptr
VISU_Gen_i
}
+ //---------------------------------------------------------------
+ Evolution_ptr
+ VISU_Gen_i
+ ::CreateEvolution(XYPlot_ptr theXYPlot)
+ {
+ if(myStudyDocument->GetProperties()->IsLocked())
+ return Evolution::_nil();
+ Mutex mt(myMutex);
+ if(VISU_Evolution_i* anEvolution = new VISU_Evolution_i(myStudyDocument,theXYPlot)){
+ return anEvolution->_this();
+ }else
+ return VISU::Evolution::_nil();
+ }
+
+
//---------------------------------------------------------------
void
VISU_Gen_i
void
VISU_Gen_i
::Close(SALOMEDS::SComponent_ptr theComponent)
- {}
+ {
+ if ( !CORBA::is_nil( theComponent ) ) {
+ SALOMEDS::Study_var aStudy = theComponent->GetStudy();
+ // 1. Decrement reference counter for published GenericObj-based servants
+ SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator( theComponent );
+ anIter->InitEx( true );
+ for ( ; anIter->More(); anIter->Next() ) {
+ SALOMEDS::SObject_var aSObject = anIter->Value();
+ if ( CORBA::is_nil( aSObject ) ) continue;
+ CORBA::Object_var anObject = aSObject->GetObject();
+ if ( CORBA::is_nil( anObject ) ) continue;
+ SALOME::GenericObj_var aGenericObj = SALOME::GenericObj::_narrow( anObject );
+ if ( !CORBA::is_nil( aGenericObj ) ) aGenericObj->UnRegister();
+ }
+
+ if ( !CORBA::is_nil( myStudyDocument ) && !CORBA::is_nil( aStudy ) &&
+ myStudyDocument->StudyId() == aStudy->StudyId() )
+ myStudyDocument = SALOMEDS::Study::_nil();
+ }
+ }
//---------------------------------------------------------------
- char*
+ char*
VISU_Gen_i
::ComponentDataType()
{
//---------------------------------------------------------------
bool
VISU_Gen_i
- ::CanPublishInStudy(CORBA::Object_ptr theIOR)
+ ::CanPublishInStudy(CORBA::Object_ptr theIOR)
{
Result_var aResultObj = Result::_narrow(theIOR);
return !(aResultObj->_is_nil());
SALOMEDS::SObject_ptr
VISU_Gen_i
::PublishInStudy(SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject,
- CORBA::Object_ptr theObject,
- const char* theName)
+ SALOMEDS::SObject_ptr theSObject,
+ CORBA::Object_ptr theObject,
+ const char* theName)
throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SalomeException);
Mutex mt(myMutex);
SALOMEDS::SObject_var aResultSO;
Result_i* aResultObj = dynamic_cast<Result_i*>(GetServant(theObject).in());
- if (!aResultObj)
+ if (!aResultObj)
return aResultSO._retn();
const QFileInfo& aFileInfo = aResultObj->GetFileInfo();
CORBA::String_var anEntry = aResultObj->Create((const char*)aFileInfo.absoluteFilePath().toLatin1())->GetID();
//---------------------------------------------------------------
- CORBA::Boolean
+ CORBA::Boolean
VISU_Gen_i
- ::CanCopy(SALOMEDS::SObject_ptr theObject)
+ ::CanCopy(SALOMEDS::SObject_ptr theObject)
{
CORBA::Object_var anObj = SObjectToObject(theObject);
if (Storable* aStorable = dynamic_cast<Storable*>(GetServant(anObj).in()))
//---------------------------------------------------------------
- SALOMEDS::TMPFile*
+ SALOMEDS::TMPFile*
VISU_Gen_i
- ::CopyFrom(SALOMEDS::SObject_ptr theObject,
- CORBA::Long& theObjectID)
+ ::CopyFrom(SALOMEDS::SObject_ptr theObject,
+ CORBA::Long& theObjectID)
{
theObjectID = 0;
SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile;
SALOMEDS::ListOfFileNames_var aListOfFileNames = new SALOMEDS::ListOfFileNames;
aListOfFileNames->length(aFileNames.size());
for(size_t anId = 0; anId < aFileNames.size(); anId++)
- aListOfFileNames[anId] = aFileNames[anId].c_str();
+ aListOfFileNames[anId] = aFileNames[anId].c_str();
if(anIsDone)
- aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aListOfFileNames.in(), false);
+ aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aListOfFileNames.in(), false);
SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aListOfFileNames.in(), true);
}
//---------------------------------------------------------------
- CORBA::Boolean
+ CORBA::Boolean
VISU_Gen_i
::CanPaste(const char* theComponentName, CORBA::Long theObjectID) {
// The VISU component can paste only objects copied by VISU component
SALOMEDS::SObject_ptr
VISU_Gen_i
::PasteInto(const SALOMEDS::TMPFile& theStream,
- CORBA::Long theObjectID,
- SALOMEDS::SObject_ptr theSObject)
+ CORBA::Long theObjectID,
+ SALOMEDS::SObject_ptr theSObject)
{
if (theObjectID != 1)
return SALOMEDS::SObject::_nil();
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
CORBA::String_var aComponentID(aComponent->GetID());
CORBA::String_var aSObjectID(theSObject->GetID());
-
+
SALOMEDS::SObject_var aSObject;
if (strcmp(aComponentID, aSObjectID) == 0) //create the new result SObject
aSObject = aStudyBuilder->NewObject(aComponent);
else
aSObject = SALOMEDS::SObject::_duplicate(theSObject);
-
+
std::string aTmpDir = SALOMEDS_Tool::GetTmpDir();
- SALOMEDS::ListOfFileNames_var aListOfFileNames =
+ SALOMEDS::ListOfFileNames_var aListOfFileNames =
SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir, false);
if(MYDEBUG) MESSAGE("Result_i::PasteInto - aListOfFileNames->length() = "<<aListOfFileNames->length());
-
- std::ostrstream aLocalPersistentID;
+
+ std::ostringstream aLocalPersistentID;
{
std::string aCopyPersist = aTmpDir + "copy_persistent";
std::ifstream anInputFileStream( aCopyPersist.c_str() );
anInputFileStream >> aLocalPersistentID.rdbuf();
}
-
+
//Just for Result::Restore to find the Comment attribute :(
SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeString");
-
+
std::string aFileName(aTmpDir);
if(aListOfFileNames->length() > 1)
aFileName += aListOfFileNames[1].in();
Storable* aStorable = Storable::Create(aSObject, aLocalPersistentID.str(), aFileName, false);
-
+
SALOMEDS::ListOfFileNames_var aFilesToRemove = new SALOMEDS::ListOfFileNames;
aFilesToRemove->length(1);
aFilesToRemove[0] = aListOfFileNames[0];
SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aFilesToRemove.in(), true);
-
+
anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeIOR");
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
CORBA::String_var anIORValue(aStorable->GetID());
anIOR->SetValue(anIORValue);
-
+
return aSObject._retn();
}
return ColoredPrs3dCache_i::GetInstance(theStudy);
}
-
- CORBA::Long VISU_Gen_i::CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
- CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
- CORBA::Boolean isAuto, const char* name)
+
+ CORBA::Long VISU_Gen_i::CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
+ CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
+ CORBA::Boolean isAuto, const char* name)
{
return myClippingPlaneMgr.CreateClippingPlane(X, Y, Z, dX, dY, dZ, isAuto, name);
}
-
- void VISU_Gen_i::EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
- CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
- CORBA::Boolean isAuto, const char* name)
+
+ void VISU_Gen_i::EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
+ CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
+ CORBA::Boolean isAuto, const char* name)
{
myClippingPlaneMgr.EditClippingPlane(id, X, Y, Z, dX, dY, dZ, isAuto, name);
}
-
+
/* Returns clipping plane by its Id */
VISU::ClippingPlane* VISU_Gen_i::GetClippingPlane(CORBA::Long id)
{
VISU_CutPlaneFunction* aPlane = myClippingPlaneMgr.GetClippingPlane(id);
-
+
if (aPlane != NULL) {
double aOrigin[3];
double aDir[3];
}
return NULL;
}
-
+
/* Deletes clipping plane by its Id */
CORBA::Boolean VISU_Gen_i::DeleteClippingPlane(CORBA::Long id)
{
return myClippingPlaneMgr.DeleteClippingPlane(id);
}
-
+
/* Applyes a clipping plane with Id to presentation thePrs */
CORBA::Boolean VISU_Gen_i::ApplyClippingPlane(Prs3d_ptr thePrs, CORBA::Long id)
{
VISU::Prs3d_i* aPrs = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(thePrs).in());
return myClippingPlaneMgr.DetachClippingPlane(aPrs, id);
}
-
+
/* Get number of clipping planes */
CORBA::Long VISU_Gen_i::GetClippingPlanesNb()
{
CORBA::Boolean
VISU_Gen_i
::VTK2MED( const VISU::string_array& theVTKFiles,
- const char* theMEDFile,
- const char* theMeshName,
- const VISU::double_array& theTStamps )
+ const char* theMEDFile,
+ const char* theMeshName,
+ const VISU::double_array& theTStamps )
{
if ( !theMEDFile || !theVTKFiles.length() )
return false;
return res == 0;
}
+
+ CORBA::Long
+ VISU_Gen_i
+ ::LoadTexture(const char* theTextureFile)
+ {
+ if( CORBA::is_nil( myStudyDocument ) )
+ return 0;
+
+ int aStudyId = myStudyDocument->StudyId();
+
+ VTK::MarkerTexture aMarkerTexture;
+ if( !VTK::LoadTextureData( theTextureFile, VTK::MS_NONE, aMarkerTexture ) )
+ return 0;
+
+ VTK::MarkerMap& aMarkerMap = myMarkerMap[ aStudyId ];
+ int aMarkerId = VTK::GetUniqueId( aMarkerMap );
+
+ VTK::MarkerData& aMarkerData = aMarkerMap[ aMarkerId ];
+ aMarkerData.first = theTextureFile;
+ aMarkerData.second = aMarkerTexture;
+
+ return aMarkerId;
+ }
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_Gen_i.hh
// Author : Alexey Petrov
// Module : VISU
#include "VISU_ColoredPrs3d_i.hh"
#include "VISU_ClippingPlaneMgr.hxx"
+#include <VTKViewer_MarkerDef.h>
+
+#include <map>
#include <string>
namespace VISU
{
+ //----------------------------------------------------------------------------
+ typedef std::map<int, VTK::MarkerMap> StudyId2MarkerMap;
+
//----------------------------------------------------------------------------
class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
public virtual ::Engines_Component_i,
SALOMEDS::Study_var myStudyDocument;
VISU_ClippingPlaneMgr myClippingPlaneMgr;
+ StudyId2MarkerMap myMarkerMap;
+
VISU_Gen_i(const VISU::VISU_Gen_i &);
public:
VISU_Gen_i(CORBA::ORB_ptr theORB,
virtual
SALOMEDS::SObject_ptr
- ImportTables(const char* theFileName);
+ ImportTables(const char* theFileName, bool theFirstStrAsTitle = false);
virtual
CORBA::Boolean
const char* theFieldName,
CORBA::Long theIteration);
+ virtual
+ CutSegment_ptr
+ CutSegmentOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration);
+
virtual
StreamLines_ptr
StreamLinesOnField(Result_ptr theResult,
CreateCurve(Table_ptr theTable,
CORBA::Long theHRow,
CORBA::Long theVRow);
+
virtual
Curve_ptr
CreateCurveWithZ(Table_ptr theTable,
- CORBA::Long theHRow,
- CORBA::Long theVRow,
- CORBA::Long theZRow);
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow);
+
+ virtual
+ Curve_ptr
+ CreateCurveWithZExt(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow,
+ CORBA::Boolean theIsV2);
virtual
Container_ptr
Animation_ptr
CreateAnimation(View3D_ptr theView3d);
+ virtual
+ Evolution_ptr
+ CreateEvolution(XYPlot_ptr theXYPLot);
+
virtual
void
DeleteResult(Result_ptr theResult);
Engines::TMPFile*
DumpPython(CORBA::Object_ptr theStudy,
CORBA::Boolean theIsPublished,
+ CORBA::Boolean theIsMultiFile,
CORBA::Boolean& theIsValidScript);
// inherited methods from SALOMEDS::Driver
const char* theMeshName,
const VISU::double_array& theTStamps);
+ /* Load texture from file */
+ virtual CORBA::Long LoadTexture(const char* theTextureFile);
+
+ StudyId2MarkerMap& GetMarkerMap() { return myMarkerMap; }
};
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
#include "VISU_Plot3D_i.hh"
#include "VISU_CutPlanes_i.hh"
#include "VISU_CutLines_i.hh"
+#include "VISU_CutSegment_i.hh"
#include "VISU_Vectors_i.hh"
#include "VISU_StreamLines_i.hh"
#include "VISU_GaussPoints_i.hh"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_I.hxx
// Author : Oleg UVAROV
// Module : VISU
#define _VISU_I_HXX_
#ifdef WNT
-# if defined VISU_I_EXPORTS
+# if defined VISU_I_EXPORTS || defined VISUEngineImpl_EXPORTS
# define VISU_I_EXPORT __declspec( dllexport )
# else
# define VISU_I_EXPORT __declspec( dllimport )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.cxx
// Author : Alexey PETROV
myNbLabels = VISU::Storable::FindValue(theMap,"myNbLabels").toInt();
myIsLabeled = VISU::Storable::FindValue(theMap,"myIsLabeled").toInt();
SetSubRange(aMin,aMax);
+
+ SetSubRangeFixed(VISU::Storable::FindValue(theMap,"myIsRangeFixed").toInt());
return this;
}
Storable::DataToStream( theStr, "myRange[1]", GetSubMax() );
Storable::DataToStream( theStr, "myNbLabels", myNbLabels );
Storable::DataToStream( theStr, "myIsLabeled", myIsLabeled );
+ Storable::DataToStream( theStr, "myIsRangeFixed", IsSubRangeFixed() );
}
//---------------------------------------------------------------
::SetSubRange(CORBA::Double theMin, CORBA::Double theMax)
{
VISU::TSetModified aModified(this);
-
+
+ bool isForced = false;
vtkFloatingPointType aRange[2] = {theMin, theMax};
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_IsoSurfacesPL, vtkFloatingPointType*>
- (GetSpecificPL(), &VISU_IsoSurfacesPL::SetRange, aRange));
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_IsoSurfacesPL, vtkFloatingPointType*, bool>
+ (GetSpecificPL(), &VISU_IsoSurfacesPL::SetRange, aRange, isForced));
}
//---------------------------------------------------------------
return myIsoSurfacesPL->GetMax();
}
+//---------------------------------------------------------------
+void
+VISU::IsoSurfaces_i
+::SetSubRangeFixed(CORBA::Boolean theIsFixed)
+{
+ VISU::TSetModified aModified(this);
+
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_IsoSurfacesPL, bool>
+ (GetSpecificPL(), &VISU_IsoSurfacesPL::SetRangeFixed, theIsFixed));
+}
+
+//---------------------------------------------------------------
+CORBA::Boolean
+VISU::IsoSurfaces_i
+::IsSubRangeFixed()
+{
+ return myIsoSurfacesPL->IsRangeFixed();
+}
+
//---------------------------------------------------------------
void
anActor->SetVTKMapping(true);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU" , "iso_surfaces_represent", 2);
+ bool toUseShading = aResourceMgr->booleanValue("VISU", "represent_shading", false);
anActor->SetRepresentation(aDispMode);
+ anActor->SetShading(toUseShading);
UpdateActor(anActor);
}catch(...){
anActor->Delete();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.hxx
// Author : Alexey PETROV
CORBA::Double
GetSubMax();
+ virtual
+ void
+ SetSubRangeFixed(CORBA::Boolean theIsFixed);
+
+ virtual
+ CORBA::Boolean
+ IsSubRangeFixed();
+
VISU_IsoSurfacesPL*
GetSpecificPL() const
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.cxx
// Author : Alexey PETROV
//
#include "VISU_Mesh_i.hh"
#include "VISU_Prs3dUtils.hh"
+#include "VISU_Tools.h"
#include "VISU_Result_i.hh"
#include "VISU_Convertor.hxx"
#include "SALOME_Event.h"
+#include <SUIT_ResourceMgr.h>
-#include "SUIT_ResourceMgr.h"
#ifdef _DEBUG_
static int MYDEBUG = 0;
throw std::runtime_error("Mesh_i::Build - GetCResult()->GetInput() == NULL !!!");
if (!theRestoring) {
myPresentType = VISU::PresentationType(VISU::GetResourceMgr()->integerValue("VISU" , "mesh_represent", 2));
- myIsShrank = (myPresentType == VISU::SHRINK);
+ myIsShrank |= (myPresentType == VISU::SHRINK);
if(myEntity == VISU::NODE_ENTITY)
myPresentType = VISU::POINT;
SetName((const char*)GenerateName().toLatin1(), false);
myCellColor.R = 0.0; myCellColor.G = myCellColor.B = 1.0;
myNodeColor.R = myNodeColor.G = 1.0; myNodeColor.B = 1.0;
- myLinkColor.R = myLinkColor.G = myLinkColor.B = 83/255.;
+
+ QColor aColor = VISU::GetResourceMgr()->colorValue( "VISU", "edge_color", QColor( 255, 255, 255 ) );
+ SALOMEDS::Color aLinkColor;
+ aLinkColor.R = aColor.red()/255.;
+ aLinkColor.G = aColor.green()/255.;
+ aLinkColor.B = aColor.blue()/255.;
+ SetLinkColor(aLinkColor);
+
+ my2DQuadPrsType = VISU::Quadratic2DPresentationType(VISU::GetResourceMgr()->integerValue( "VISU", "quadratic_mode", 0));
}
if(myEntity >= 0)
SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
aStudyBuilder->RemoveAttribute(GetSObject(), "AttributePixMap");
+ //Set visibility state to Qtx::UnpresentableState
+ VISU::SetVisibilityState(GetEntry(), Qtx::UnpresentableState);
+
+
+
+
+
ProcessVoidEvent(new TRemoveFromStudy(this));
}
}
+void
+VISU::Mesh_i
+::SetQuadratic2DPresentationType(VISU::Quadratic2DPresentationType theType)
+{
+ if(my2DQuadPrsType == theType)
+ return;
+
+ VISU::TSetModified aModified(this);
+ my2DQuadPrsType = theType;
+ myParamsTime.Modified();
+}
+
+
//----------------------------------------------------------------------------
VISU::PresentationType
VISU::Mesh_i
}
+//----------------------------------------------------------------------------
+VISU::Quadratic2DPresentationType
+VISU::Mesh_i
+::GetQuadratic2DPresentationType()
+{
+ return my2DQuadPrsType;
+}
+
+
+
+
//----------------------------------------------------------------------------
VISU::Entity
VISU::Mesh_i
myPresentType = VISU::PresentationType(VISU::Storable::FindValue(theMap,"myPresentType").toInt());
+ my2DQuadPrsType = VISU::Quadratic2DPresentationType(VISU::Storable::FindValue(theMap,"my2DQuadPrsType").toInt());
+
myIsShrank = (VISU::Storable::FindValue(theMap,"myIsShrank", "0").toInt() == 1)? true: false;
myCellColor.R = VISU::Storable::FindValue(theMap,"myCellColor.R").toDouble();
Storable::DataToStream( theStr, "myPresentType", int(myPresentType) );
+ Storable::DataToStream( theStr, "my2DQuadPrsType", int(my2DQuadPrsType) );
+
Storable::DataToStream( theStr, "myIsShrank", (myIsShrank? "1":"0"));
Storable::DataToStream( theStr, "myCellColor.R", myCellColor.R );
aResourceMgr->booleanValue("VISU", "show_non_manifold_edges", false) );
anActor->SetFeatureEdgesColoring( aResourceMgr->booleanValue("VISU", "feature_edges_coloring", false) );
+ if (myType == VISU::TGROUP )
+ {
+ anActor->SetIsDisplayNameActor( true );
+ anActor->SetNameActorText( GetSubMeshName().c_str() );
+ }
+
UpdateActor(anActor);
}catch (...) {
anActor->Delete();
else
anActor->UnShrink();
}
+ if(my2DQuadPrsType == VISU::LINES)
+ anActor->SetQuadratic2DRepresentation(VISU_Actor::eLines);
+ else{
+ anActor->SetQuadratic2DRepresentation(VISU_Actor::eArcs);
+ }
anActor->GetSurfaceProperty()->SetColor(myCellColor.R, myCellColor.G, myCellColor.B);
anActor->GetEdgeProperty()->SetColor(myLinkColor.R, myLinkColor.G, myLinkColor.B);
anActor->GetNodeProperty()->SetColor(myNodeColor.R, myNodeColor.G, myNodeColor.B);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.hxx
// Author : Alexey PETROV
void
SetPresentationType(VISU::PresentationType theType);
+ virtual
+ void
+ SetQuadratic2DPresentationType(VISU::Quadratic2DPresentationType theType);
+
+ virtual
+ VISU::Quadratic2DPresentationType
+ GetQuadratic2DPresentationType();
+
virtual
VISU::PresentationType
GetPresentationType();
std::string mySubMeshName;
VISU::VISUType myType;
- VISU::PresentationType myPresentType;
+ VISU::PresentationType myPresentType;
+ VISU::Quadratic2DPresentationType my2DQuadPrsType;
SALOMEDS::Color myCellColor;
SALOMEDS::Color myNodeColor;
SALOMEDS::Color myLinkColor;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_MonoColorPrs_i.cxx
// Author : Vitaly Smetannikov
{
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
if(IsColored()){
- anActor->SetBarVisibility(true);
GetPipeLine()->GetMapper()->SetScalarVisibility(1);
}else{
- anActor->SetBarVisibility(false);
GetPipeLine()->GetMapper()->SetScalarVisibility(0);
anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
}
TSuperClass::UpdateActor(theActor);
+
+ // this method should be called after TSuperClass::UpdateActor()
+ anActor->SetBarVisibility( IsBarVisible() && IsColored() );
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_MonoColorPrs_i.hxx
// Author : Vitaly Smetannikov
#ifndef VISU_MonoColorPrs_i_HeaderFile
#define VISU_MonoColorPrs_i_HeaderFile
-#include <VISU_I.hxx>
+#include "VISU_I.hxx"
#include "VISU_ScalarMap_i.hh"
namespace VISU
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_MultiResult_i.cc
// Author : Alexey PETROV
#include <QStringList>
-#include <strstream>
+#include <sstream>
#ifdef _DEBUG_
static int MYDEBUG = 0;
GetPartInfo(const std::string theInfoString)
{
MultiResult_i::TPartInfo aPartInfo;
- std::istrstream anOutputStream(theInfoString.c_str());
+ std::istringstream anOutputStream(theInfoString.c_str());
anOutputStream>>aPartInfo;
return aPartInfo;
}
_PTR(SObject) aSObject = aStudy->FindObjectID(aFatherEntry);
aRestoringMap = Storable::GetStorableMap(aSObject);
- std::ostrstream anOutputStream;
+ std::ostringstream anOutputStream;
anOutputStream<<"myComment=PART;";
anOutputStream<<"myName="<<thePartName<<";";
anOutputStream<<"myMeshName="<<theMeshName<<";";
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_MultiResult_i.hh
// Author : Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_OptionalDeformation_i.cc
// Author :
// Module : VISU
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_Deformation_i.hxx
// Author :
// Module : VISU
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VISU_Plot3D_i.hh"
#include "VISU_Prs3dUtils.hh"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VISU_Plot3D_i_HeaderFile
#define VISU_Plot3D_i_HeaderFile
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PointMap3d_i.cc
// Author : Dmitry Matveitchev
//
#include "VISU_PointMap3d_i.hh"
-#include "VISU_CutLines_i.hh"
+#include "VISU_CutLinesBase_i.hh"
+#include "VISU_CutSegment_i.hh"
#include "VISU_Result_i.hh"
#include "VISU_ViewManager_i.hh"
#include "VISU_ScalarBarActor.hxx"
if ( GetName() == "" ) {
if ( !mySObj->_is_nil() ) {
- CutLines_i* pCutLines = NULL;
+ CutLinesBase_i* pCutLines = NULL;
CORBA::Object_var anObj = SObjectToObject(mySObj);
if(!CORBA::is_nil(anObj)){
- VISU::CutLines_var aCutLines = VISU::CutLines::_narrow(anObj);
+ VISU::CutLinesBase_var aCutLines = VISU::CutLinesBase::_narrow(anObj);
if(!aCutLines->_is_nil())
- pCutLines = dynamic_cast<CutLines_i*>(GetServant(aCutLines).in());
+ pCutLines = dynamic_cast<CutLinesBase_i*>(GetServant(aCutLines).in());
}
if (!pCutLines)
if (mySObj->GetName()) SetName(mySObj->GetName(), false);
IsShadowLabel()? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
aScalarBar->Modified();
+
+ anActor->highlight(anActor->isHighlighted()); // like in VISU::Prs3d_i::UpdateActor()
}
theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
}
SALOMEDS::SObject_var SO = mySObj;
if ( !SO->_is_nil() ) {
- CutLines_i* pCutLines = NULL;
+ CutLinesBase_i* pCutLines = NULL;
CORBA::Object_var anObj = SObjectToObject(SO);
if(!CORBA::is_nil(anObj)){
- VISU::CutLines_var aCutLines = VISU::CutLines::_narrow(anObj);
+ VISU::CutLinesBase_var aCutLines = VISU::CutLinesBase::_narrow(anObj);
if(!aCutLines->_is_nil())
- pCutLines = dynamic_cast<CutLines_i*>(GetServant(aCutLines).in());
+ pCutLines = dynamic_cast<CutLinesBase_i*>(GetServant(aCutLines).in());
}
SALOMEDS::Study_var aStudy = GetStudyDocument();
SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
// look for component
if ( !theRestoring ) {
- SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
- // create SObject and set attributes
- QString aComment;
- if(pCutLines)
- aComment.sprintf("myComment=%s;mySourceId=CutLines",GetComment());
- else{
- aComment.sprintf("myComment=%s;mySourceId=TableAttr",GetComment());
- SALOMEDS::SObject_var aFatherSObject = SO->GetFather();
- if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){
- SALOMEDS::AttributeString_var aCommentAttr =
- SALOMEDS::AttributeString::_narrow(anAttr);
- CORBA::String_var aValue = aCommentAttr->Value();
- Storable::TRestoringMap aMap;
- Storable::StringToMap(aValue.in(),aMap);
- bool anIsExist;
- QString aMethodName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist);
- if(anIsExist){
- if(aMethodName == "ImportTables"){
- aComment.sprintf("myComment=%s;mySourceId=TableFile",GetComment());
- }
- }
- }
- }
-
- string anEntry = CreateAttributes( GetStudyDocument(),
- SO->GetID(),//SComponent->GetID(),
- "ICON_TREE_TABLE",
- GetID(),
- GetName(),
- "",
- aComment.toLatin1().constData(),
- pCutLines );
- // create SObject referenced to real table object
- mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID( anEntry.c_str() ));
- if(pCutLines) {
- pCutLines->BuildTableOfReal(mySObj);
- }
- // mpv (PAL5357): reference attributes are unnecessary now
- //SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
- //Builder->Addreference( refSO, SO );
+ SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
+ // create SObject and set attributes
+ QString aComment;
+ if(pCutLines)
+ aComment.sprintf("myComment=%s;mySourceId=CutLines",GetComment());
+ else{
+ aComment.sprintf("myComment=%s;mySourceId=TableAttr",GetComment());
+ SALOMEDS::SObject_var aFatherSObject = SO->GetFather();
+ if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){
+ SALOMEDS::AttributeString_var aCommentAttr =
+ SALOMEDS::AttributeString::_narrow(anAttr);
+ CORBA::String_var aValue = aCommentAttr->Value();
+ Storable::TRestoringMap aMap;
+ Storable::StringToMap(aValue.in(),aMap);
+ bool anIsExist;
+ QString aMethodName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist);
+ if(anIsExist){
+ if(aMethodName == "ImportTables"){
+ aComment.sprintf("myComment=%s;mySourceId=TableFile",GetComment());
+ }
+ }
+ }
+ }
+
+ string anEntry = CreateAttributes( GetStudyDocument(),
+ SO->GetID(),//SComponent->GetID(),
+ "ICON_TREE_TABLE",
+ GetID(),
+ GetName(),
+ "",
+ aComment.toLatin1().constData(),
+ pCutLines );
+ // create SObject referenced to real table object
+ mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID( anEntry.c_str() ));
+ if(pCutLines) {
+ bool isCutSegment = dynamic_cast<CutSegment_i*>(pCutLines);
+ pCutLines->BuildTableOfReal(mySObj, isCutSegment);
+ }
+ // mpv (PAL5357): reference attributes are unnecessary now
+ //SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
+ //Builder->Addreference( refSO, SO );
}
return this;
*/
VISU::Storable* VISU::PointMap3d_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO)
{
+ VISU::Table_i::Restore( theMap, SO);
if(MYDEBUG) MESSAGE(GetComment());
SetName(VISU::Storable::FindValue(theMap,"myName").toLatin1().constData(), false);
myTitle = VISU::Storable::FindValue(theMap,"myTitle").toLatin1().constData();
myLabelColor[1] = VISU::Storable::FindValue(theMap,"myLabelColor[1]").toFloat();
myLabelColor[2] = VISU::Storable::FindValue(theMap,"myLabelColor[2]").toFloat();
+ bool isFound = false;
+ QString x,y,z;
+
+ x = VISU::Storable::FindValue(theMap,"myOffset[0]",&isFound);
+ y = VISU::Storable::FindValue(theMap,"myOffset[1]",&isFound);
+ z = VISU::Storable::FindValue(theMap,"myOffset[2]",&isFound);
+ if(isFound) {
+ myOffset[0] = x.toFloat();
+ myOffset[1] = y.toFloat();
+ myOffset[2] = z.toFloat();
+ }
+
myParamsTime.Modified();
return Build( true );
}
Storable::DataToStream( theStr, "myLabelColor[0]", myLabelColor[0] );
Storable::DataToStream( theStr, "myLabelColor[1]", myLabelColor[1] );
Storable::DataToStream( theStr, "myLabelColor[2]", myLabelColor[2] );
+
+ Storable::DataToStream( theStr, "myOffset[0]", myOffset[0] );
+ Storable::DataToStream( theStr, "myOffset[1]", myOffset[1] );
+ Storable::DataToStream( theStr, "myOffset[2]", myOffset[2] );
}
/*!
Called from engine to restore table from the file
//----------------------------------------------------------------
void VISU::PointMap3d_i::SetOffset(CORBA::Float theDx, CORBA::Float theDy, CORBA::Float theDz)
{
+ VISU::TSetModified aModified(this);
myOffset[0] = theDx;
myOffset[1] = theDy;
myOffset[2] = theDz;
theDz = myOffset[2];
}
+void VISU::PointMap3d_i::SetMarkerStd(VISU::MarkerType, VISU::MarkerScale)
+{
+}
+
+void VISU::PointMap3d_i::SetMarkerTexture(CORBA::Long)
+{
+}
+
+VISU::MarkerType VISU::PointMap3d_i::GetMarkerType()
+{
+ return VISU::MT_NONE;
+}
+
+VISU::MarkerScale VISU::PointMap3d_i::GetMarkerScale()
+{
+ return VISU::MS_NONE;
+}
+
+CORBA::Long VISU::PointMap3d_i::GetMarkerTexture()
+{
+ return 0;
+}
+
CORBA::Float VISU::PointMap3d_i::GetMemorySize()
{
CORBA::Float aSize = GetSpecificPL()->GetMemorySize();
myPosition[0] = theX;
myPosition[1] = theY;
+ myParamsTime.Modified();
}
CORBA::Double VISU::PointMap3d_i::GetPosX()
myWidth = theWidth;
myHeight = theHeight;
+ myParamsTime.Modified();
}
CORBA::Double VISU::PointMap3d_i::GetHeight()
if(myBarOrientation == theBarOrientation)
return;
+ if ( ( theBarOrientation == VISU::ColoredPrs3dBase::VERTICAL && myHeight < myWidth ) ||
+ ( theBarOrientation == VISU::ColoredPrs3dBase::HORIZONTAL && myHeight > myWidth ) ) {
+ vtkFloatingPointType tmp = myHeight;
+ myHeight = myWidth;
+ myWidth = tmp;
+ }
+
myBarOrientation = theBarOrientation;
+ myParamsTime.Modified();
}
VISU::ColoredPrs3dBase::Orientation VISU::PointMap3d_i::GetBarOrientation()
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PointMap3d_i.hh
// Author :
//! Gets offset parameters for the 3D presentation
virtual void GetOffset(CORBA::Float& theDx, CORBA::Float& theDy, CORBA::Float& theDz);
+ //! Do nothing, just for compilability
+ virtual void SetMarkerStd(VISU::MarkerType, VISU::MarkerScale);
+ virtual void SetMarkerTexture(CORBA::Long);
+ virtual VISU::MarkerType GetMarkerType();
+ virtual VISU::MarkerScale GetMarkerScale();
+ virtual CORBA::Long GetMarkerTexture();
+
//! Gets memory size actually used by the presentation (Mb).
virtual CORBA::Float GetMemorySize();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Prs3dUtils.cc
// Author : Alexey PETROV
// Module : VISU
//
#include "VISU_Prs3dUtils.hh"
+#include "VISU_Prs3d_i.hh"
+#include "VISU_PointMap3d_i.hh"
#include "SalomeApp_Study.h"
#include "SALOME_Event.h"
{
//----------------------------------------------------------------------------
TSetModified
- ::TSetModified(VISU::Prs3d_i* thePrs3d):
- myPrs3d(thePrs3d)
+ ::TSetModified(VISU::PrsObject_i* thePrsObject):
+ myPrsObject(thePrsObject)
{
this->Modified();
}
void
Execute()
{
- VISU::Prs3d_i* aPrs3d = mySetModified->myPrs3d;
-
- if(!aPrs3d || aPrs3d->GetActorEntry() == "")
- return;
+ VISU::PrsObject_i* aPrsObject = mySetModified->myPrsObject;
+ if(!aPrsObject)
+ return;
+
+ VISU::Prs3d_i* aPrs3d;
+ VISU::PointMap3d_i* aPntMap;
+ SalomeApp_Study* aStudy;
+ unsigned long int time;
+ if( (aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aPrsObject)) && aPrs3d->GetActorEntry() != "" ) {
+ aStudy = aPrs3d->GetGUIStudy();
+ time = aPrs3d->GetMTime();
+ } else if ( aPntMap = dynamic_cast<VISU::PointMap3d_i*>(aPrsObject) ) {
+ aStudy = aPntMap->GetGUIStudy();
+ time = aPntMap->GetMTime();
+ } else
+ return;
- if(aPrs3d->GetMTime() > mySetModified->GetMTime()){
- if(SalomeApp_Study* aStudy = aPrs3d->GetGUIStudy())
+ if(time > mySetModified->GetMTime()){
+ if(aStudy)
aStudy->Modified();
}
- }
- };
+ }
+ };
ProcessVoidEvent(new TEvent(this));
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Prs3dUtils.hh
// Author : Alexey PETROV
#ifndef __VISU_PRS3D_UTILS_H__
#define __VISU_PRS3D_UTILS_H__
-#include "VISU_Prs3d_i.hh"
+#include "VISU_PrsObject_i.hh"
#include <vtkTimeStamp.h>
//----------------------------------------------------------------------------
struct TSetModified: vtkTimeStamp
{
- VISU::Prs3d_i* myPrs3d;
+ VISU::PrsObject_i* myPrsObject;
- TSetModified(VISU::Prs3d_i* thePrs3d);
+ TSetModified(VISU::PrsObject_i* thePrsObject);
~TSetModified();
};
-
- Standard_EXPORT std::string ToFormat( const int thePrec );
- Standard_EXPORT int ToPrecision( const char* theFormat );
-
+
+ VISU_I_EXPORT std::string ToFormat( const int thePrec );
+ VISU_I_EXPORT int ToPrecision( const char* theFormat );
+
//----------------------------------------------------------------------------
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Prs3d_i.cc
// Author : Alexey PETROV
//
#include "VISU_Prs3d_i.hh"
#include "VISU_Prs3dUtils.hh"
+#include "VISU_Gen_i.hh"
#include "VISU_PipeLine.hxx"
#include "VISU_Result_i.hh"
#include "VISU_Actor.h"
#include "SALOME_Event.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_MessageBox.h"
+
+#include <VTKViewer_MarkerUtils.h>
#include <vtkActorCollection.h>
#include <vtkUnstructuredGrid.h>
VISU::Prs3d_i::Prs3d_i() :
PrsObject_i(SALOMEDS::Study::_nil()),
myActorCollection(vtkActorCollection::New()),
- myIsActiveSatate(true)
+ myIsActiveSatate(true),
+ myIsForcedHidden(false)
{
if(MYDEBUG) MESSAGE("Prs3d_i::Prs3d_i - this = "<<this);
myOffset[0] = myOffset[1] = myOffset[2] = 0;
myActorCollection->Delete();
+
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ myMarkerType = (VISU::MarkerType)aResourceMgr->integerValue("VISU", "type_of_marker", 1); // dot
+ myMarkerScale = (VISU::MarkerScale)aResourceMgr->integerValue("VISU", "marker_scale", 9); // 5 pixels
+ myMarkerId = 0;
}
GetPipeLine()->SameAs(anOrigin->GetPipeLine());
anOrigin->GetOffset(myOffset);
+
+ myMarkerType = anOrigin->GetMarkerType();
+ myMarkerScale = anOrigin->GetMarkerScale();
+ myMarkerId = anOrigin->GetMarkerTexture();
+
+ SetForcedHidden(anOrigin->IsForcedHidden());
}
}
{
if(MYDEBUG) MESSAGE("Prs3d_i::~Prs3d_i - this = "<<this);
ProcessVoidEvent(new TInvokeSignalEvent(myRemoveActorsFromRendererSignal));
- if(myResult) myResult->Destroy();
}
if(theResult) {
SetStudyDocument(theResult->GetStudyDocument());
- theResult->Register();
- }
- if(myResult) {
- myResult->Destroy();
}
VISU::TSetModified aModified(this);
myOffset[0] = VISU::Storable::FindValue(theMap,"myOffset[0]").toFloat();
myOffset[1] = VISU::Storable::FindValue(theMap,"myOffset[1]").toFloat();
myOffset[2] = VISU::Storable::FindValue(theMap,"myOffset[2]").toFloat();
+ myMarkerType = VISU::MarkerType(VISU::Storable::FindValue(theMap,"myMarkerType").toInt());
+ myMarkerScale = VISU::MarkerScale(VISU::Storable::FindValue(theMap,"myMarkerScale").toInt());
+ myMarkerId = VISU::Storable::FindValue(theMap,"myMarkerId").toInt();
myParamsTime.Modified();
return this;
}
Storable::DataToStream( theStr, "myOffset[0]", myOffset[0] );
Storable::DataToStream( theStr, "myOffset[1]", myOffset[1] );
Storable::DataToStream( theStr, "myOffset[2]", myOffset[2] );
+ Storable::DataToStream( theStr, "myMarkerType", int(myMarkerType) );
+ Storable::DataToStream( theStr, "myMarkerScale", int(myMarkerScale) );
+ Storable::DataToStream( theStr, "myMarkerId", myMarkerId );
}
Execute()
{
//TInvokeSignalEvent::Execute();
- myRemovable->Destroy();
+ myRemovable->UnRegister();
}
};
::CreateActor(VISU_Actor* theActor)
{
try{
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+
Handle(SALOME_InteractiveObject) anIO = GetIO();
if(!anIO.IsNull() && anIO->hasEntry()){
theActor->setIO(anIO);
CheckDataSet();
theActor->SetPrs3d(this);
- theActor->SetShrinkFactor();
+ theActor->SetShrinkFactor(aResourceMgr->integerValue("VISU", "shrink_factor", 80)/100.);
theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
+
+ if( myMarkerType != VISU::MT_USER )
+ theActor->SetMarkerStd( (VTK::MarkerType)myMarkerType, (VTK::MarkerScale)myMarkerScale );
+ else if( myMarkerId > 0 ) {
+ VTK::MarkerTexture aMarkerTexture;
+ if( LoadMarkerTexture( myMarkerId, aMarkerTexture ) )
+ theActor->SetMarkerTexture( myMarkerId, aMarkerTexture );
+ }
+
theActor->SetPipeLine(GetActorPipeLine());
if(theActor->GetPipeLine() != GetPipeLine()){
// To decrease actor'ss pipeline reference counter
if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(theActor)){
if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor - this = "<<this<<"; theActor = "<<anActor);
anActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
+
+ if( myMarkerType != VISU::MT_USER )
+ anActor->SetMarkerStd( (VTK::MarkerType)myMarkerType, (VTK::MarkerScale)myMarkerScale );
+ else if( myMarkerId > 0 ) {
+ VTK::MarkerTexture aMarkerTexture;
+ if( LoadMarkerTexture( myMarkerId, aMarkerTexture ) )
+ anActor->SetMarkerTexture( myMarkerId, aMarkerTexture );
+ }
+
anActor->ShallowCopyPL(GetPipeLine());
+ anActor->highlight(anActor->isHighlighted());
}
}
{
if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActors - this = "<<this);
Update();
- CheckDataSet();
+ try {
+ CheckDataSet();
+ } catch( std::exception& ex ) {
+ if( !IsForcedHidden() ) {
+ if( HasVisibleActors() )
+ SetForcedHidden( true );
+ RemoveActors();
+ SUIT_MessageBox::warning( 0,
+ QObject::tr("WRN_VISU"),
+ QString( ex.what() ),
+ QObject::tr("BUT_OK") );
+ }
+ return;
+ }
ProcessVoidEvent(new TInvokeSignalEvent(myUpdateActorsSignal));
}
VISU::Prs3d_i
::SetOffset(const CORBA::Float* theOffsets)
{
+ VISU::TSetModified aModified(this);
myOffset[0] = theOffsets[0];
myOffset[1] = theOffsets[1];
myOffset[2] = theOffsets[2];
CORBA::Float theDy,
CORBA::Float theDz)
{
+ VISU::TSetModified aModified(this);
myOffset[0] = theDx;
myOffset[1] = theDy;
myOffset[2] = theDz;
{
return myActorCollection->GetNumberOfItems();
}
+
+bool
+VISU::Prs3d_i
+::HasVisibleActors()
+{
+ myActorCollection->InitTraversal();
+ while( vtkActor* anActor = myActorCollection->GetNextActor() )
+ if( VISU_Actor* aVISUActor = dynamic_cast<VISU_Actor*>( anActor ) )
+ if( aVISUActor->GetVisibility() )
+ return true;
+ return false;
+}
+
+bool
+VISU::Prs3d_i
+::IsForcedHidden() const
+{
+ return myIsForcedHidden;
+}
+
+void
+VISU::Prs3d_i
+::SetForcedHidden( bool theFlag )
+{
+ myIsForcedHidden = theFlag;
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::Prs3d_i
+::SetMarkerStd(VISU::MarkerType theMarkerType, VISU::MarkerScale theMarkerScale)
+{
+ myMarkerType = theMarkerType;
+ myMarkerScale = theMarkerScale;
+ if( myMarkerType == VISU::MT_POINT_SPRITE )
+ myMarkerScale = VISU::MS_NONE;
+ myParamsTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::Prs3d_i
+::SetMarkerTexture(CORBA::Long theMarkerId)
+{
+ myMarkerType = VISU::MT_USER;
+ myMarkerId = theMarkerId;
+ myParamsTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+VISU::MarkerType
+VISU::Prs3d_i
+::GetMarkerType()
+{
+ return myMarkerType;
+}
+
+//----------------------------------------------------------------------------
+VISU::MarkerScale
+VISU::Prs3d_i
+::GetMarkerScale()
+{
+ return myMarkerScale;
+}
+
+//----------------------------------------------------------------------------
+CORBA::Long
+VISU::Prs3d_i
+::GetMarkerTexture()
+{
+ return myMarkerId;
+}
+
+//----------------------------------------------------------------------------
+bool
+VISU::Prs3d_i
+::LoadMarkerTexture(int theMarkerId, VTK::MarkerTexture& theMarkerTexture)
+{
+ VISU::VISU_Gen_i* aVisuGen = VISU::VISU_Gen_i::GetVisuGenImpl();
+ if( !aVisuGen )
+ return false;
+
+ const VISU::StudyId2MarkerMap& aStudyId2MarkerMap = aVisuGen->GetMarkerMap();
+
+ const SALOMEDS::Study_var& aStudy = GetStudyDocument();
+ if( CORBA::is_nil( aStudy.in() ) )
+ return false;
+
+ int aStudyId = aStudy->StudyId();
+ VISU::StudyId2MarkerMap::const_iterator aStudyId2MarkerIter = aStudyId2MarkerMap.find( aStudyId );
+ if( aStudyId2MarkerIter == aStudyId2MarkerMap.end() )
+ return false;
+
+ VTK::MarkerMap aMarkerMap = aStudyId2MarkerIter->second;
+ VTK::MarkerMap::const_iterator aMarkerIter = aMarkerMap.find( theMarkerId );
+ if( aMarkerIter == aMarkerMap.end() )
+ return false;
+
+ theMarkerTexture = aMarkerIter->second.second;
+ return true;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.hxx
// Author : Alexey PETROV
GetBounds(vtkFloatingPointType aBounds[6]);
int
- GetNumberOfActors ();
+ GetNumberOfActors();
+
+ bool
+ HasVisibleActors();
//! Move the 3D presentation according to the given offset parameters
void
CORBA::Float& theDy,
CORBA::Float& theDz);
+ //----------------------------------------------------------------------------
+ //! Set standard point marker for the object
+ virtual
+ void
+ SetMarkerStd(VISU::MarkerType theMarkerType, VISU::MarkerScale theMarkerScale);
+
+ //! Set custom point marker
+ virtual
+ void
+ SetMarkerTexture(CORBA::Long theTextureId);
+
+ //! Get type of the point marker
+ virtual
+ VISU::MarkerType
+ GetMarkerType();
+
+ //! Get scale of the point marker
+ virtual
+ VISU::MarkerScale
+ GetMarkerScale();
+
+ //! Get texture identifier of the point marker
+ virtual
+ CORBA::Long
+ GetMarkerTexture();
+
//----------------------------------------------------------------------------
//! Gets memory size actually used by the presentation (Mb).
virtual
std::string
GetActorEntry();
+ //----------------------------------------------------------------------------
+ //! Managing "forced hidden" flag
+ bool
+ IsForcedHidden() const;
+
+ void
+ SetForcedHidden( bool );
+
protected:
/*!
Used in Apply method to get know whether it is possible to create presentation
void
CheckDataSet();
+ bool
+ LoadMarkerTexture(int theMarkerId, VTK::MarkerTexture& theMarkerTexture);
+
protected:
vtkTimeStamp myUpdateTime;
vtkTimeStamp myParamsTime;
CORBA::Float myOffset[3];
+ VISU::MarkerType myMarkerType;
+ VISU::MarkerScale myMarkerScale;
+ int myMarkerId;
+
boost::signal0<void> myUpdateActorsSignal;
boost::signal0<void> myRemoveActorsFromRendererSignal;
vtkSmartPointer<vtkActorCollection> myActorCollection;
SetActiveState(bool theState);
bool myIsActiveSatate;
+
+ bool myIsForcedHidden;
};
//----------------------------------------------------------------------------
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.cxx
// Author : Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.hxx
// Author : Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ResultUtils.cc
// Author : Alexey PETROV
TResultManager
::~TResultManager()
{
- myResult->Destroy();
+ myResult->UnRegister();
}
const void* thePointer)
{
std::ostringstream aStream;
- aStream<<theName<<":"<<thePointer;
+ aStream<<theName<<"_"<<thePointer;
return aStream.str();
}
//----------------------------------------------------------------------------
void
BuildGroups(Result_i* theResult,
- Result_i::PInput theInput,
- CORBA::Boolean* theIsDone,
- CORBA::Boolean theIsBuild,
- CORBA::Boolean theIsAtOnce,
- _PTR(Study) theStudy)
+ Result_i::PInput theInput,
+ CORBA::Boolean* theIsDone,
+ CORBA::Boolean theIsBuild,
+ CORBA::Boolean theIsAtOnce,
+ _PTR(Study) theStudy)
{
if(!theIsBuild || *theIsDone)
return;
const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
if(aMeshOnEntityMap.empty())
- continue;
+ continue;
TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
- const TEntity& anEntity = aMeshOnEntityMapIter->first;
- const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
-
- const TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
- TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
- for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
- const string& aFamilyName = aFamilyMapIter->first;
- const PFamily& aFamily = aFamilyMapIter->second;
+ const TEntity& anEntity = aMeshOnEntityMapIter->first;
+ const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+ const TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+ TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
+ for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
+ const string& aFamilyName = aFamilyMapIter->first;
+ const PFamily& aFamily = aFamilyMapIter->second;
aComment=QString("myComment=FAMILY;myMeshName=%1;myEntityId=%2;myName=%3");
aComment=aComment.arg(aMeshName.c_str());
aComment=aComment.arg(anEntity);
aComment=aComment.arg(aFamilyName.c_str());
- aFamily->myEntry =
- CreateAttributes(theStudy,
- aMeshOnEntity->myEntry,
- NO_ICON,
- NO_IOR,
- aFamilyName,
- NO_PERFSITENT_REF,
- aComment.toLatin1().data(),
- true);
- }
+ aFamily->myEntry = CreateAttributes(theStudy,
+ aMeshOnEntity->myEntry,
+ NO_ICON,
+ NO_IOR,
+ aFamilyName,
+ NO_PERFSITENT_REF,
+ aComment.toLatin1().data(),
+ true);
+ }
}
//Importing groups
const TGroupMap& aGroupMap = aMesh->myGroupMap;
if(!aGroupMap.empty()){
- aComment = QString("myComment=GROUPS;myMeshName=%1").arg(aMeshName.c_str());
-
- CreateAttributes(theStudy,
- aMesh->myGroupsEntry,
- NO_ICON,
- NO_IOR,
- "Groups",
- NO_PERFSITENT_REF,
- aComment.toLatin1().data(),
- false);
-
- TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
- for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
- const string& aGroupName = aGroupMapIter->first;
- const PGroup& aGroup = aGroupMapIter->second;
- aComment = QString("myComment=GROUP;myMeshName=%1;myName=%2").arg(aMeshName.c_str()).arg(aGroupName.c_str());
- aGroup->myEntry =
- CreateAttributes(theStudy,
- aMesh->myGroupsEntry,
- NO_ICON,
- NO_IOR,
- aGroupName,
- NO_PERFSITENT_REF,
- aComment.toLatin1().data(),
- true);
- const TFamilySet& aFamilySet = aGroup->myFamilySet;
- TFamilySet::const_iterator aFamilyIter = aFamilySet.begin();
- for(; aFamilyIter != aFamilySet.end(); aFamilyIter++){
- const PFamily& aFamily = *aFamilyIter;
- CreateReference(theStudy,
- aGroup->myEntry,
- aFamily->myEntry);
- }
- }
+ aComment = QString("myComment=GROUPS;myMeshName=%1").arg(aMeshName.c_str());
+
+ CreateAttributes(theStudy,
+ aMesh->myGroupsEntry,
+ NO_ICON,
+ NO_IOR,
+ "Groups",
+ NO_PERFSITENT_REF,
+ aComment.toLatin1().data(),
+ false);
+
+ TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
+ for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
+ const string& aGroupName = aGroupMapIter->first;
+ const PGroup& aGroup = aGroupMapIter->second;
+ aComment = QString("myComment=GROUP;myMeshName=%1;myName=%2").arg(aMeshName.c_str()).arg(aGroupName.c_str());
+ aGroup->myEntry = CreateAttributes(theStudy,
+ aMesh->myGroupsEntry,
+ NO_ICON,
+ NO_IOR,
+ aGroupName,
+ NO_PERFSITENT_REF,
+ aComment.toLatin1().data(),
+ true);
+ const TFamilySet& aFamilySet = aGroup->myFamilySet;
+ TFamilySet::const_iterator aFamilyIter = aFamilySet.begin();
+ for(; aFamilyIter != aFamilySet.end(); aFamilyIter++){
+ const PFamily& aFamily = (*aFamilyIter).second;
+ CreateReference(theStudy,
+ aGroup->myEntry,
+ aFamily->myEntry);
+ }
+ }
}else if(!theIsAtOnce)
- RemoveSObject(theStudy,
- aMesh->myGroupsEntry);
+ RemoveSObject(theStudy,
+ aMesh->myGroupsEntry);
}
ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
if(aMeshOnEntityMap.empty())
- continue;
+ continue;
//Import fields
bool anIsFieldsEntryUpdated = false;
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++)
{
- const TEntity& anEntity = aMeshOnEntityMapIter->first;
- const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
- const TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
-
- for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++)
- {
- if(!anIsFieldsEntryUpdated)
- {
- aComment = "";
- aComment.append("myComment=FIELDS;");
- aComment.append("myMeshName=");aComment.append(aMeshName.c_str());
-
- CreateAttributes(theStudy,
- aMesh->myFieldsEntry,
- NO_ICON,
- NO_IOR,
- "Fields",
- NO_PERFSITENT_REF,
- aComment.toLatin1().data(),
- false);
-
- anIsFieldsEntryUpdated = true;
- }
-
- const string& aFieldName = aFieldMapIter->first;
- const PField& aField = aFieldMapIter->second;
- const TValField& aValField = aField->myValField;
- QString aFieldNameWithUnit = GenerateFieldName(aFieldName,aField->myUnitNames[0]);
- aComment = QString("myComment=FIELD;myMeshName=%1;myEntityId=%2;myName=%3;myNbTimeStamps=%4;myNumComponent=%5");
+ const TEntity& anEntity = aMeshOnEntityMapIter->first;
+ const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+ const TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
+
+ for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++)
+ {
+ if(!anIsFieldsEntryUpdated)
+ {
+ aComment = "";
+ aComment.append("myComment=FIELDS;");
+ aComment.append("myMeshName=");aComment.append(aMeshName.c_str());
+
+ CreateAttributes(theStudy,
+ aMesh->myFieldsEntry,
+ NO_ICON,
+ NO_IOR,
+ "Fields",
+ NO_PERFSITENT_REF,
+ aComment.toLatin1().data(),
+ false);
+ anIsFieldsEntryUpdated = true;
+ }
+
+ const string& aFieldName = aFieldMapIter->first;
+ const PField& aField = aFieldMapIter->second;
+ const TValField& aValField = aField->myValField;
+ QString aFieldNameWithUnit = GenerateFieldName(aFieldName,aField->myUnitNames[0]);
+ aComment = QString("myComment=FIELD;myMeshName=%1;myEntityId=%2;myName=%3;myNbTimeStamps=%4;myNumComponent=%5");
aComment = aComment.arg(aMeshName.c_str());
aComment = aComment.arg(anEntity);
aComment = aComment.arg(aFieldName.c_str());
aComment = aComment.arg(aValField.size());
aComment = aComment.arg(aField->myNbComp);
-
- aField->myEntry = CreateAttributes(theStudy,
- aMesh->myFieldsEntry,
- NO_ICON,
- NO_IOR,
- aFieldNameWithUnit.toLatin1().data(),
- NO_PERFSITENT_REF,
- aComment.toLatin1().data(),
- true);
-
- CreateReference(theStudy,
- aField->myEntry,
- aMeshOnEntity->myEntry);
-
- TValField::const_iterator aValFieldIter = aValField.begin();
-
- for(; aValFieldIter != aValField.end(); aValFieldIter++)
- {
- int aTimeStamp = aValFieldIter->first;
- const PValForTime& aValForTime = aValFieldIter->second;
- aComment = QString("myComment=TIMESTAMP;myMeshName=%1;myEntityId=%2;myFieldName=%3;myTimeStampId=%4;myNumComponent=%5");
+
+ aField->myEntry = CreateAttributes(theStudy,
+ aMesh->myFieldsEntry,
+ NO_ICON,
+ NO_IOR,
+ aFieldNameWithUnit.toLatin1().data(),
+ NO_PERFSITENT_REF,
+ aComment.toLatin1().data(),
+ true);
+
+ CreateReference(theStudy,
+ aField->myEntry,
+ aMeshOnEntity->myEntry);
+
+ TValField::const_iterator aValFieldIter = aValField.begin();
+
+ for(; aValFieldIter != aValField.end(); aValFieldIter++)
+ {
+ int aTimeStamp = aValFieldIter->first;
+ const PValForTime& aValForTime = aValFieldIter->second;
+ aComment = QString("myComment=TIMESTAMP;myMeshName=%1;myEntityId=%2;myFieldName=%3;myTimeStampId=%4;myNumComponent=%5");
aComment = aComment.arg(aMeshName.c_str());
aComment = aComment.arg(anEntity);
aComment = aComment.arg(aFieldName.c_str());
aComment = aComment.arg(aTimeStamp);
aComment = aComment.arg(aField->myNbComp);
-
- string aTimeStampId = VISU_Convertor::GenerateName(aValForTime->myTime);
-
- aValForTime->myEntry = CreateAttributes(theStudy,
- aField->myEntry,
- NO_ICON,
- NO_IOR,
- aTimeStampId,
- NO_PERFSITENT_REF,
- aComment.toLatin1().data(),
- true);
- }
- }
+
+ string aTimeStampId = VISU_Convertor::GenerateName(aValForTime->myTime);
+
+ aValForTime->myEntry = CreateAttributes(theStudy,
+ aField->myEntry,
+ NO_ICON,
+ NO_IOR,
+ aTimeStampId,
+ NO_PERFSITENT_REF,
+ aComment.toLatin1().data(),
+ true);
+ }
+ }
}
if(!anIsFieldsEntryUpdated && !theIsAtOnce)
- RemoveSObject(theStudy, aMesh->myFieldsEntry);
+ RemoveSObject(theStudy, aMesh->myFieldsEntry);
}
ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
//----------------------------------------------------------------------------
void
BuildMinMax(Result_i* theResult,
- Result_i::PInput theInput,
- CORBA::Boolean* theIsDone,
- CORBA::Boolean theIsBuild)
+ Result_i::PInput theInput,
+ CORBA::Boolean* theIsDone,
+ CORBA::Boolean theIsBuild)
{
if(!theIsBuild || *theIsDone)
return;
//----------------------------------------------------------------------------
void
BuildFieldDataTree(Result_i* theResult,
- Result_i::PInput theInput,
- CORBA::Boolean* theIsFieldsDone,
- CORBA::Boolean theIsBuildFields,
- CORBA::Boolean* theIsMinMaxDone,
- CORBA::Boolean theIsBuildMinMax,
- _PTR(Study) theStudy)
+ Result_i::PInput theInput,
+ CORBA::Boolean* theIsFieldsDone,
+ CORBA::Boolean theIsBuildFields,
+ CORBA::Boolean* theIsMinMaxDone,
+ CORBA::Boolean theIsBuildMinMax,
+ _PTR(Study) theStudy)
{
BuildFields(theResult,
- theInput,
- theIsFieldsDone,
- theIsBuildFields,
- false,
- theStudy);
+ theInput,
+ theIsFieldsDone,
+ theIsBuildFields,
+ false,
+ theStudy);
BuildMinMax(theResult,
theInput,
CopyFile(const std::string& theSourceFileName,
const std::string& theTargetFileName)
{
- QFileInfo aSourceFileInfo(theSourceFileName.c_str());
- QFileInfo aTargetFileInfo(theTargetFileName.c_str());
+ QString aSourcePath = theSourceFileName.c_str();
+#ifdef WNT
+ aSourcePath.replace( QString("/"), QString("\\") );
+ int prevSlash = 0;
+ for ( int ind = 0; ind < aSourcePath.length(); ind ++ )
+ {
+ if ( aSourcePath.at( ind ) == '\\' )
+ prevSlash = ind;
+ if ( aSourcePath.at( ind ) == ' ' )
+ {
+ int nextSlash = aSourcePath.indexOf( '\\', ind);
+ if ( aSourcePath.at( nextSlash - 1 ) != '"' )
+ {
+ aSourcePath.insert( nextSlash, '"');
+ aSourcePath.insert( prevSlash + 1, '"');
+ ind++;
+ }
+ }
+ }
+#endif
+
+ QFileInfo aSourceFileInfo( aSourcePath );
+ QFileInfo aTargetFileInfo( theTargetFileName.c_str() );
if(aSourceFileInfo.absoluteFilePath() == aTargetFileInfo.absoluteFilePath())
return true;
QString aCommand;
- aCommand.sprintf("%s %s %s",
- COPY_COMMAND,
- aSourceFileInfo.filePath().toLatin1().data(),
- aTargetFileInfo.filePath().toLatin1().data());
+ aCommand.sprintf("%s %s %s", COPY_COMMAND,
+ aSourcePath.toLatin1().data(),
+ theTargetFileName.c_str());
return system(aCommand.toLatin1().data()) == 0;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ResultUtils.hh
// Author : Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Result_i.cc
// Author : Alexey PETROV
// Module : VISU
-//
+
#include "VISU_MultiResult_i.hh"
#include "VISU_ResultUtils.hh"
#include "VISU_Prs3d_i.hh"
#include "SALOMEDS_Tool.hxx"
#include "HDFascii.hxx"
+#include "Basics_Utils.hxx"
#include "SUIT_Session.h"
#include "SALOME_Event.h"
namespace VISU
{
//---------------------------------------------------------------
- Result_var
+ Result_var
FindResult(SALOMEDS::SObject_ptr theSObject)
{
SALOMEDS::SComponent_var aSComponent = theSObject->GetFatherComponent();
while (strcmp(aComponentID, aFatherID) != 0) {
CORBA::Object_var anObject = SObjectToObject(aFather);
if (!CORBA::is_nil(anObject)) {
- aResult = Result::_narrow(anObject);
- if (!aResult->_is_nil()) return aResult;
+ aResult = Result::_narrow(anObject);
+ if (!aResult->_is_nil()) return aResult;
}
aFather = aFather->GetFather();
aFatherID = aFather->GetID();
//---------------------------------------------------------------
- Result_i*
+ Result_i*
GetResult(SALOMEDS::Study_ptr theStudy,
- const std::string& theResultEntry)
+ const std::string& theResultEntry)
{
- if(CORBA::is_nil(theStudy))
- return NULL;
-
- SALOMEDS::SObject_var aSObject = theStudy->FindObjectID(theResultEntry.c_str());
- CORBA::Object_var anObject = SObjectToObject(aSObject);
- return dynamic_cast<VISU::Result_i*>(GetServant(anObject).in());
+ Result_i* result = NULL;
+ if (!CORBA::is_nil(theStudy)) {
+ SALOMEDS::SComponent_var aSComponent = theStudy->FindComponent("VISU");
+ if (!CORBA::is_nil(aSComponent)) {
+ std::string compid = aSComponent->GetID();
+ std::string aResultEntry = theResultEntry;
+ if (theResultEntry.substr(0, compid.length()) != compid) aResultEntry = compid + theResultEntry.substr(compid.length());
+ SALOMEDS::SObject_var aSObject = theStudy->FindObjectID(aResultEntry.c_str());
+ CORBA::Object_var anObject = SObjectToObject(aSObject);
+ result = dynamic_cast<VISU::Result_i*>(GetServant(anObject).in());
+ }
+ }
+ return result;
}
//---------------------------------------------------------------
void
CreateReference (SALOMEDS::Study_ptr theStudyDocument,
- const string& theFatherEntry,
- const string& theRefEntry)
+ const string& theFatherEntry,
+ const string& theRefEntry)
{
SALOMEDS::StudyBuilder_var aStudyBuilder = theStudyDocument->NewBuilder();
SALOMEDS::SObject_var aFather = theStudyDocument->FindObjectID(theFatherEntry.c_str());
aStudyBuilder->Addreference(newObj,aRefSObj);
}
+ //---------------------------------------------------------------
+ // Issue 0021403. Remove a ColoredPrs3dHolder if a Result it refers to is removed
+ //
+ void RemoveHolders(VISU::Result_i* theResult)
+ {
+ CORBA::String_var resultID1 = theResult->GetID();
+ SALOMEDS::SObject_var theResSObject = theResult->GetSObject();
+ SALOMEDS::Study_var aStudyDocument = theResSObject->GetStudy();
+ SALOMEDS::SComponent_var aCompSObj = theResSObject->GetFatherComponent();
+ SALOMEDS::ChildIterator_var aChildIter = aStudyDocument->NewChildIterator(aCompSObj);
+ for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next())
+ {
+ SALOMEDS::SObject_var aChildSObject = aChildIter->Value();
+ if ( CORBA::is_nil( aChildSObject )) continue;
+ CORBA::Object_var aChildObj = aChildSObject->GetObject();
+ if ( CORBA::is_nil( aChildObj )) continue;
+ VISU::ColoredPrs3dHolder_var prsHolder = ColoredPrs3dHolder::_narrow( aChildObj );
+ if ( prsHolder->_is_nil() ) continue;
+ // check if the prsHolder refers to theResult
+ VISU::ColoredPrs3dHolder::BasicInput_var input = prsHolder->GetBasicInput();
+ CORBA::String_var resultID2 = input->myResult->GetID();
+ if ( strcmp( resultID1, resultID2 ) == 0 )
+ prsHolder->RemoveFromStudy();
+ }
+ }
//---------------------------------------------------------------
}
//---------------------------------------------------------------
VISU::Result_i
::Result_i(SALOMEDS::Study_ptr theStudy,
- const ESourceId& theSourceId,
- const ECreationId& theCreationId,
- CORBA::Boolean theIsBuildImmediately,
- CORBA::Boolean theIsBuildFields,
- CORBA::Boolean theIsBuildMinMax,
- CORBA::Boolean theIsBuildGroups):
+ const ESourceId& theSourceId,
+ const ECreationId& theCreationId,
+ CORBA::Boolean theIsBuildImmediately,
+ CORBA::Boolean theIsBuildFields,
+ CORBA::Boolean theIsBuildMinMax,
+ CORBA::Boolean theIsBuildGroups):
myStudyDocument(SALOMEDS::Study::_duplicate(theStudy)),
myCreationId(theCreationId),
mySourceId(theSourceId),
::~Result_i()
{
MESSAGE("Result_i::~Result_i() - this = "<<this);
- if (GetSourceId() == eRestoredFile)
+ if (GetSourceId() == eRestoredFile)
VISU::RemoveFile(myFileInfo.filePath().toLatin1().data());
}
TRemoveFromStudy(VISU::Result_i* theRemovable):
myRemovable(theRemovable)
{}
-
+
virtual
void
Execute()
{
+ RemoveHolders(myRemovable);
VISU::RemoveFromStudy(myRemovable->GetSObject(),false);
- myRemovable->Destroy();
+ myRemovable->UnRegister();
}
};
//---------------------------------------------------------------
-void
+void
VISU::Result_i
::ConnectObserver(TResultObserver* theObserver,
- boost::signalslib::connection& theConnection)
+ boost::signalslib::connection& theConnection)
{
if(theConnection.connected())
theConnection.disconnect();
- theConnection =
- myUpdateObserverSignal.connect(boost::bind(boost::bind(&TResultObserver::UpdateFromResult,
- theObserver,
- _1),
- this));
+ theConnection =
+ myUpdateObserverSignal.connect(boost::bind(boost::bind(&TResultObserver::UpdateFromResult,
+ theObserver,
+ _1),
+ this));
}
//---------------------------------------------------------------
-void
+void
VISU::Result_i
::UpdateObservers()
{
TEvent(VISU::Result_i::TUpdateObserverSignal& theUpdateObserverSignal):
myUpdateObserverSignal(theUpdateObserverSignal)
{}
-
+
virtual
void
Execute()
::BuildAll()
{
if(MYDEBUG) MESSAGE("Result_i::Build - myIsAllDone = "<<myIsAllDone);
- if(myIsAllDone)
+ if(myIsAllDone)
return 1;
- if(!IsPossible())
+ if(!IsPossible())
return 0;
try{
const VISU::TMeshMap& aMeshMap = myInput->GetMeshMap();
//Import fields
aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
- const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
- const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
- const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
- for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
- const string& aFieldName = aFieldMapIter->first;
- const VISU::PField aField = aFieldMapIter->second;
- const VISU::TValField& aValField = aField->myValField;
- VISU::TValField::const_iterator aValFieldIter = aValField.begin();
- for(; aValFieldIter != aValField.end(); aValFieldIter++){
- int aTimeStamp = aValFieldIter->first;
- try{
- myInput->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was occured!!!");
- }
- }
- }
- //Importing groups
- const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
- VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
- for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
- const string& aGroupName = aGroupMapIter->first;
- try{
- myInput->GetMeshOnGroup(aMeshName,aGroupName);
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was occured!!!");
- }
- }
- //Import families
- const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
- VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
- for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
- const string& aFamilyName = aFamilyMapIter->first;
- try{
- myInput->GetFamilyOnEntity(aMeshName,anEntity,aFamilyName);
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was occured!!!");
- }
- }
- //Import mesh on entity
- try{
- myInput->GetMeshOnEntity(aMeshName,anEntity);
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was occured!!!");
- }
+ const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
+ const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
+ const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
+ for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
+ const string& aFieldName = aFieldMapIter->first;
+ const VISU::PField aField = aFieldMapIter->second;
+ const VISU::TValField& aValField = aField->myValField;
+ VISU::TValField::const_iterator aValFieldIter = aValField.begin();
+ for(; aValFieldIter != aValField.end(); aValFieldIter++){
+ int aTimeStamp = aValFieldIter->first;
+ try{
+ myInput->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!!!");
+ }
+ }
+ }
+ //Importing groups
+ const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
+ VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
+ for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
+ const string& aGroupName = aGroupMapIter->first;
+ try{
+ myInput->GetMeshOnGroup(aMeshName,aGroupName);
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!!!");
+ }
+ }
+ //Import families
+ const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+ VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
+ for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
+ const string& aFamilyName = aFamilyMapIter->first;
+ try{
+ myInput->GetFamilyOnEntity(aMeshName,anEntity,aFamilyName);
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!!!");
+ }
+ }
+ //Import mesh on entity
+ try{
+ myInput->GetMeshOnEntity(aMeshName,anEntity);
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!!!");
+ }
}
}
myIsAllDone = 1;
CORBA::Boolean
VISU::Result_i
::Build(CORBA::Boolean theIsBuildAll,
- CORBA::Boolean theIsAtOnce)
+ CORBA::Boolean theIsAtOnce)
{
if(theIsBuildAll)
theIsAtOnce = true;
if(Build(SALOMEDS::SObject::_nil(), theIsAtOnce)){
-
+
// Set icon
SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributePixMap_var aPixmap;
-
+ SALOMEDS::AttributeUserID_var aId;
+
anAttr = aStudyBuilder->FindOrCreateAttribute( mySObject, "AttributePixMap" );
aPixmap = SALOMEDS::AttributePixMap::_narrow( anAttr );
aPixmap ->SetPixMap("ICON_TREE_RESULT");
+ std::string auid = "AttributeUserID";
+ auid += Kernel_Utils::GetGUID(Kernel_Utils::ObjectdID);
+ anAttr = aStudyBuilder->FindOrCreateAttribute( mySObject, auid.c_str() );
+ aId = SALOMEDS::AttributeUserID::_narrow( anAttr );
+ aId ->SetValue("VISU.RESULT");
+
if(theIsBuildAll)
return BuildAll();
return true;
}
-
+
return false;
}
//---------------------------------------------------------------
VISU::Storable* VISU::Result_i::Build(SALOMEDS::SObject_ptr theSObject,
- CORBA::Boolean theIsAtOnce)
+ CORBA::Boolean theIsAtOnce)
{
if(!myInput)
return NULL;
CORBA::String_var anIOR(GetID());
QString aComment;
aComment.sprintf("myComment=%s;myFileName=%s;myInitFileName=%s",
- GetComment(),
- myFileInfo.filePath().toLatin1().data(),
- GetInitFileName().c_str()); // Restoring of Python dump
- std::string aResultEntry =
+ GetComment(),
+ myFileInfo.filePath().toLatin1().data(),
+ GetInitFileName().c_str()); // Restoring of Python dump
+ std::string aResultEntry =
CreateAttributes(myStudy,
- aSComponentEntry.in(),
- NO_ICON,
- anIOR.in(),
- GetName(),
- NO_PERFSITENT_REF,
- aComment.toLatin1().data(),
- true);
+ aSComponentEntry.in(),
+ NO_ICON,
+ anIOR.in(),
+ GetName(),
+ NO_PERFSITENT_REF,
+ aComment.toLatin1().data(),
+ true);
mySObject = myStudyDocument->FindObjectID(aResultEntry.c_str());
if(!CORBA::is_nil(theSObject)){
CORBA::String_var aString = theSObject->GetID();
if(theIsAtOnce){
BuildEntities(this,
- myInput,
- &myIsEntitiesDone,
- aResultEntry,
- theIsAtOnce,
- myIsBuildGroups,
- myIsBuildFields,
- myIsBuildParts,
- myStudy);
-
+ myInput,
+ &myIsEntitiesDone,
+ aResultEntry,
+ theIsAtOnce,
+ myIsBuildGroups,
+ myIsBuildFields,
+ myIsBuildParts,
+ myStudy);
+
BuildGroups(this,
- myInput,
- &myIsGroupsDone,
- myIsBuildGroups,
- theIsAtOnce,
- myStudy);
+ myInput,
+ &myIsGroupsDone,
+ myIsBuildGroups,
+ theIsAtOnce,
+ myStudy);
BuildFieldDataTree(this,
- myInput,
- &myIsFieldsDone,
- myIsBuildFields,
- &myIsMinMaxDone,
- myIsBuildMinMax,
- myStudy);
+ myInput,
+ &myIsFieldsDone,
+ myIsBuildFields,
+ &myIsMinMaxDone,
+ myIsBuildMinMax,
+ myStudy);
} else {
boost::thread aThread(boost::bind(boost::bind(&Result_i::BuildDataTree, this, _1),
- aResultEntry));
+ aResultEntry));
}
return this;
::BuildDataTree(const std::string& theResultEntry)
{
BuildEntities(this,
- myInput,
- &myIsEntitiesDone,
- theResultEntry,
- false,
- myIsBuildGroups,
- myIsBuildFields,
- myIsBuildParts,
- myStudy);
+ myInput,
+ &myIsEntitiesDone,
+ theResultEntry,
+ false,
+ myIsBuildGroups,
+ myIsBuildFields,
+ myIsBuildParts,
+ myStudy);
{
boost::thread aThread(boost::bind(&BuildGroups,
- this,
- myInput,
- &myIsGroupsDone,
- myIsBuildGroups,
- false,
- myStudy));
+ this,
+ myInput,
+ &myIsGroupsDone,
+ myIsBuildGroups,
+ false,
+ myStudy));
}
+
{
boost::thread aThread(boost::bind(&BuildFieldDataTree,
- this,
- myInput,
- &myIsFieldsDone,
- myIsBuildFields,
- &myIsMinMaxDone,
- myIsBuildMinMax,
- myStudy));
+ this,
+ myInput,
+ &myIsFieldsDone,
+ myIsBuildFields,
+ &myIsMinMaxDone,
+ myIsBuildMinMax,
+ myStudy));
}
}
VISU::Storable*
VISU::Result_i
::Create(const char* theFileName)
-{
+{
try {
myFileInfo.setFile(theFileName);
myFileName = myFileInfo.fileName().toLatin1().data();
std::string aFileName = VISU::MakeFileName(myFileInfo.fileName().toLatin1().data(), this);
QString aPathToCopy(aTmpDir + aFileName.c_str());
if(!VISU::CopyFile(myFileInfo.absoluteFilePath().toLatin1().data(), aPathToCopy.toLatin1().data()))
- return NULL;
+ return NULL;
myFileInfo.setFile(aPathToCopy);
myFileName = myFileInfo.fileName().toLatin1().data();
if(myInput){
if(myIsBuildImmediately)
- Build(SALOMEDS::SObject::_nil());
+ Build(SALOMEDS::SObject::_nil());
return this;
}
}catch(std::exception& exc){
if(theIsMultiFile || theIsASCII){
std::string aPathToCopy(theURL + aFileName);
BEGMSG(MYDEBUG, "aPathToCopy = '"<<aPathToCopy<<"'\n");
-
+
if(!VISU::CopyFile(aFile, aPathToCopy))
- return false;
+ return false;
if(theIsASCII)
- HDFascii::ConvertFromHDFToASCII(const_cast<char*>(aPathToCopy.c_str()), true);
+ HDFascii::ConvertFromHDFToASCII(const_cast<char*>(aPathToCopy.c_str()), true);
}
theFileNames.push_back(aFileName);
//---------------------------------------------------------------
-CORBA::Boolean
+CORBA::Boolean
VISU::Result_i
-::CanCopy(SALOMEDS::SObject_ptr theObject)
+::CanCopy(SALOMEDS::SObject_ptr theObject)
{
switch(GetCreationId()){
case Result_i::eImportFile:
- case Result_i::eCopyAndImportFile:
+ case Result_i::eCopyAndImportFile:
return true;
}
-
+
return false;
}
//---------------------------------------------------------------
bool
VISU::Result_i
-::CopyFrom(SALOMEDS::SObject_ptr theObject,
- CORBA::Long& theObjectID,
- const std::string& theTmpDir,
- TFileNames& theFileNames)
+::CopyFrom(SALOMEDS::SObject_ptr theObject,
+ CORBA::Long& theObjectID,
+ const std::string& theTmpDir,
+ TFileNames& theFileNames)
{
if(!Storable::CopyFrom(theObject, theObjectID, theTmpDir, theFileNames))
return false;
-
+
SALOMEDS::Study_var aStudy = theObject->GetStudy();
CORBA::String_var anURL = aStudy->URL();
std::string aPrefix = SALOMEDS_Tool::GetNameFromPath(anURL.in());
VISU::Storable*
VISU::Result_i
::Restore(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap,
- const string& thePrefix,
- CORBA::Boolean theIsMultiFile)
+ const Storable::TRestoringMap& theMap,
+ const string& thePrefix,
+ CORBA::Boolean theIsMultiFile)
{
if(MYDEBUG) MESSAGE("Result_i::Restore - " << thePrefix);
mySObject = SALOMEDS::SObject::_duplicate(theSObject);
try {
myFileName = VISU::Storable::FindValue(theMap, "myName").toLatin1().data();
+#ifdef WIN32
+ for (int i = 0; i < myFileName.length(); i++)
+ {
+ if (myFileName[i] == ':')
+ myFileName[i] = '_';
+ }
+#endif
SetInitFileName(VISU::Storable::FindValue(theMap, "myInitFileName").toLatin1().data());
-
+
SALOMEDS::SObject_var aRefSObj, aTargetRefSObj;
if (theSObject->FindSubObject(1, aRefSObj) && aRefSObj->ReferencedObject(aTargetRefSObj)) {
if(MYDEBUG) MESSAGE("Result_i::GetInput - There is some reference.");
CORBA::String_var aDataType = aCompRefSObj->ComponentDataType();
myFileInfo.setFile(aDataType.in());
if(MYDEBUG) MESSAGE("Result_i::GetInput - aDataType = " << aDataType);
- Engines::Component_var aEngComp =
- Base_i::myEnginesLifeCycle->FindOrLoad_Component("FactoryServer", aDataType.in());
+ Engines::EngineComponent_var aEngComp =
+ Base_i::myEnginesLifeCycle->FindOrLoad_Component("FactoryServer", aDataType.in());
if (CORBA::is_nil(aEngComp))
- throw std::runtime_error("Restore - There is no aEngComp for the aDataType !!!");
+ throw std::runtime_error("Restore - There is no aEngComp for the aDataType !!!");
SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(aEngComp);
aStudyBuilder->LoadWith(aCompRefSObj, aDriver);
SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(aMedObject);
if (!CORBA::is_nil(aField)) {
// create field converter
- myInput.reset(CreateMEDFieldConvertor(aField));
- myInput->Build();
+ myInput.reset(CreateMEDFieldConvertor(aField));
+ myInput->Build();
}
else if (strcmp(aDataType, "MED") == 0) {
// create MED converter
- myInput.reset(CreateMEDConvertor(aTargetRefSObj));
- myInput->Build();
+ myInput.reset(CreateMEDConvertor(aTargetRefSObj));
+ myInput->Build();
}
else {
- throw std::runtime_error("GetInput - There is no convertor for the aDataType !!!");
+ throw std::runtime_error("GetInput - There is no convertor for the aDataType !!!");
}
} else {
myFileInfo.setFile(thePrefix.c_str());
std::string aStudyPrefix ("");
if (theIsMultiFile) {
- CORBA::String_var anURL(GetStudyDocument()->URL());
- aStudyPrefix = SALOMEDS_Tool::GetNameFromPath(anURL.in());
+ CORBA::String_var anURL(GetStudyDocument()->URL());
+ aStudyPrefix = SALOMEDS_Tool::GetNameFromPath(anURL.in());
}
if (!myFileInfo.isFile()) {
- std::string aFileName = thePrefix + aStudyPrefix + "_" + myFileName;
- myFileInfo.setFile(aFileName.c_str());
+ std::string aFileName = thePrefix + aStudyPrefix + "_" + myFileName;
+ myFileInfo.setFile(aFileName.c_str());
}
if(MYDEBUG)
- MESSAGE("Result_i::Restore - aFileName = " << myFileInfo.filePath().toLatin1().data() << "; " << myFileInfo.isFile());
-
+ MESSAGE("Result_i::Restore - aFileName = " << myFileInfo.filePath().toLatin1().data() << "; " << myFileInfo.isFile());
+
if (HDFascii::isASCII(myFileInfo.filePath().toLatin1().data())) {
- MESSAGE("ConvertFromASCIIToHDF(" << myFileInfo.filePath().toLatin1().data() << ")");
- char* aResultPath = HDFascii::ConvertFromASCIIToHDF(myFileInfo.filePath().toLatin1().data());
- MESSAGE("ConvertFromASCIIToHDF() DONE : " << aResultPath);
- char* aHDFFileName = new char[strlen(aResultPath) + 19];
- sprintf(aHDFFileName, "%shdf_from_ascii.hdf", aResultPath);
-
- if (theIsMultiFile) { // set this file as new - temporary
- static QString aCommand;
- aCommand.sprintf(" %s %s%s",aHDFFileName, aResultPath, myFileInfo.baseName().toLatin1().data());
- aCommand = QDir::convertSeparators( aCommand );
- aCommand.prepend( MOVE_COMMAND );
-
- if (system(aCommand.toLatin1().data()) == -1) {
- if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - Can't execute the command :" << aCommand.toLatin1().data());
- return NULL;
- } else {
- if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - " << aCommand.toLatin1().data());
- }
- myFileInfo.setFile(QString(aResultPath) + myFileInfo.baseName());
- } else { // change current temporary file to the new: with hdf-format
- static QString aCommand;
- aCommand.sprintf(" %s %s\0",aHDFFileName, myFileInfo.filePath().toLatin1().data());
- aCommand = QDir::convertSeparators( aCommand );
- aCommand.prepend( MOVE_COMMAND );
-
- if (system(aCommand.toLatin1().data()) == -1) {
- if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - Can't execute the command :" << aCommand.toLatin1().data());
- return NULL;
- } else {
- if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - " << aCommand.toLatin1().data());
- }
- SALOMEDS::ListOfFileNames_var anEmptyList = new SALOMEDS::ListOfFileNames;
- SALOMEDS_Tool::RemoveTemporaryFiles(aResultPath, anEmptyList.in(), true);
- }
- mySourceId = eRestoredFile;
- delete(aResultPath);
- delete(aHDFFileName);
+ MESSAGE("ConvertFromASCIIToHDF(" << myFileInfo.filePath().toLatin1().data() << ")");
+ char* aResultPath = HDFascii::ConvertFromASCIIToHDF(myFileInfo.filePath().toLatin1().data());
+ MESSAGE("ConvertFromASCIIToHDF() DONE : " << aResultPath);
+ char* aHDFFileName = new char[strlen(aResultPath) + 19];
+ sprintf(aHDFFileName, "%shdf_from_ascii.hdf", aResultPath);
+
+ if (theIsMultiFile) { // set this file as new - temporary
+ static QString aCommand;
+ aCommand.sprintf(" %s %s%s",aHDFFileName, aResultPath, myFileInfo.baseName().toLatin1().data());
+ aCommand = QDir::convertSeparators( aCommand );
+ aCommand.prepend( MOVE_COMMAND );
+
+ if (system(aCommand.toLatin1().data()) == -1) {
+ if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - Can't execute the command :" << aCommand.toLatin1().data());
+ return NULL;
+ } else {
+ if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - " << aCommand.toLatin1().data());
+ }
+ myFileInfo.setFile(QString(aResultPath) + myFileInfo.baseName());
+ } else { // change current temporary file to the new: with hdf-format
+ static QString aCommand;
+ aCommand.sprintf(" %s %s\0",aHDFFileName, myFileInfo.filePath().toLatin1().data());
+ aCommand = QDir::convertSeparators( aCommand );
+ aCommand.prepend( MOVE_COMMAND );
+
+ if (system(aCommand.toLatin1().data()) == -1) {
+ if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - Can't execute the command :" << aCommand.toLatin1().data());
+ return NULL;
+ } else {
+ if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - " << aCommand.toLatin1().data());
+ }
+ SALOMEDS::ListOfFileNames_var anEmptyList = new SALOMEDS::ListOfFileNames;
+ SALOMEDS_Tool::RemoveTemporaryFiles(aResultPath, anEmptyList.in(), true);
+ }
+ mySourceId = eRestoredFile;
+ delete(aResultPath);
+ delete(aHDFFileName);
} else if (!theIsMultiFile) {
- mySourceId = eRestoredFile;
+ mySourceId = eRestoredFile;
} else {
- mySourceId = eSavedFile;
+ mySourceId = eSavedFile;
}
if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - mySourceId = " << mySourceId);
myInput.reset(CreateConvertor(myFileInfo.filePath().toLatin1().data()));
myInput->BuildEntities();
if(myIsBuildFields){
- myInput->BuildFields();
- myIsFieldsDone = true;
- if(myIsBuildMinMax){
- myInput->BuildMinMax();
- myIsMinMaxDone = true;
- }
+ myInput->BuildFields();
+ myIsFieldsDone = true;
+ if(myIsBuildMinMax){
+ myInput->BuildMinMax();
+ myIsMinMaxDone = true;
+ }
}
if(myIsBuildGroups){
- myInput->BuildGroups();
- myIsGroupsDone = true;
+ myInput->BuildGroups();
+ myIsGroupsDone = true;
}
QString aComment;
aComment.sprintf("myComment=%s;myFileName=%s;myInitFileName=%s",
- GetComment(),
- myFileInfo.filePath().toLatin1().data(),
- GetInitFileName().c_str()); // Restoring of Python dump
+ GetComment(),
+ myFileInfo.filePath().toLatin1().data(),
+ GetInitFileName().c_str()); // Restoring of Python dump
SALOMEDS::GenericAttribute_var anAttr;
if (!theSObject->FindAttribute(anAttr, "AttributeString"))
- throw std::runtime_error("Build - There is no AttributeString for the SObject !!!");
+ throw std::runtime_error("Build - There is no AttributeString for the SObject !!!");
SALOMEDS::AttributeString_var aCmnt = SALOMEDS::AttributeString::_narrow(anAttr);
aCmnt->SetValue(aComment.toLatin1().data());
}
//---------------------------------------------------------------
VISU::Result_i::PInput
VISU::Result_i
-::GetInput(const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Long theTimeStampNumber)
+::GetInput(const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber)
{
return myInput;
}
//---------------------------------------------------------------
-CORBA::Boolean
+CORBA::Boolean
VISU::Result_i
-::IsDone()
+::IsDone()
{
- return
- myIsEntitiesDone &&
+ return
+ myIsEntitiesDone &&
(myIsBuildFields? myIsFieldsDone: true) &&
(myIsBuildMinMax? myIsMinMaxDone: true) &&
(myIsBuildGroups? myIsGroupsDone: true);
}
-CORBA::Boolean
+CORBA::Boolean
VISU::Result_i
-::IsEntitiesDone()
+::IsEntitiesDone()
{
return myIsEntitiesDone;
}
void
VISU::Result_i
-::SetBuildFields(CORBA::Boolean theIsBuildFields,
- CORBA::Boolean theIsCalculateMinMax)
+::SetBuildFields(CORBA::Boolean theIsBuildFields,
+ CORBA::Boolean theIsCalculateMinMax)
{
myIsBuildFields = theIsBuildFields;
if(theIsBuildFields)
myIsBuildGroups = theIsBuildGroups;
}
-CORBA::Boolean
+CORBA::Boolean
VISU::Result_i
-::IsFieldsDone()
+::IsFieldsDone()
{
return myIsFieldsDone;
}
-CORBA::Boolean
+CORBA::Boolean
VISU::Result_i
-::IsGroupsDone()
+::IsGroupsDone()
{
return myIsGroupsDone;
}
-CORBA::Boolean
+CORBA::Boolean
VISU::Result_i
-::IsMinMaxDone()
+::IsMinMaxDone()
{
return myIsMinMaxDone;
}
-CORBA::Boolean
+CORBA::Boolean
VISU::Result_i
::IsPartsDone()
{
//---------------------------------------------------------------
-VISU::Result::EntityNames*
+VISU::Result::EntityNames*
VISU::Result_i
::GetMeshNames()
{
const std::string& aName = anIter->first;
aResult[anId] = aName.c_str();
}
-
+
return aResult._retn();
}
//---------------------------------------------------------------
-VISU::Result::Entities*
+VISU::Result::Entities*
VISU::Result_i
::GetEntities(const char* theMeshName)
{
VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName);
if(anIter == aMeshMap.end())
return anEntities._retn();
-
+
const VISU::PMesh& aMesh = anIter->second;
const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
if(aMeshOnEntityMap.empty())
//---------------------------------------------------------------
-VISU::Result::EntityNames*
+VISU::Result::EntityNames*
VISU::Result_i
-::GetFamilies(const char* theMeshName,
- VISU::Entity theEntity)
+::GetFamilies(const char* theMeshName,
+ VISU::Entity theEntity)
{
VISU::Result::EntityNames_var aResult = new VISU::Result::EntityNames();
const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap();
VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName);
if(anIter == aMeshMap.end())
return aResult._retn();
-
+
const VISU::PMesh& aMesh = anIter->second;
const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
if(aMeshOnEntityMap.empty())
const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
if(aFamilyMap.empty())
return aResult._retn();
-
+
{
aResult->length(aFamilyMap.size());
VISU::TFamilyMap::const_iterator anIter = aFamilyMap.begin();
for(size_t anId = 0; anIter != aFamilyMap.end(); anIter++, anId++){
- const std::string& aName = anIter->first;
- aResult[anId] = aName.c_str();
+ const std::string& aName = anIter->first;
+ aResult[anId] = aName.c_str();
}
}
}
//---------------------------------------------------------------
-VISU::Result::EntityNames*
+VISU::Result::EntityNames*
VISU::Result_i
::GetGroups(const char* theMeshName)
{
VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName);
if(anIter == aMeshMap.end())
return aResult._retn();
-
+
const VISU::PMesh& aMesh = anIter->second;
const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
if(aGroupMap.empty())
//---------------------------------------------------------------
VISU::Result::EntityNames*
VISU::Result_i
-::GetFields(const char* theMeshName,
- VISU::Entity theEntity)
+::GetFields(const char* theMeshName,
+ VISU::Entity theEntity)
{
VISU::Result::EntityNames_var aResult = new VISU::Result::EntityNames();
const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap();
VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName);
if(anIter == aMeshMap.end())
return aResult._retn();
-
+
const VISU::PMesh& aMesh = anIter->second;
const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
if(aMeshOnEntityMap.empty())
const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
if(aFieldMap.empty())
return aResult._retn();
-
+
{
aResult->length(aFieldMap.size());
VISU::TFieldMap::const_iterator anIter = aFieldMap.begin();
for(size_t anId = 0; anIter != aFieldMap.end(); anIter++, anId++){
- const std::string& aName = anIter->first;
- aResult[anId] = aName.c_str();
+ const std::string& aName = anIter->first;
+ aResult[anId] = aName.c_str();
}
}
}
//---------------------------------------------------------------
-VISU::Result::TimeStampNumbers*
+VISU::Result::TimeStampNumbers*
VISU::Result_i
-::GetTimeStampNumbers(const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName)
+::GetTimeStampNumbers(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName)
{
VISU::Result::TimeStampNumbers_var aResult = new VISU::Result::TimeStampNumbers();
const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap();
VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName);
if(anIter == aMeshMap.end())
return aResult._retn();
-
+
const VISU::PMesh& aMesh = anIter->second;
const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
if(aMeshOnEntityMap.empty())
{
VISU::TFieldMap::const_iterator anIter = aFieldMap.find(theFieldName);
if(anIter == aFieldMap.end())
- return aResult._retn();
+ return aResult._retn();
{
- const VISU::PField& aField = anIter->second;
- const VISU::TValField& aValField = aField->myValField;
- if(aValField.empty())
- return aResult._retn();
-
- {
- aResult->length(aValField.size());
- VISU::TValField::const_iterator anIter = aValField.begin();
- for(size_t anId = 0; anIter != aValField.end(); anIter++, anId++){
- const vtkIdType& aTimeStampNumber = anIter->first;
- aResult[anId] = aTimeStampNumber;
- }
- }
+ const VISU::PField& aField = anIter->second;
+ const VISU::TValField& aValField = aField->myValField;
+ if(aValField.empty())
+ return aResult._retn();
+
+ {
+ aResult->length(aValField.size());
+ VISU::TValField::const_iterator anIter = aValField.begin();
+ for(size_t anId = 0; anIter != aValField.end(); anIter++, anId++){
+ const vtkIdType& aTimeStampNumber = anIter->first;
+ aResult[anId] = aTimeStampNumber;
+ }
+ }
}
}
}
//---------------------------------------------------------------
-CORBA::Long
+VISU::double_array*
VISU::Result_i
-::GetNumberOfComponents(const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName)
+::GetTimeStampValues(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName)
+{
+ VISU::double_array_var aResult = new VISU::double_array();
+ const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap();
+ if(aMeshMap.empty())
+ return aResult._retn();
+
+ VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName);
+ if(anIter == aMeshMap.end())
+ return aResult._retn();
+
+ const VISU::PMesh& aMesh = anIter->second;
+ const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+ if(aMeshOnEntityMap.empty())
+ return aResult._retn();
+
+ {
+ VISU::TEntity anEntity = VISU::TEntity(theEntity);
+ VISU::TMeshOnEntityMap::const_iterator anIter = aMeshOnEntityMap.find(anEntity);
+ if(anIter == aMeshOnEntityMap.end())
+ return aResult._retn();
+
+ const VISU::PMeshOnEntity& aMeshOnEntity = anIter->second;
+ const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ if(aFieldMap.empty())
+ return aResult._retn();
+
+ {
+ VISU::TFieldMap::const_iterator anIter = aFieldMap.find(theFieldName);
+ if(anIter == aFieldMap.end())
+ return aResult._retn();
+
+ {
+ const VISU::PField& aField = anIter->second;
+ const VISU::TValField& aValField = aField->myValField;
+ if(aValField.empty())
+ return aResult._retn();
+
+ {
+ aResult->length(aValField.size());
+ VISU::TValField::const_iterator anIter = aValField.begin();
+ for(size_t anId = 0; anIter != aValField.end(); anIter++, anId++){
+ const PValForTime& aValForTime = anIter->second;
+ aResult[anId] = aValForTime->myTime.first;
+ }
+ }
+ }
+ }
+ }
+
+ return aResult._retn();
+}
+
+
+//---------------------------------------------------------------
+CORBA::Long
+VISU::Result_i
+::GetNumberOfComponents(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName)
{
CORBA::Long aResult = 0;
const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap();
VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName);
if(anIter == aMeshMap.end())
return aResult;
-
+
const VISU::PMesh& aMesh = anIter->second;
const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
if(aMeshOnEntityMap.empty())
{
VISU::TFieldMap::const_iterator anIter = aFieldMap.find(theFieldName);
if(anIter == aFieldMap.end())
- return aResult;
+ return aResult;
{
- const VISU::PField& aField = anIter->second;
- aResult = aField->myNbComp;
+ const VISU::PField& aField = anIter->second;
+ aResult = aField->myNbComp;
}
}
}
//---------------------------------------------------------------
-VISU::Result::EntityNames*
+VISU::Result::EntityNames*
VISU::Result_i
::GetPartNames(const char* theMeshName)
{
//---------------------------------------------------------------
-VISU::Result::Resolutions*
+VISU::Result::Resolutions*
VISU::Result_i
-::GetResolutions(const char* theMeshName,
- const char* thePartName)
+::GetResolutions(const char* theMeshName,
+ const char* thePartName)
{
VISU::Result::Resolutions_var aResult = new VISU::Result::Resolutions();
return aResult._retn();
//---------------------------------------------------------------
VISU::Result::Resolution
VISU::Result_i
-::GetResolution(const char* theMeshName,
- const char* thePartName)
+::GetResolution(const char* theMeshName,
+ const char* thePartName)
{
return VISU::Result::HIDDEN;
}
//---------------------------------------------------------------
-void
+void
VISU::Result_i
-::SetResolution(const char* theMeshName,
- const char* thePartName,
- VISU::Result::Resolution theResolution)
+::SetResolution(const char* theMeshName,
+ const char* thePartName,
+ VISU::Result::Resolution theResolution)
{}
CORBA::Boolean theIsBuildGroups)
{
return new RESULT_CLASS_NAME(theStudy,
- theSourceId,
- theCreationId,
- theIsBuildImmediately,
- theIsBuildFields,
- theIsBuildMinMax,
- theIsBuildGroups);
+ theSourceId,
+ theCreationId,
+ theIsBuildImmediately,
+ theIsBuildFields,
+ theIsBuildMinMax,
+ theIsBuildGroups);
}
VISU::Storable*
VISU::Result_i
::StorableEngine(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap,
- const std::string& thePrefix,
- CORBA::Boolean theIsMultiFile)
+ const Storable::TRestoringMap& theMap,
+ const std::string& thePrefix,
+ CORBA::Boolean theIsMultiFile)
{
VISU::Result_i* aResult = new RESULT_CLASS_NAME();
return aResult->Restore(theSObject, theMap, thePrefix, theIsMultiFile);
//---------------------------------------------------------------
-void
+void
VISU::Result_i
::ToStream(std::ostringstream& theStr)
{
aCommand.sprintf(" %s %s", aTempFileName, theTargetFileName);
aCommand = QDir::convertSeparators( aCommand );
aCommand.prepend( COPY_COMMAND );
-
+
if(system(aCommand.toLatin1().data()) != 0) {
if(MYDEBUG) MESSAGE("VISU_Gen_i::Copy - Cann't execute the command :"<<aCommand.toLatin1().data());
return false;
}
-void
+void
VISU::Result_i
::SetInitFileName(const std::string& theFileName)
{
VISU::Result_i
::GetFileName() const
{
- if(GetSourceId() == eRestoredFile)
+ if(GetSourceId() == eFile)
return VISU::MakeFileName(myFileName, this);
return myFileName;
SALOMEDS::SObject_var
VISU::Result_i
-::GetSObject() const
-{
+::GetSObject() const
+{
return mySObject;
}
SALOMEDS::Study_var
VISU::Result_i
-::GetStudyDocument() const
-{
+::GetStudyDocument() const
+{
return myStudyDocument;
}
-_PTR(Study)
+_PTR(Study)
VISU::Result_i
-::GetStudy() const
-{
+::GetStudy() const
+{
return myStudy;
}
return mySComponent;
}
-std::string
+std::string
VISU::Result_i
::GetEntry(const Storable::TRestoringMap& theRestoringMap)
{
return Storable::FindEntry(myStudyDocument,
- GetEntry(),
- theRestoringMap);
+ GetEntry(),
+ theRestoringMap);
}
//function : GetAxisInfo
//purpose :
//=======================================================================
-const VISU::Result_i::TAxisInfo*
+const VISU::Result_i::TAxisInfo*
VISU::Result_i
::GetAxisInfo(const string& theMeshName,
- TAxis theAxis,
- gp_Dir& thePlaneNormal)
+ TAxis theAxis,
+ gp_Dir& thePlaneNormal)
{
const TAxisInfo* components = NULL;
theMesh = aIter->second;
VISU::PUnstructuredGridIDMapper anIDMapper = myInput->GetMeshOnEntity(theMeshName,
- CELL_ENTITY);
+ CELL_ENTITY);
vtkUnstructuredGrid* aMesh = anIDMapper->GetUnstructuredGridOutput();
if ( !aMesh || aMesh->GetNumberOfCells() == 0 ) {
float minSize[3] = { FLT_MAX, FLT_MAX, FLT_MAX };
bool axesComputed = false;
for ( vtkIdType iCell = 0; iCell < aMesh->GetNumberOfCells(); ++iCell ) {
- vtkCell* cell = aMesh->GetCell( iCell );
-
- if (cell->GetCellType() != VTK_HEXAHEDRON &&
- cell->GetCellType() != VTK_QUADRATIC_HEXAHEDRON )
- continue;
- vtkPoints * points = cell->GetPoints();
- vtkFloatingPointType coords[ 4 ][3];
- points->GetPoint( 0, coords[0] );
- points->GetPoint( 1, coords[1] );
- points->GetPoint( 3, coords[2] );
- points->GetPoint( 4, coords[3] );
- gp_Pnt p0( coords[0][0], coords[0][1], coords[0][2] );
- for ( iAx = 0; iAx < nbAxes; ++iAx ) {
- vtkFloatingPointType* coo = coords[ iAx + 1 ];
- gp_Pnt p( coo[0], coo[1], coo[2] );
- // min size
- vtkFloatingPointType size = p0.SquareDistance( p );
- if ( size > FLT_MIN && size < minSize[ iAx ] )
- minSize[ iAx ] = size;
- // axis direction
- if ( !axesComputed ) {
- gp_Vec dir( p0, p );
- if ( dir.SquareMagnitude() <= gp::Resolution() ) {
- break;
- }
- axDirs[ iAx ] = dir;
- }
- }
- if ( iAx == nbAxes )
- axesComputed = true;
+ vtkCell* cell = aMesh->GetCell( iCell );
+
+ if (cell->GetCellType() != VTK_HEXAHEDRON &&
+ cell->GetCellType() != VTK_QUADRATIC_HEXAHEDRON )
+ continue;
+ vtkPoints * points = cell->GetPoints();
+ vtkFloatingPointType coords[ 4 ][3];
+ points->GetPoint( 0, coords[0] );
+ points->GetPoint( 1, coords[1] );
+ points->GetPoint( 3, coords[2] );
+ points->GetPoint( 4, coords[3] );
+ gp_Pnt p0( coords[0][0], coords[0][1], coords[0][2] );
+ for ( iAx = 0; iAx < nbAxes; ++iAx ) {
+ vtkFloatingPointType* coo = coords[ iAx + 1 ];
+ gp_Pnt p( coo[0], coo[1], coo[2] );
+ // min size
+ vtkFloatingPointType size = p0.SquareDistance( p );
+ if ( size > FLT_MIN && size < minSize[ iAx ] )
+ minSize[ iAx ] = size;
+ // axis direction
+ if ( !axesComputed ) {
+ gp_Vec dir( p0, p );
+ if ( dir.SquareMagnitude() <= gp::Resolution() ) {
+ break;
+ }
+ axDirs[ iAx ] = dir;
+ }
+ }
+ if ( iAx == nbAxes )
+ axesComputed = true;
}
if ( !axesComputed ) {
- MESSAGE("No good hexahedrons in the mesh: " << theMeshName );
- return components;
+ MESSAGE("No good hexahedrons in the mesh: " << theMeshName );
+ return components;
}
-
+
// compute axes dirs
gInfo = & myMeshName2GridInfoMap[ theMeshName ];
for ( iAx = 0; iAx < nbAxes; ++iAx ) {
- int iPrev = ( iAx == 0 ) ? 2 : iAx - 1;
- int iNext = ( iAx == 2 ) ? 0 : iAx + 1;
- gInfo->myAxis[ iAx ] = axDirs[ iPrev ] ^ axDirs[ iNext ];
+ int iPrev = ( iAx == 0 ) ? 2 : iAx - 1;
+ int iNext = ( iAx == 2 ) ? 0 : iAx + 1;
+ gInfo->myAxis[ iAx ] = axDirs[ iPrev ] ^ axDirs[ iNext ];
}
-
+
// get and sort intermediate component values - projections of nodes
// on axis direction; define bnd box
set< vtkFloatingPointType > comps[ 3 ];
vtkPoints * points = aMesh->GetPoints();
vtkIdType iP, nbP = aMesh->GetNumberOfPoints();
for ( iP = 0; iP < nbP; ++iP ) {
- vtkFloatingPointType coo[3];
- points->GetPoint( iP, coo );
- gp_Pnt p( coo[0], coo[1], coo[2] );
- box.Add( p );
- for ( iAx = 0; iAx < nbAxes; ++iAx ) {
- const gp_Dir& dir = gInfo->myAxis[ iAx ];
- vtkFloatingPointType dot = dir.XYZ() * p.XYZ();
- comps[ iAx ].insert( dot );
- }
+ vtkFloatingPointType coo[3];
+ points->GetPoint( iP, coo );
+ gp_Pnt p( coo[0], coo[1], coo[2] );
+ box.Add( p );
+ for ( iAx = 0; iAx < nbAxes; ++iAx ) {
+ const gp_Dir& dir = gInfo->myAxis[ iAx ];
+ vtkFloatingPointType dot = dir.XYZ() * p.XYZ();
+ comps[ iAx ].insert( dot );
+ }
}
-
+
// find a range of projections of bnd box corners on each axis
vtkFloatingPointType range[3], firstValue[3];
double x[2],y[2],z[2];
box.Get(x[0],y[0],z[0],x[1],y[1],z[1]);
for ( iAx = 0; iAx < nbAxes; ++iAx ) {
- set< vtkFloatingPointType > bndComps;
- const gp_Dir& dir = gInfo->myAxis[ iAx ];
- for ( int iX = 0; iX < 2; ++iX ) {
- for ( int iY = 0; iY < 2; ++iY ) {
- for ( int iZ = 0; iZ < 2; ++iZ ) {
- gp_Pnt p( x[ iX ], y[ iY ], z[ iZ ] );
- vtkFloatingPointType dot = dir.XYZ() * p.XYZ();
- bndComps.insert( dot );
- }
- }
- }
- firstValue[ iAx ] = *bndComps.begin();
- range[ iAx ] = *bndComps.rbegin() - *bndComps.begin();
+ set< vtkFloatingPointType > bndComps;
+ const gp_Dir& dir = gInfo->myAxis[ iAx ];
+ for ( int iX = 0; iX < 2; ++iX ) {
+ for ( int iY = 0; iY < 2; ++iY ) {
+ for ( int iZ = 0; iZ < 2; ++iZ ) {
+ gp_Pnt p( x[ iX ], y[ iY ], z[ iZ ] );
+ vtkFloatingPointType dot = dir.XYZ() * p.XYZ();
+ bndComps.insert( dot );
+ }
+ }
+ }
+ firstValue[ iAx ] = *bndComps.begin();
+ range[ iAx ] = *bndComps.rbegin() - *bndComps.begin();
}
-
+
// compute component values
for ( iAx = 0; iAx < nbAxes; ++iAx ) {
- list< vtkFloatingPointType > values;
- int nbVals = 0;
- set< vtkFloatingPointType >& comp = comps[ iAx ];
- set< vtkFloatingPointType >::iterator val = comp.begin();
- vtkFloatingPointType bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ];
- vtkFloatingPointType tol = 0.1 * sqrt( minSize[ iAx ]) / rng;
- for ( ; val != comp.end(); ++val ) {
- vtkFloatingPointType value = ( *val - first ) / rng;
- if ( value > bnd ) {
- values.push_back( value );
- bnd = value + tol;
- nbVals++;
- }
- }
- // store values in gInfo
- vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ iAx ];
- myComp.resize( nbVals );
- list< vtkFloatingPointType >::iterator v = values.begin();
- for ( int i = 0; v != values.end(); ++v ){
- myComp[ i++ ] = *v;
- }
+ list< vtkFloatingPointType > values;
+ int nbVals = 0;
+ set< vtkFloatingPointType >& comp = comps[ iAx ];
+ set< vtkFloatingPointType >::iterator val = comp.begin();
+ vtkFloatingPointType bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ];
+ vtkFloatingPointType tol = 0.1 * sqrt( minSize[ iAx ]) / rng;
+ for ( ; val != comp.end(); ++val ) {
+ vtkFloatingPointType value = ( *val - first ) / rng;
+ if ( value > bnd ) {
+ values.push_back( value );
+ bnd = value + tol;
+ nbVals++;
+ }
+ }
+ // store values in gInfo
+ vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ iAx ];
+ myComp.resize( nbVals );
+ list< vtkFloatingPointType >::iterator v = values.begin();
+ for ( int i = 0; v != values.end(); ++v ){
+ myComp[ i++ ] = *v;
+ }
}
}
else {
gInfo = & myMeshName2GridInfoMap[ theMeshName ];
switch ( aMeshDim ) {
case 3: {
- gp_Dir aDir(0.0,0.0,1.0);
- gInfo->myAxis[ 2 ] = aDir;
+ gp_Dir aDir(0.0,0.0,1.0);
+ gInfo->myAxis[ 2 ] = aDir;
}
case 2: {
- gp_Dir aDir(0.0,1.0,0.0);
- gInfo->myAxis[ 1 ] = aDir;
+ gp_Dir aDir(0.0,1.0,0.0);
+ gInfo->myAxis[ 1 ] = aDir;
}
case 1: {
- gp_Dir aDir(1.0,0.0,0.0);
- gInfo->myAxis[ 0 ] = aDir;
+ gp_Dir aDir(1.0,0.0,0.0);
+ gInfo->myAxis[ 0 ] = aDir;
}}
-
+
TStructuredId aStructuredId = theMesh->GetStructure();
vector<vtkFloatingPointType> PointsCoords[3];
vtkPoints* aPoints = aMesh->GetPoints();
switch ( aMeshDim ) {
case 3: {
- TStructuredId aCoordIJK;
- vtkIdType nbZ = aStructuredId[2];
- for ( int i = 0; i < nbZ; i++ ) {
- aCoordIJK[2] = i + 1;
- vtkIdType aObjID = anIDMapper->GetObjectIDByIndexes(aCoordIJK);
- vtkIdType aVTKID = anIDMapper->GetNodeVTKID(aObjID);
- vtkFloatingPointType* aPCoord = aPoints->GetPoint(aVTKID);
- PointsCoords[2].push_back(aPCoord[2]);
- }
+ TStructuredId aCoordIJK;
+ vtkIdType nbZ = aStructuredId[2];
+ for ( int i = 0; i < nbZ; i++ ) {
+ aCoordIJK[2] = i + 1;
+ vtkIdType aObjID = anIDMapper->GetObjectIDByIndexes(aCoordIJK);
+ vtkIdType aVTKID = anIDMapper->GetNodeVTKID(aObjID);
+ vtkFloatingPointType* aPCoord = aPoints->GetPoint(aVTKID);
+ PointsCoords[2].push_back(aPCoord[2]);
+ }
}
case 2: {
- TStructuredId aCoordIJK;
- vtkIdType nbJ = aStructuredId[1];
- for ( int i = 0; i < nbJ; i++ ) {
- aCoordIJK[1] = i + 1;
- vtkIdType aObjID = anIDMapper->GetObjectIDByIndexes(aCoordIJK);
- vtkIdType aVTKID = anIDMapper->GetNodeVTKID(aObjID);
- vtkFloatingPointType* aPCoord = aPoints->GetPoint(aVTKID);
- PointsCoords[1].push_back(aPCoord[1]);
- }
+ TStructuredId aCoordIJK;
+ vtkIdType nbJ = aStructuredId[1];
+ for ( int i = 0; i < nbJ; i++ ) {
+ aCoordIJK[1] = i + 1;
+ vtkIdType aObjID = anIDMapper->GetObjectIDByIndexes(aCoordIJK);
+ vtkIdType aVTKID = anIDMapper->GetNodeVTKID(aObjID);
+ vtkFloatingPointType* aPCoord = aPoints->GetPoint(aVTKID);
+ PointsCoords[1].push_back(aPCoord[1]);
+ }
}
case 1: {
- TStructuredId aCoordIJK;
- vtkIdType nbI = aStructuredId[0];
- for ( int i = 0; i < nbI; i++ ) {
- aCoordIJK[0] = i + 1;
- vtkIdType aObjID = anIDMapper->GetObjectIDByIndexes(aCoordIJK);
- vtkIdType aVTKID = anIDMapper->GetNodeVTKID(aObjID);
- vtkFloatingPointType* aPCoord = aPoints->GetPoint(aVTKID);
- PointsCoords[0].push_back(aPCoord[0]);
- }
+ TStructuredId aCoordIJK;
+ vtkIdType nbI = aStructuredId[0];
+ for ( int i = 0; i < nbI; i++ ) {
+ aCoordIJK[0] = i + 1;
+ vtkIdType aObjID = anIDMapper->GetObjectIDByIndexes(aCoordIJK);
+ vtkIdType aVTKID = anIDMapper->GetNodeVTKID(aObjID);
+ vtkFloatingPointType* aPCoord = aPoints->GetPoint(aVTKID);
+ PointsCoords[0].push_back(aPCoord[0]);
+ }
}}
for ( int i = 0; i < aMeshDim; i++ ) {
- vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ i ];
- int aSize = PointsCoords[i].size();
- if ( aSize > 0 ) {
- vtkFloatingPointType aLen = PointsCoords[i][aSize-1] - PointsCoords[i][0];
- myComp.resize(aSize);
- myComp[0] = 0;
- for ( int k = 1; k < aSize; k++ ) {
- myComp[k]=myComp[k-1] + (PointsCoords[i][k]-PointsCoords[i][k-1])/aLen;
- }
- }
+ vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ i ];
+ int aSize = PointsCoords[i].size();
+ if ( aSize > 0 ) {
+ vtkFloatingPointType aLen = PointsCoords[i][aSize-1] - PointsCoords[i][0];
+ myComp.resize(aSize);
+ myComp[0] = 0;
+ for ( int k = 1; k < aSize; k++ ) {
+ myComp[k]=myComp[k-1] + (PointsCoords[i][k]-PointsCoords[i][k-1])/aLen;
+ }
+ }
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Result_i.hh
// Author : Alexey PETROV
Entity theEntity,
const char* theFieldName);
+ virtual
+ VISU::double_array*
+ GetTimeStampValues(const char* theMeshName,
+ Entity theEntity,
+ const char* theFieldName);
+
virtual
CORBA::Long
GetNumberOfComponents(const char* theMeshName,
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.cxx
// Author : Alexey PETROV
#include "VISU_Prs3dUtils.hh"
#include "VISU_Result_i.hh"
+#include "VISU_ResultUtils.hh"
#include "VISU_ScalarMapAct.h"
#include "VISU_ScalarMapPL.hxx"
#include "VISU_LookupTable.hxx"
+#include "VISU_PipeLineUtils.hxx"
#include "VISU_ScalarBarActor.hxx"
#include "VISU_Convertor.hxx"
return aResult;
}
+//----------------------------------------------------------------------------
+namespace
+{
+ bool
+ IsSameColor(const SALOMEDS::Color& theLeft,
+ const SALOMEDS::Color& theRight)
+ {
+ return
+ VISU::CheckIsSameValue(theLeft.R, theRight.R) &&
+ VISU::CheckIsSameValue(theLeft.G, theRight.G) &&
+ VISU::CheckIsSameValue(theLeft.B, theRight.B);
+ }
+}
+
//----------------------------------------------------------------------------
int VISU::ScalarMap_i::myNbPresent = 0;
aPixmap->SetPixMap(GetIconName());
// Update Object Browser
+ //rnv: to fix issue 0020167 (crash then AddMeshOnGroup called from
+ //python script). Solution: update object browser using UpdateObjBrowser event.
+ /*
SUIT_Session* aSession = SUIT_Session::session();
QList<SUIT_Application*> anApplications = aSession->applications();
QList<SUIT_Application*>::Iterator anIter = anApplications.begin();
}
anIter++;
}
+ */
+ bool done = true;
+ ProcessVoidEvent(new TUpdateObjBrowser(aStudyDocument->StudyId(),&done));
}
//----------------------------------------------------------------------------
ScalarMap_i* anOrigin = const_cast<ScalarMap_i*>(aPrs3d);
SetScaling(anOrigin->GetScaling());
+ SetGaussMetric(anOrigin->GetGaussMetric());
SetBarVisible(anOrigin->IsBarVisible());
Update();
}
else
SetScaling(VISU::LINEAR);
+ QColor aColor = aResourceMgr->colorValue( "VISU", "edge_color", QColor( 255, 255, 255 ) );
+ SALOMEDS::Color aLinkColor;
+ aLinkColor.R = aColor.red()/255.;
+ aLinkColor.G = aColor.green()/255.;
+ aLinkColor.B = aColor.blue()/255.;
+ SetLinkColor(aLinkColor);
+
+ int aGaussMetric = aResourceMgr->integerValue("VISU", "scalar_gauss_metric", 0);
+ SetGaussMetric((VISU::GaussMetric)aGaussMetric);
+
myShowBar = true;
return this;
}
QString aVal = VISU::Storable::FindValue(theMap,"myShowBar", "1");
SetBarVisible((aVal.toInt() == 1)? true : false);
+ SetGaussMetric(VISU::GaussMetric(VISU::Storable::FindValue(theMap,"myGaussMetric").toInt()));
+
+ SALOMEDS::Color aLinkColor;
+ aLinkColor.R = VISU::Storable::FindValue(theMap,"myLinkColor.R").toDouble();
+ aLinkColor.G = VISU::Storable::FindValue(theMap,"myLinkColor.G").toDouble();
+ aLinkColor.B = VISU::Storable::FindValue(theMap,"myLinkColor.B").toDouble();
+ SetLinkColor(aLinkColor);
+
// Check if the icon needs to be updated, update if necessary
SALOMEDS::Study_var aStudy = theSObject->GetStudy();
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
Storable::DataToStream( theStr, "myScaling", GetScaling() );
Storable::DataToStream( theStr, "myShowBar", (IsBarVisible()? 1:0) );
+ Storable::DataToStream( theStr, "myGaussMetric", int(GetGaussMetric()) );
+
+ SALOMEDS::Color aLinkColor = GetLinkColor();
+ Storable::DataToStream( theStr, "myLinkColor.R", aLinkColor.R );
+ Storable::DataToStream( theStr, "myLinkColor.G", aLinkColor.G );
+ Storable::DataToStream( theStr, "myLinkColor.B", aLinkColor.B );
}
(GetSpecificPL(), &VISU_ColoredPL::SetScaling, theScaling));
}
+//----------------------------------------------------------------------------
+void
+VISU::ScalarMap_i
+::SetLinkColor(const SALOMEDS::Color& theColor)
+{
+ if(IsSameColor(myLinkColor, theColor))
+ return;
+
+ VISU::TSetModified aModified(this);
+
+ myLinkColor = theColor;
+ myParamsTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+SALOMEDS::Color
+VISU::ScalarMap_i
+::GetLinkColor()
+{
+ return myLinkColor;
+}
+
+//----------------------------------------------------------------------------
+VISU::GaussMetric
+VISU::ScalarMap_i
+::GetGaussMetric()
+{
+ return VISU::GaussMetric(GetSpecificPL()->GetGaussMetric());
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::ScalarMap_i
+::SetGaussMetric(VISU::GaussMetric theGaussMetric)
+{
+ VISU::TSetModified aModified(this);
+
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapPL, VISU::TGaussMetric>
+ (GetSpecificPL(), &VISU_ScalarMapPL::SetGaussMetric, (VISU::TGaussMetric)theGaussMetric));
+}
+
//----------------------------------------------------------------------------
void
VISU::ScalarMap_i
if(anIDMapper){
int aNbGroups = myGroupNames.size();
if(myGroupNames.find(theGroupName) == myGroupNames.end()){
- GetSpecificPL()->AddGeometry(anIDMapper->GetOutput());
+ GetSpecificPL()->AddGeometry(anIDMapper->GetOutput(), theGroupName);
myGroupNames.insert(theGroupName);
if(aNbGroups == 0)
- UpdateIcon();
+ UpdateIcon();
+ // To update scalar range according to the new input (IPAL21305)
+ if(!IsRangeFixed())
+ SetSourceRange();
}
}
}
aResourceMgr->booleanValue("VISU", "show_non_manifold_edges", false) );
anActor->SetFeatureEdgesColoring( aResourceMgr->booleanValue("VISU", "feature_edges_coloring", false) );
+ anActor->SetQuadratic2DRepresentation(VISU_Actor::EQuadratic2DRepresentation(aResourceMgr->integerValue( "VISU",
+ "quadratic_mode",
+ 0)));
+
UpdateActor(anActor);
}catch(...){
anActor->Delete();
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
VISU_LookupTable * aLookupTable = GetSpecificPL()->GetBarTable();
- if ( IsScalarFilterUsed() ) {
+ bool anIsScalarFilterUsed = IsScalarFilterUsed();
+ if ( anIsScalarFilterUsed || aLookupTable->HasMarkedValues() )
aLookupTable->ForceBuild();
+
+ if ( anIsScalarFilterUsed ) {
static unsigned char MARK_COLOR[] = { 255, 255, 255 };
aLookupTable->MarkValueByColor( GetScalarFilterMin(), MARK_COLOR );
aLookupTable->MarkValueByColor( GetScalarFilterMax(), MARK_COLOR );
GetValLblFontColor( anRGB[ 0 ], anRGB[ 1 ], anRGB[ 2 ] );
aProp->SetColor( anRGB[ 0 ], anRGB[ 1 ], anRGB[ 2 ] );
}
+
+ // Update edge property
+ SALOMEDS::Color aLinkColor = GetLinkColor();
+ anActor->GetEdgeProperty()->SetColor(aLinkColor.R, aLinkColor.G, aLinkColor.B);
}
TSuperClass::UpdateActor(theActor);
}
void
Execute()
{
+ VISU::TNames aGroupNames;
+ VISU::GaussMetric aGaussMetric = VISU::AVERAGE;
+ if(VISU::ScalarMap_i* aPrs3d = dynamic_cast<VISU::ScalarMap_i*>(myColoredPrs3d)) {
+ aGroupNames = aPrs3d->GetSpecificPL()->GetGeometryNames();
+ aGaussMetric = aPrs3d->GetGaussMetric();
+ }
+
VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
if ( aMinMaxController ) {
myResult = aMinMaxController->GetComponentMin( myCompID );
} else {
VISU::TMinMax aTMinMax;
if(myColoredPrs3d->GetScalarField()->myIsELNO)
- aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID );
+ aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID, aGroupNames, (VISU::TGaussMetric)aGaussMetric );
else
- aTMinMax = myColoredPrs3d->GetScalarField()->GetAverageMinMax( myCompID );
+ aTMinMax = myColoredPrs3d->GetScalarField()->GetAverageMinMax( myCompID, aGroupNames, (VISU::TGaussMetric)aGaussMetric );
myResult = aTMinMax.first;
}
}
void
Execute()
{
+ VISU::TNames aGroupNames;
+ VISU::GaussMetric aGaussMetric = VISU::AVERAGE;
+ if(VISU::ScalarMap_i* aPrs3d = dynamic_cast<VISU::ScalarMap_i*>(myColoredPrs3d)) {
+ aGroupNames = aPrs3d->GetSpecificPL()->GetGeometryNames();
+ aGaussMetric = aPrs3d->GetGaussMetric();
+ }
+
VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
if ( aMinMaxController ) {
myResult = aMinMaxController->GetComponentMax( myCompID );
} else {
VISU::TMinMax aTMinMax;
if(myColoredPrs3d->GetScalarField()->myIsELNO)
- aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID );
+ aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID, aGroupNames, (VISU::TGaussMetric)aGaussMetric );
else
- aTMinMax = myColoredPrs3d->GetScalarField()->GetAverageMinMax( myCompID );
+ aTMinMax = myColoredPrs3d->GetScalarField()->GetAverageMinMax( myCompID, aGroupNames, (VISU::TGaussMetric)aGaussMetric );
myResult = aTMinMax.second;
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.hxx
// Author : Alexey PETROV
void
SetScaling(VISU::Scaling theScaling);
+ //----------------------------------------------------------------------------
+ virtual
+ void
+ SetLinkColor(const SALOMEDS::Color& theColor);
+
+ virtual
+ SALOMEDS::Color
+ GetLinkColor();
+
+ //----------------------------------------------------------------------------
+ virtual
+ VISU::GaussMetric
+ GetGaussMetric();
+
+ virtual
+ void
+ SetGaussMetric(VISU::GaussMetric theGaussMetric);
+
//----------------------------------------------------------------------------
//! Sets initial source geometry
virtual
private:
VISU_ScalarMapPL* myScalarMapPL;
+ SALOMEDS::Color myLinkColor;
bool myShowBar;
};
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.cxx
// Author : Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.hxx
// Author : Alexey PETROV
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VISU_TableDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#include "VISU_TableDlg.h"
+
+#include "VISU_Table_i.hh"
+
+#include "SUIT_Tools.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+
+#include "LightApp_Application.h"
+
+#include "CAM_Module.h"
+
+#include "SALOMEDSClient_Study.hxx"
+#include "SALOMEDSClient_GenericAttribute.hxx"
+#include "SALOMEDSClient_AttributeTableOfInteger.hxx"
+#include "SALOMEDSClient_AttributeTableOfReal.hxx"
+#include "SALOMEDSClient_StudyBuilder.hxx"
+
+#include <QLayout>
+#include <QTableWidget>
+#include <QTabWidget>
+#include <QList>
+#include <QInputDialog>
+#include <QLabel>
+#include <QIntValidator>
+#include <QDoubleValidator>
+#include <QKeyEvent>
+#include <QHeaderView>
+#include <QPushButton>
+#include <QLineEdit>
+#include <QCheckBox>
+#include <QComboBox>
+
+#include "utilities.h"
+
+const int MARGIN_SIZE = 11;
+const int SPACING_SIZE = 6;
+const int MIN_TABLE_WIDTH = 200;
+const int MIN_TABLE_HEIGHT = 200;
+
+NumDelegateItem::NumDelegateItem( QObject* parent, NumValidator mode )
+ : QItemDelegate( parent ),
+ myMode( mode )
+{
+}
+
+NumDelegateItem::~NumDelegateItem()
+{
+}
+
+QWidget* NumDelegateItem::createEditor( QWidget* parent,
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index ) const
+{
+ QLineEdit* editor = new QLineEdit( parent );
+ switch ( myMode )
+ {
+ case NV_Int:
+ editor->setValidator( new QIntValidator( editor ) );
+ break;
+ case NV_Real:
+ editor->setValidator( new QDoubleValidator( editor ) );
+ break;
+ default:
+ break;
+ }
+ return editor;
+}
+
+void NumDelegateItem::setEditorData( QWidget* editor,
+ const QModelIndex& index ) const
+{
+ QLineEdit* aLE = qobject_cast<QLineEdit*>( editor );
+ if ( !aLE )
+ return;
+
+ switch ( myMode )
+ {
+ case NV_Int:
+ {
+ int value = index.model()->data( index, Qt::DisplayRole ).toInt();
+ aLE->setText( QString("%1").arg( value ) );
+ break;
+ }
+ case NV_Real:
+ {
+ double value = index.model()->data(index, Qt::DisplayRole).toDouble();
+ aLE->setText( QString("%1").arg( value ) );
+ break;
+ }
+ default:
+ aLE->setText( index.model()->data( index, Qt::DisplayRole ).toString() );
+ break;
+ }
+}
+
+class VISU_TableDlg::WidgetCointainer : public QWidget
+{
+public:
+ WidgetCointainer( QWidget* parent, Qt::Orientation o, int lm, int tm, int rm, int bm, int s )
+ : QWidget( parent )
+ {
+ QLayout* l = o == Qt::Horizontal ? (QLayout*)( new QHBoxLayout( this ) ) : ( QLayout* )( new QVBoxLayout( this ) );
+ l->setContentsMargins( lm, tm, rm, bm );
+ l->setSpacing( s );
+ setLayout( l );
+ }
+ void addWidget( QWidget* w )
+ {
+ if ( w ) {
+ QHBoxLayout* hl = qobject_cast<QHBoxLayout*>( layout() );
+ QVBoxLayout* wl = qobject_cast<QVBoxLayout*>( layout() );
+ if ( hl ) hl->addWidget( w );
+ else if ( wl ) wl->addWidget( w );
+ }
+ }
+ void addSpacing( int s )
+ {
+ if ( s > 0 ) {
+ QHBoxLayout* hl = qobject_cast<QHBoxLayout*>( layout() );
+ QVBoxLayout* wl = qobject_cast<QVBoxLayout*>( layout() );
+ if ( hl ) hl->addSpacing( s );
+ else if ( wl ) wl->addSpacing( s );
+ }
+ }
+ void addStretch( int s )
+ {
+ if ( s >= 0 ) {
+ QHBoxLayout* hl = qobject_cast<QHBoxLayout*>( layout() );
+ QVBoxLayout* wl = qobject_cast<QVBoxLayout*>( layout() );
+ if ( hl ) hl->addStretch( s );
+ else if ( wl ) wl->addStretch( s );
+ }
+ }
+};
+
+/*class VISU_Table : public QTableWidget {
+public:
+ VISU_Table( Orientation orient, QWidget* parent = 0 )
+ : QTableWidget( parent ), myValidator( 0 ), myOrientation( orient ) {}
+ VISU_Table( Orientation orient, int numRows, int numCols, QWidget* parent = 0 )
+ : QTableWidget( numRows, numCols, parent ), myValidator( 0 ), myOrientation( orient ) {}
+
+ void setValidator( QValidator* v = 0 ) { myValidator = v; }
+ bool isEditing() const { return QTable::isEditing(); }
+
+protected:
+ QWidget* createEditor ( int row, int col, bool initFromCell ) const
+ {
+ bool testUnits = ( myOrientation == Qt::Horizontal && col == 0 ) || ( myOrientation == Qt::Vertical && row == 0 );
+ QWidget* wg = QTable::createEditor( row, col, initFromCell );
+ if ( wg && wg->inherits("QLineEdit") && myValidator && !testUnits )
+ (( QLineEdit*)wg)->setValidator( myValidator );
+ return wg;
+ }
+
+protected:
+ QValidator* myValidator;
+ Orientation myOrientation;
+ };*/
+
+QString VISU_TableDlg::tableTitle( int type )
+{
+ QString tlt;
+ switch ( type ) {
+ case ttInt: tlt = tr( "TABLE_OF_INTEGER_TLT" ); break;
+ case ttReal: tlt = tr( "TABLE_OF_REAL_TLT" ); break;
+ default: tlt = tr( "TABLE_UNKNOWN_TLT" ); break;
+ }
+ return tlt;
+}
+/*!
+ Constructor
+*/
+VISU_TableDlg::VISU_TableDlg( QWidget* parent,
+ _PTR(Study) study,
+ VISU::Table_i* table,
+ bool allowEdition,
+ int which,
+ Qt::Orientation orient,
+ bool showColumnTitles )
+ : QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+ myStudy( study ), myTable( table ), myEditCheck( 0 ), myUpdateCheck( 0 )
+{
+ allowEdition = true; //////////////////////////////////
+ setWindowTitle( tr( "VIEW_TABLE_TLT" ) );
+ setSizeGripEnabled( true );
+
+ bool bHasIntTable = false;
+ bool bHasRealTable = false;
+ if ( myStudy && myTable ) {
+ _PTR(SObject) aSObject = myStudy->FindObjectID( myTable->GetObjectEntry() );
+ if ( aSObject ) {
+ _PTR(GenericAttribute) anAttr;
+ bHasIntTable = aSObject->FindAttribute( anAttr, "AttributeTableOfInteger" );
+ bHasRealTable = aSObject->FindAttribute( anAttr, "AttributeTableOfReal" );
+ }
+ }
+
+ if ( allowEdition ) {
+ myEditCheck = new QCheckBox( tr( "ALLOW_EDIT_CHECK" ), this );
+ myUpdateCheck = new QCheckBox( tr( "DO_UPDATE_CHECK" ), this );
+ connect( myEditCheck, SIGNAL( toggled( bool ) ), myUpdateCheck, SLOT( setEnabled( bool ) ) );
+ myUpdateCheck->setEnabled( false );
+ myUpdateCheck->hide(); // the feature has been temporarily disabled
+ }
+
+ QWidget* top = 0;
+
+ if ( which == ttInt || which == ttAll || which == ttAuto && bHasIntTable ) {
+ myTableMap[ ttInt ] = new TableWidget( this, orient );
+ myTableMap[ ttInt ]->initialize( myStudy, myTable, ttInt );
+ myTableMap[ ttInt ]->setEditEnabled( false );
+ myTableMap[ ttInt ]->showColumnTitles( showColumnTitles );
+ if ( myEditCheck )
+ connect( myEditCheck, SIGNAL( toggled( bool ) ), myTableMap[ ttInt ], SLOT( setEditEnabled( bool ) ) );
+ }
+ if ( which == ttReal || which == ttAll || which == ttAuto && bHasRealTable ) {
+ myTableMap[ ttReal ] = new TableWidget( this, orient );
+ myTableMap[ ttReal ]->initialize( myStudy, myTable, ttReal );
+ myTableMap[ ttReal ]->setEditEnabled( false );
+ myTableMap[ ttReal ]->showColumnTitles( showColumnTitles );
+ if ( myEditCheck )
+ connect( myEditCheck, SIGNAL( toggled( bool ) ), myTableMap[ ttReal ], SLOT( setEditEnabled( bool ) ) );
+ }
+
+ if ( myTableMap.count() > 1 ) {
+ QTabWidget* tw = new QTabWidget( this );
+ for ( int i = ttInt; i < ttAll; i++ ) {
+ if ( myTableMap.contains( i ) ) {
+ tw->addTab( myTableMap[ i ], tableTitle( i ) );
+ myTableMap[ i ]->layout()->setMargin( MARGIN_SIZE );
+ }
+ }
+ top = tw;
+ }
+ else if ( myTableMap.count() == 1 ) {
+ top = myTableMap[myTableMap.keys().first()];
+ }
+ else {
+ QLabel* dumbLabel = new QLabel( tr( "ERR_TABLE_NOT_AVAILABLE" ), this );
+ dumbLabel->setAlignment( Qt::AlignCenter );
+ top = dumbLabel;
+ }
+
+ myOKBtn = new QPushButton( tr( "BUT_OK" ), this );
+ myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this );
+
+ QHBoxLayout* btnLayout = new QHBoxLayout;
+ btnLayout->setMargin( 0 );
+ btnLayout->setSpacing( SPACING_SIZE );
+
+ btnLayout->addWidget( myOKBtn );
+ btnLayout->addStretch( 20 );
+ btnLayout->addWidget( myHelpBtn );
+ connect( myOKBtn, SIGNAL( clicked() ), this, SLOT( close() ) );
+ connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( help() ) );
+
+ QVBoxLayout* mainLayout = new QVBoxLayout( this );
+ mainLayout->setMargin( MARGIN_SIZE );
+ mainLayout->setSpacing( SPACING_SIZE );
+
+ if ( myEditCheck ) {
+ QHBoxLayout* checkLayout = new QHBoxLayout;
+ checkLayout->setMargin( 0 );
+ checkLayout->setSpacing( SPACING_SIZE );
+ checkLayout->addWidget( myEditCheck );
+ checkLayout->addWidget( myUpdateCheck );
+ mainLayout->addLayout( checkLayout );
+
+ if ( LightApp_Application* app = ( LightApp_Application* )SUIT_Session::session()->activeApplication() ) {
+ int anEnableEditing = app->resourceMgr()->booleanValue( "VISU", "tables_enable_editing", false );
+ myEditCheck->setChecked( anEnableEditing );
+ }
+ }
+ mainLayout->addWidget( top );
+ mainLayout->addLayout( btnLayout );
+
+ resize( 500, 400 );
+ SUIT_Tools::centerWidget( this, parent );
+}
+
+/*!
+ Destructor
+*/
+VISU_TableDlg::~VISU_TableDlg()
+{
+}
+
+/*!
+ <OK> button slot, saves table(s)
+ Called only in create/edit mode ( <edit> parameter for constructor is true )
+*/
+/*
+void VISU_TableDlg::onOK()
+{
+ myOKBtn->setFocus(); // accept possible changes
+ bool done = true;
+
+ if ( myObject ) {
+ _PTR(Study) study = myObject->GetStudy();
+ _PTR(AttributeTableOfInteger) tblIntAttr;
+ _PTR(AttributeTableOfReal) tblRealAttr;
+
+ if ( study ) {
+ _PTR(StudyBuilder) builder = study->NewBuilder();
+ builder->NewCommand(); // start transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ try {
+ if ( myTableMap.contains( ttInt ) ) {
+ builder->RemoveAttribute( myObject, "AttributeTableOfInteger" );
+ tblIntAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfInteger" );
+
+ int i;
+ int nbRows = myTableMap[ ttInt ]->getNumRows();
+ int nbCols = myTableMap[ ttInt ]->getNumCols();
+ QString tlt = myTableMap[ ttInt ]->getTableTitle();
+ QStringList rowTitles, colTitles, units;
+ myTableMap[ ttInt ]->getRowTitles( rowTitles );
+ myTableMap[ ttInt ]->getColTitles( colTitles );
+ myTableMap[ ttInt ]->getUnits( units );
+
+ if ( nbRows > 0) {
+ // data
+ int nRow = 0;
+ tblIntAttr->SetNbColumns( nbCols );
+ for ( i = 0; i < nbRows; i++ ) {
+ QStringList data;
+ myTableMap[ ttInt ]->getRowData( i, data );
+ bool bEmptyRow = true;
+ for ( int j = 0; j < data.count(); j++ ) {
+ if ( !data[ j ].isNull() ) {
+ tblIntAttr->PutValue( data[ j ].toInt(), nRow+1, j+1 );
+ bEmptyRow = false;
+ }
+ }
+ if ( !bEmptyRow ) { // Skip rows with no data !!!
+ // set row title
+ tblIntAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() );
+ // set row unit
+ tblIntAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() );
+ nRow++;
+ }
+ }
+ if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!!
+ // column titles
+ for ( i = 0; i < colTitles.count(); i++ )
+ tblIntAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() );
+ }
+ }
+ // title
+ tblIntAttr->SetTitle( (const char*)myTableMap[ ttInt ]->getTableTitle().toLatin1() );
+ }
+ if ( myTableMap.contains( ttReal ) ) {
+ builder->RemoveAttribute( myObject, "AttributeTableOfReal" );
+ tblRealAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfReal" );
+
+ int i;
+ int nbRows = myTableMap[ ttReal ]->getNumRows();
+ int nbCols = myTableMap[ ttReal ]->getNumCols();
+ QString tlt = myTableMap[ ttReal ]->getTableTitle();
+ QStringList rowTitles, colTitles, units;
+ myTableMap[ ttReal ]->getRowTitles( rowTitles );
+ myTableMap[ ttReal ]->getColTitles( colTitles );
+ myTableMap[ ttReal ]->getUnits( units );
+
+ if ( nbRows > 0) {
+ // data
+ int nRow = 0;
+ tblRealAttr->SetNbColumns( nbCols );
+ for ( i = 0; i < nbRows; i++ ) {
+ QStringList data;
+ myTableMap[ ttReal ]->getRowData( i, data );
+ bool bEmptyRow = true;
+ for ( int j = 0; j < data.count(); j++ ) {
+ if ( !data[ j ].isNull() ) {
+ tblRealAttr->PutValue( data[ j ].toDouble(), nRow+1, j+1 );
+ bEmptyRow = false;
+ }
+ }
+ if ( !bEmptyRow ) { // Skip rows with no data !!!
+ // set row title
+ tblRealAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() );
+ // set row unit
+ tblRealAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() );
+ nRow++;
+ }
+ }
+ if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!!
+ // column titles
+ for ( i = 0; i < colTitles.count(); i++ )
+ tblRealAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() );
+ }
+ }
+ // title
+ tblRealAttr->SetTitle( (const char*)myTableMap[ ttReal ]->getTableTitle().toLatin1() );
+ }
+ if ( myTableMap.contains( ttInt ) || myTableMap.contains( ttReal ) )
+ builder->CommitCommand(); // commit transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!
+ else
+ builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!
+ }
+ catch( ... ) {
+ MESSAGE("VISU_TableDlg::onOK : Exception has been caught !!!");
+ builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!
+ done = false;
+ SUIT_MessageBox::critical ( this, tr("ERR_ERROR"), tr("ERR_APP_EXCEPTION") );
+ }
+ }
+ }
+ if ( done )
+ accept();
+}
+*/
+
+/*!
+ <Help> button slot, shows corresponding help page
+*/
+void VISU_TableDlg::help()
+{
+ QString aHelpFileName = "table_presentations_page.html";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
+ else {
+ QString platform;
+#ifdef WIN32
+ platform = "winapplication";
+#else
+ platform = "application";
+#endif
+ SUIT_MessageBox::warning( this,
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
+ }
+}
+
+/*!
+ Provides help on F1 button click
+*/
+void VISU_TableDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ help();
+ }
+}
+
+/*!
+ Constructor
+*/
+VISU_TableDlg::TableWidget::TableWidget( QWidget* parent,
+ Qt::Orientation orientation )
+ : QWidget( parent ), myOrientation( orientation )
+{
+ myTitleEdit = new QLineEdit( this );
+
+ myTable = new QTableWidget( 5, 5, this );
+ myTable->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
+ myTable->setMinimumSize( MIN_TABLE_WIDTH, MIN_TABLE_HEIGHT );
+ myTable->setSelectionMode( QAbstractItemView::SingleSelection );
+ myTable->setShowGrid( true );
+ myTable->horizontalHeader()->setMovable( false );
+ myTable->verticalHeader()->setMovable( false );
+ myTable->setDragEnabled( false );
+
+ myAdjustBtn = new QPushButton( VISU_TableDlg::tr( "ADJUST_CELLS_BTN" ), this );
+ myAddRowBtn = new QPushButton( VISU_TableDlg::tr( "ADD_ROW_BTN" ), this );
+ myDelRowBtn = new QPushButton( VISU_TableDlg::tr( "REMOVE_ROW_BTN" ), this );
+ myAddColBtn = new QPushButton( VISU_TableDlg::tr( "ADD_COLUMN_BTN" ), this );
+ myDelColBtn = new QPushButton( VISU_TableDlg::tr( "REMOVE_COLUMN_BTN" ), this );
+ mySelectAllBtn = new QPushButton( VISU_TableDlg::tr( "SELECT_ALL_BTN" ), this );
+ myClearBtn = new QPushButton( VISU_TableDlg::tr( "CLEAR_BTN" ), this );
+
+ mySortPolicyLabel = new QLabel( VISU_TableDlg::tr( "VISU_TABLES_SORT_POLICY" ), this );
+ mySortPolicyCombo = new QComboBox( this );
+ mySortPolicyCombo->insertItems( 0, QStringList() <<
+ VISU_TableDlg::tr( "VISU_TABLES_EMPTY_LOWEST" ) <<
+ VISU_TableDlg::tr( "VISU_TABLES_EMPTY_HIGHEST" ) <<
+ VISU_TableDlg::tr( "VISU_TABLES_EMPTY_FIRST" ) <<
+ VISU_TableDlg::tr( "VISU_TABLES_EMPTY_LAST" ) <<
+ VISU_TableDlg::tr( "VISU_TABLES_EMPTY_IGNORE" ) );
+
+ if ( LightApp_Application* app = ( LightApp_Application* )SUIT_Session::session()->activeApplication() ) {
+ int aSortPolicy = app->resourceMgr()->integerValue( "VISU", "tables_sort_policy", 3 );
+ mySortPolicyCombo->setCurrentIndex( aSortPolicy );
+ }
+
+ // the features has been temporarily disabled
+ myAddRowBtn->hide();
+ myDelRowBtn->hide();
+ myAddColBtn->hide();
+ myDelColBtn->hide();
+ mySelectAllBtn->hide();
+ myClearBtn->hide();
+
+ QVBoxLayout* btnLayout = new QVBoxLayout;
+ btnLayout->setMargin( 0 );
+ btnLayout->setSpacing( SPACING_SIZE );
+ btnLayout->addWidget( myAdjustBtn );
+ btnLayout->addStretch( 20 );
+ btnLayout->addWidget( myAddRowBtn );
+ btnLayout->addWidget( myDelRowBtn );
+ btnLayout->addWidget( myAddColBtn );
+ btnLayout->addWidget( myDelColBtn );
+ btnLayout->addStretch( 20 );
+ btnLayout->addWidget( mySelectAllBtn );
+ btnLayout->addWidget( myClearBtn );
+
+ QHBoxLayout* sortLayout = new QHBoxLayout;
+ sortLayout->setMargin( 0 );
+ sortLayout->setSpacing( SPACING_SIZE );
+ sortLayout->addWidget( mySortPolicyLabel );
+ sortLayout->addWidget( mySortPolicyCombo );
+ sortLayout->addStretch( 1 );
+
+ QGridLayout* mainLayout = new QGridLayout( this );
+ mainLayout->setMargin( 0 );
+ mainLayout->setSpacing( SPACING_SIZE );
+ mainLayout->addWidget( myTitleEdit, 0, 0, 1, 2 );
+ mainLayout->addWidget( myTable, 1, 0 );
+ mainLayout->addLayout( btnLayout, 1, 1 );
+ mainLayout->addLayout( sortLayout, 2, 0, 1, 2 );
+
+ connect( myTable, SIGNAL( itemSelectionChanged() ),
+ this, SLOT( updateButtonsState() ) );
+ connect( myTable, SIGNAL( currentItemChanged( QTableWidgetItem*, QTableWidgetItem* ) ),
+ this, SLOT( updateButtonsState() ) );
+ connect( myAddRowBtn, SIGNAL( clicked() ), this, SLOT( addRow() ) );
+ connect( myAddColBtn, SIGNAL( clicked() ), this, SLOT( addCol() ) );
+ connect( myDelRowBtn, SIGNAL( clicked() ), this, SLOT( delRow() ) );
+ connect( myDelColBtn, SIGNAL( clicked() ), this, SLOT( delCol() ) );
+ connect( myAdjustBtn, SIGNAL( clicked() ), this, SLOT( adjustTable() ) );
+ connect( mySelectAllBtn, SIGNAL( clicked() ), this, SLOT( selectAll() ) );
+ connect( myClearBtn, SIGNAL( clicked() ), this, SLOT( clearTable() ) );
+ connect( myTable->horizontalHeader(), SIGNAL( sectionClicked( int ) ),
+ this, SLOT( columnClicked( int ) ) );
+ connect( myTable->verticalHeader(), SIGNAL( sectionClicked( int ) ),
+ this, SLOT( rowClicked( int ) ) );
+ myTable->horizontalHeader()->installEventFilter( this );
+ myTable->verticalHeader()->installEventFilter( this );
+ myTable->installEventFilter( this );
+
+ updateButtonsState();
+}
+
+/*!
+ Destructor
+*/
+VISU_TableDlg::TableWidget::~TableWidget()
+{
+}
+
+/*!
+ Initialize widget
+*/
+void VISU_TableDlg::TableWidget::initialize( _PTR(Study) study, VISU::Table_i* table, int type )
+{
+ myStudy = study;
+ myTableObj = table;
+ myType = type;
+
+ setUnitsTitle( VISU_TableDlg::tr( "UNITS_TLT" ) );
+ setEditEnabled( false );
+ showColumnTitles( false );
+
+ updateTableFromServant( true );
+ updateButtonsState();
+}
+
+void VISU_TableDlg::TableWidget::updateTableFromServant( bool adjust )
+{
+ _PTR(SObject) aSObject = myStudy->FindObjectID( myTableObj->GetObjectEntry() );
+ if ( aSObject ) {
+ int i, j;
+ switch ( myType ) {
+ case ttInt:
+ myTable->setItemDelegate( new NumDelegateItem( this, NumDelegateItem::NV_Int ) );
+ if ( aSObject->FindAttribute( myAttr, "AttributeTableOfInteger" ) ) {
+ _PTR(AttributeTableOfInteger) intAttr = myAttr;
+ try {
+ // title
+ setTableTitle( intAttr->GetTitle().c_str() );
+ // nb of rows & cols
+ int nbRows = intAttr->GetNbRows() ;
+ int nbCols = intAttr->GetNbColumns();
+ setNumRows( nbRows );
+ setNumCols( nbCols );
+ // rows titles
+ QStringList strlist;
+ std::vector<std::string> titles = intAttr->GetRowTitles();
+ for ( i = 0; i < nbRows; i++ ) {
+ if ( titles.size() > 0 )
+ strlist.append( titles[i].c_str() );
+ else
+ strlist.append( "" );
+ }
+ setRowTitles( strlist );
+ // columns titles
+ strlist.clear();
+ titles = intAttr->GetColumnTitles();
+ for ( i = 0; i < nbCols; i++ ) {
+ if ( titles.size() > 0 )
+ strlist.append( titles[i].c_str() );
+ else
+ strlist.append( "" );
+ }
+ setColTitles( strlist );
+ // units
+ strlist.clear();
+ titles = intAttr->GetRowUnits();
+ if ( titles.size() > 0 ) {
+ for ( i = 0; i < nbRows; i++ )
+ strlist.append( titles[i].c_str() );
+ setUnits( strlist );
+ }
+ // data
+ for ( i = 1; i <= nbRows; i++ ) {
+ strlist.clear();
+ for ( j = 1; j <= nbCols; j++ ) {
+ if ( intAttr->HasValue( i, j ) )
+ strlist.append( QString::number( intAttr->GetValue( i, j ) ) );
+ else
+ strlist.append( QString::null );
+ }
+ setRowData( i-1, strlist );
+ }
+ if ( adjust ) adjustTable();
+ }
+ catch( ... ) {
+ MESSAGE("VISU_TableDlg::TableWidget::initialize : Exception has been caught !!!");
+ }
+ }
+ break;
+ case ttReal:
+ myTable->setItemDelegate( new NumDelegateItem( this, NumDelegateItem::NV_Real ) );
+ if ( aSObject->FindAttribute( myAttr, "AttributeTableOfReal" ) ) {
+ _PTR(AttributeTableOfReal) realAttr = myAttr;
+ try {
+ // title
+ setTableTitle( realAttr->GetTitle().c_str() );
+ // nb of rows & cols
+ int nbRows = realAttr->GetNbRows() ;
+ int nbCols = realAttr->GetNbColumns();
+ setNumRows( nbRows );
+ setNumCols( nbCols );
+ // rows titles
+ QStringList strlist;
+ std::vector<std::string> titles = realAttr->GetRowTitles();
+ for ( i = 0; i < nbRows; i++ ) {
+ if ( titles.size() > 0 )
+ strlist.append( titles[i].c_str() );
+ else
+ strlist.append( "" );
+ }
+ setRowTitles( strlist );
+ // columns titles
+ strlist.clear();
+ titles = realAttr->GetColumnTitles();
+ for ( i = 0; i < nbCols; i++ ) {
+ if ( titles.size() > 0 )
+ strlist.append( titles[i].c_str() );
+ else
+ strlist.append( "" );
+ }
+ setColTitles( strlist );
+ // units
+ strlist.clear();
+ titles = realAttr->GetRowUnits();
+ if ( titles.size() > 0 ) {
+ for ( i = 0; i < nbRows; i++ )
+ strlist.append( titles[i].c_str() );
+ setUnits( strlist );
+ }
+ // data
+ for ( i = 1; i <= nbRows; i++ ) {
+ strlist.clear();
+ for ( j = 1; j <= nbCols; j++ ) {
+ if ( realAttr->HasValue( i, j ) )
+ strlist.append( QString::number( realAttr->GetValue( i, j ) ) );
+ else
+ strlist.append( QString::null );
+ }
+ setRowData( i-1, strlist );
+ }
+ if ( adjust ) adjustTable();
+ }
+ catch( ... ) {
+ MESSAGE("VISU_TableDlg::TableWidget::initialize : Exception has been caught !!!");
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+/*!
+ Enable / disable editing
+*/
+void VISU_TableDlg::TableWidget::setEditEnabled( bool enable )
+{
+ if( !enable ) {
+ myTable->horizontalHeader()->setSortIndicatorShown( false );
+ myTable->verticalHeader()->setSortIndicatorShown( false );
+ //adjustTable();
+ }
+
+ mySortPolicyLabel->setEnabled( enable );
+ mySortPolicyCombo->setEnabled( enable );
+
+ // the rest features have been temporarily disabled
+ enable = false;
+
+ myTitleEdit->setReadOnly( !enable );
+ myTable->setEditTriggers( enable ?
+ QAbstractItemView::DoubleClicked |
+ QAbstractItemView::SelectedClicked |
+ QAbstractItemView::EditKeyPressed :
+ QAbstractItemView::NoEditTriggers );
+ myAddRowBtn->setVisible( enable );
+ myDelRowBtn->setVisible( enable );
+ myAddColBtn->setVisible( enable );
+ myDelColBtn->setVisible( enable );
+ mySelectAllBtn->setVisible( enable );
+ myClearBtn->setVisible( enable );
+}
+
+/*!
+ Show / hide column titles
+*/
+void VISU_TableDlg::TableWidget::showColumnTitles( bool showTitles )
+{
+ if ( myOrientation == Qt::Horizontal )
+ myTable->horizontalHeader()->setVisible( showTitles );
+ else
+ myTable->verticalHeader()->setVisible( showTitles );
+}
+
+/*!
+ Sets table title
+*/
+void VISU_TableDlg::TableWidget::setTableTitle( const QString& title )
+{
+ myTitleEdit->setText( title );
+}
+
+/*!
+ Gets table title
+*/
+QString VISU_TableDlg::TableWidget::getTableTitle()
+{
+ return myTitleEdit->text();
+}
+
+/*!
+ Sets total number of rows
+*/
+void VISU_TableDlg::TableWidget::setNumRows( const int num )
+{
+ myOrientation == Qt::Horizontal ? myTable->setRowCount( num ) : myTable->setColumnCount( num );
+}
+
+/*!
+ Gets total number of rows
+*/
+int VISU_TableDlg::TableWidget::getNumRows()
+{
+ return myOrientation == Qt::Horizontal ? myTable->rowCount() : myTable->columnCount();
+}
+
+/*!
+ Sets total number of columns
+*/
+void VISU_TableDlg::TableWidget::setNumCols( const int num )
+{
+ // !!! first column contains units !!!
+ myOrientation == Qt::Horizontal ? myTable->setColumnCount( num+1 ) : myTable->setRowCount( num+1 );
+// myOrientation == Qt::Horizontal ? myTable->setColumnReadOnly( 0, true ) : myTable->setRowReadOnly( 0, true );
+}
+
+/*!
+ Gets total number of columns
+*/
+int VISU_TableDlg::TableWidget::getNumCols()
+{
+ // !!! first column contains units !!!
+ return myOrientation == Qt::Horizontal ? myTable->columnCount()-1 : myTable->rowCount()-1;
+}
+/*!
+ Sets rows titles
+*/
+void VISU_TableDlg::TableWidget::setRowTitles( QStringList& tlts )
+{
+ QStringList aLabels;
+ for ( int i = 0; i < tlts.count(); i++ )
+ tlts[i].isNull() ? aLabels.append("") : aLabels.append( tlts[i] );
+
+ myOrientation == Qt::Horizontal ?
+ myTable->setVerticalHeaderLabels( aLabels ) :
+ myTable->setHorizontalHeaderLabels( aLabels );
+
+ // myTable->verticalHeader()->setLabel( i, tlts[i] ) :
+ //myTable->horizontalHeader()->setLabel( i, tlts[i] );
+ //}
+}
+/*!
+ Gets rows titles
+*/
+void VISU_TableDlg::TableWidget::getRowTitles( QStringList& tlts )
+{
+ tlts.clear();
+ if ( myOrientation == Qt::Horizontal ) {
+ for ( int i = 0; i < myTable->rowCount(); i++ ) {
+ tlts.append( myTable->verticalHeaderItem(i) ? myTable->verticalHeaderItem(i)->text() : "" );
+ }
+ }
+ else {
+ for ( int i = 0; i < myTable->columnCount(); i++ ) {
+ tlts.append( myTable->horizontalHeaderItem(i) ? myTable->horizontalHeaderItem(i)->text() : "" );
+ }
+ }
+}
+/*!
+ Sets columns titles
+*/
+void VISU_TableDlg::TableWidget::setColTitles( QStringList& tlts )
+{
+ QStringList aLabels;
+
+ // !!! first column contains units !!!
+ aLabels.append(""); // it'll be initialized below - in setUnitsTitle() method
+
+ for ( int i = 0; i < tlts.count(); i++ )
+ tlts[i].isNull() ? aLabels.append("") : aLabels.append( tlts[i] );
+
+ myOrientation == Qt::Horizontal ?
+ myTable->setHorizontalHeaderLabels( aLabels ) :
+ myTable->setVerticalHeaderLabels( aLabels );
+
+ setUnitsTitle( VISU_TableDlg::tr( "UNITS_TLT" ) );
+}
+/*!
+ Sets columns titles
+*/
+void VISU_TableDlg::TableWidget::getColTitles( QStringList& tlts )
+{
+ // !!! first column contains units !!!
+ tlts.clear();
+ if ( myOrientation == Qt::Horizontal ) {
+ for ( int i = 1; i < myTable->columnCount(); i++ ) {
+ tlts.append( myTable->horizontalHeaderItem(i) ? myTable->horizontalHeaderItem(i)->text() : "" );
+ }
+ }
+ else {
+ for ( int i = 1; i < myTable->rowCount(); i++ ) {
+ tlts.append( myTable->verticalHeaderItem(i) ? myTable->verticalHeaderItem(i)->text() : "" );
+ }
+ }
+}
+/*!
+ Sets units title
+*/
+void VISU_TableDlg::TableWidget::setUnitsTitle( const QString& tlt ) {
+ // !!! first column contains units !!!
+ myTable->model()->setHeaderData( 0, myOrientation, QVariant(tlt.isNull() ? "" : tlt), Qt::DisplayRole );
+}
+/*!
+ Sets units
+*/
+void VISU_TableDlg::TableWidget::setUnits( QStringList& units )
+{
+ QAbstractTableModel* aModel = qobject_cast<QAbstractTableModel*>( myTable->model() );
+ if ( aModel )
+ {
+ QModelIndex anIndex;
+ for ( int i = 0; i < units.count(); i++ )
+ {
+ myOrientation == Qt::Horizontal ?
+ anIndex = aModel->index( i, 0 ) :
+ anIndex = aModel->index( 0, i );
+
+ aModel->setData( anIndex, QVariant( units[i].isNull() ? "" : units[i] ) );
+ }
+ }
+}
+/*!
+ Gets units
+*/
+void VISU_TableDlg::TableWidget::getUnits( QStringList& units )
+{
+ units.clear();
+ QAbstractTableModel* aModel = qobject_cast<QAbstractTableModel*>( myTable->model() );
+ if ( aModel )
+ {
+ if ( myOrientation == Qt::Horizontal )
+ {
+ for ( int i = 0; i < myTable->rowCount(); i++ )
+ units.append( aModel->index( i, 0 ).data().toString() );
+ }
+ else {
+ for ( int i = 0; i < myTable->columnCount(); i++ )
+ units.append( aModel->index( 0, i ).data().toString() );
+ }
+ }
+}
+/*!
+ Sets row data
+*/
+void VISU_TableDlg::TableWidget::setRowData( int row, QStringList& data )
+{
+ QAbstractTableModel* aModel = qobject_cast<QAbstractTableModel*>( myTable->model() );
+ if ( aModel )
+ {
+ QModelIndex anIndex;
+ if ( row >= 0 && row < getNumRows() ) {
+ for ( int i = 0; i < data.count(); i++ )
+ {
+ myOrientation == Qt::Horizontal ? anIndex = aModel->index( row, i+1 ) :
+ anIndex = aModel->index( i+1, row );
+ aModel->setData( anIndex, QVariant( data[i] ) );
+
+ }
+ }
+ }
+}
+/*!
+ Gets row data
+*/
+void VISU_TableDlg::TableWidget::getRowData( int row, QStringList& data )
+{
+ data.clear();
+ QAbstractTableModel* aModel = qobject_cast<QAbstractTableModel*>( myTable->model() );
+ if ( aModel )
+ {
+ if ( row >= 0 && row < getNumRows() )
+ {
+ if ( myOrientation == Qt::Horizontal )
+ {
+ for ( int i = 1; i < myTable->columnCount(); i++ )
+ data.append( aModel->index( row, i ).data().toString() );
+ }
+ else {
+ for ( int i = 1; i < myTable->rowCount(); i++ )
+ data.append( aModel->index( i, row ).data().toString() );
+ }
+ }
+ }
+}
+/*!
+ Adjusts table cell to see contents, <Adjust Cells> button slot
+*/
+void VISU_TableDlg::TableWidget::adjustTable()
+{
+ myTable->resizeRowsToContents();
+ myTable->resizeColumnsToContents();
+}
+/*!
+ Called when selection changed in table
+*/
+void VISU_TableDlg::TableWidget::updateButtonsState()
+{
+ if ( myTable->editTriggers() == QAbstractItemView::NoEditTriggers )
+ return;
+ bool bDR = false; // <Delete Row(s)>
+ bool bDC = false; // <Delete Column(s)>
+ bool bSA = false; // <Select All>
+ bool bCT = false; // <Clear>
+ int i;
+ //TO DO column/row selection check
+ /*int c = myOrientation == Qt::Horizontal ? 0 : 1;
+ for ( i = c; i < myTable->rowCount(); i++ ) {
+
+ if ( myTable->isRowSelected( i, true ) )
+ bDR = true;
+ else
+ bSA = true;
+ }
+ c = myOrientation == Qt::Horizontal ? 1 : 0;
+ for ( i = c; i < myTable->columnCount(); i++ ) {
+ if ( myTable->isColumnSelected( i, true ) )
+ bDC = true;
+ else
+ bSA = true;
+ }*/
+ /*int nbSel = myTable->numSelections();
+ for ( i = 0; i < nbSel; i++ ) {
+ QTableSelection ts = myTable->selection( i );
+ for ( int j = ts.topRow(); j < ts.bottomRow()+1; j++) {
+ for ( int k = ts.leftCol(); k < ts.rightCol()+1; k++) {
+ if ( myTable->item( j, k ) )
+ bCT = true;
+ }
+ }
+ }*/
+ QList<QTableWidgetItem*> aSelection = myTable->selectedItems();
+ QList<QTableWidgetItem*>::ConstIterator anIt = aSelection.constBegin(),
+ anEndIt = aSelection.constEnd();
+ for ( ; anIt != anEndIt; anIt++ )
+ {
+ if( *anIt )
+ {
+ bCT = true;
+ break;
+ }
+ }
+
+ if ( myTable->item( myTable->currentRow(), myTable->currentColumn() ) )
+ bCT = true;
+ myDelRowBtn->setEnabled( bDR );
+ myDelColBtn->setEnabled( bDC );
+ mySelectAllBtn->setEnabled( bSA );
+ myClearBtn->setEnabled( bCT );
+}
+/*!
+ <Add row> button slot
+*/
+void VISU_TableDlg::TableWidget::addRow()
+{
+ myTable->insertRow( myTable->rowCount() );
+ updateButtonsState();
+}
+/*!
+ <Add column> button slot
+*/
+void VISU_TableDlg::TableWidget::addCol()
+{
+ myTable->insertColumn( myTable->columnCount() );
+ updateButtonsState();
+}
+/*!
+ <Delete row(s)> button slot
+*/
+void VISU_TableDlg::TableWidget::delRow()
+{
+ //TODO
+ /*int c = myOrientation == Qt::Horizontal ? 0 : 1;
+ QList<int> il;
+ int i;
+ for ( i = c; i < myTable->rowCount(); i++ )
+ if ( myTable->isRowSelected( i, true ) )
+ il.append( i );
+ if ( il.count() > 0 ) {
+ QMemArray<int> ildel( il.count() );
+ for ( i = 0; i < il.count(); i++ )
+ ildel[ i ] = il[ i ];
+ myTable->removeRows( ildel );
+ }*/
+
+ updateButtonsState();
+}
+/*!
+ <Delete column(s)> button slot
+*/
+void VISU_TableDlg::TableWidget::delCol()
+{
+ //TODO
+ /*int c = myOrientation == Qt::Horizontal ? 1 : 0;
+ QValueList<int> il;
+ int i;
+ for ( i = c; i < myTable->numCols(); i++ )
+ if ( myTable->isColumnSelected( i, true ) )
+ il.append( i );
+ if ( il.count() > 0 ) {
+ QMemArray<int> ildel( il.count() );
+ for ( i = 0; i < il.count(); i++ )
+ ildel[ i ] = il[ i ];
+ myTable->removeColumns( ildel );
+ }*/
+ updateButtonsState();
+}
+/*!
+ <Select All> button slot
+*/
+void VISU_TableDlg::TableWidget::selectAll()
+{
+ /*myTable->clearSelection();
+ QTableSelection ts;
+ ts.init( 0, 0 ); ts.expandTo( myTable->numRows()-1, myTable->numCols()-1 );
+ myTable->addSelection( ts );*/
+ myTable->selectAll();
+ updateButtonsState();
+}
+/*!
+ <Clear> button slot
+*/
+void VISU_TableDlg::TableWidget::clearTable()
+{
+ /*int nbSel = myTable->numSelections();
+ for ( int i = 0; i < nbSel; i++ ) {
+ QTableSelection ts = myTable->selection( i );
+ for ( int j = ts.topRow(); j < ts.bottomRow()+1; j++) {
+ if ( myOrientation == Qt::Vertical && j == 0 ) {
+// continue; // UNITS
+ }
+ for ( int k = ts.leftCol(); k < ts.rightCol()+1; k++) {
+ if ( myOrientation == Qt::Horizontal && k == 0 ) {
+// continue; // UNITS
+ }
+ myTable->clearCell( j, k );
+ }
+ }
+ }
+ if ( nbSel == 0 )
+ myTable->clearCell( myTable->currentRow(), myTable->currentColumn() );
+ myTable->clearSelection();*/
+ myTable->clearContents();
+ updateButtonsState();
+}
+/*!
+ Column clicked slot
+*/
+void VISU_TableDlg::TableWidget::columnClicked( int column )
+{
+ if ( myTableObj && mySortPolicyCombo->isEnabled() ) {
+ myTableObj->SortByRow( column + 1,
+ ( VISU::SortOrder )myTable->horizontalHeader()->sortIndicatorOrder(),
+ ( VISU::SortPolicy )mySortPolicyCombo->currentIndex() );
+ myTable->horizontalHeader()->setSortIndicatorShown( true );
+ myTable->verticalHeader()->setSortIndicatorShown( false );
+ updateTableFromServant( false );
+ }
+}
+/*!
+ Row clicked slot
+*/
+void VISU_TableDlg::TableWidget::rowClicked( int row )
+{
+ /* the feature has been temporarily disabled
+ if ( myTableObj && mySortPolicyCombo->isEnabled() && row > 0 ) { // first row contains units
+ myTableObj->SortByColumn( row,
+ ( VISU::SortOrder )myTable->verticalHeader()->sortIndicatorOrder(),
+ ( VISU::SortPolicy )mySortPolicyCombo->currentIndex() );
+ myTable->horizontalHeader()->setSortIndicatorShown( false );
+ myTable->verticalHeader()->setSortIndicatorShown( true );
+ updateTableFromServant( false );
+ }
+ */
+}
+/*!
+ Event filter - handles titles editing
+*/
+bool VISU_TableDlg::TableWidget::eventFilter( QObject* o, QEvent* e )
+{
+ if ( e->type() == QEvent::MouseButtonDblClick) {
+ //TODO
+ /*QMouseEvent* me = ( QMouseEvent* )e;
+ if ( me->button() == Qt::LeftButton && (myTable->editTriggers() != QAbstractItemView::NoEditTriggers ) ) {
+ if ( o == myTable->horizontalHeader() ) {
+ for ( int i = 0; i < myTable->horizontalHeader()->count(); i++ ) {
+ QRect rect = myTable->horizontalHeader()->sectionRect( i );
+ rect.addCoords( 1, 1, -1, -1 );
+ if ( rect.contains( myTable->horizontalHeader()->mapFromGlobal( me->globalPos() ) ) ) {
+ if ( myOrientation == Qt::Vertical || i != 0 ) {
+ bool bOk;
+ QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ),
+ tr( "TITLE_LBL" ),
+ QLineEdit::Normal,
+ myTable->horizontalHeader()->label( i ),
+ &bOk,
+ this );
+ if ( bOk && !tlt.isNull() )
+ myTable->horizontalHeader()->setLabel( i, tlt );
+ break;
+ }
+ }
+ }
+ }
+ if ( o == myTable->verticalHeader() ) {
+ for ( int i = 0; i < myTable->verticalHeader()->count(); i++ ) {
+ QRect rect = myTable->verticalHeader()->sectionRect( i );
+ rect.addCoords( 1, 1, -1, -1 );
+ if ( rect.contains( myTable->verticalHeader()->mapFromGlobal( me->globalPos() ) ) ) {
+ if ( myOrientation == Qt::Horizontal || i != 0 ) {
+ bool bOk;
+ QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ),
+ tr( "TITLE_LBL" ),
+ QLineEdit::Normal,
+ myTable->verticalHeader()->label( i ),
+ &bOk,
+ this );
+ if ( bOk && !tlt.isNull() )
+ myTable->verticalHeader()->setLabel( i, tlt );
+ break;
+ }
+ }
+ }
+ }
+ }*/
+ }
+ else if ( e->type() == QEvent::KeyRelease && o == myTable ) {
+ QKeyEvent* ke = (QKeyEvent*)e;
+ if ( ke->key() == Qt::Key_Delete && (myTable->editTriggers() != QAbstractItemView::NoEditTriggers) ) {
+ clearTable();
+ }
+ else if ( ke->key() == Qt::Key_Backspace && (myTable->editTriggers() != QAbstractItemView::NoEditTriggers) ) {
+ clearTable();
+ int i = myTable->currentRow();
+ int j = myTable->currentColumn() - 1;
+ if ( j < 0 ) { j = myTable->columnCount()-1; i--; }
+ if ( i >= 0 && j >= 0 )
+ myTable->setCurrentCell( i, j );
+ }
+ }
+ return QWidget::eventFilter( o, e );
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VISU_TableDlg.h
+// Author : Vadim SANDLER
+// Module : VISU
+//
+#ifndef VISU_TABLEDLG_H
+#define VISU_TABLEDLG_H
+
+#include "VISU_I.hxx"
+
+#include <SALOMEDSClient_Study.hxx>
+
+#include <QDialog>
+#include <QItemDelegate>
+#include <QMap>
+
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QCheckBox;
+class QComboBox;
+class QTableWidget;
+
+namespace VISU
+{
+ class Table_i;
+}
+
+class VISU_I_EXPORT VISU_TableDlg : public QDialog
+{
+ Q_OBJECT
+
+ class TableWidget;
+ class WidgetCointainer;
+
+ enum { tcTitle, tcTable, tcControls, tcButtons };
+
+public:
+
+ enum { ttNone, ttInt, ttReal, ttAll, ttAuto };
+ enum { teNone = 0x00,
+ teAddRemove = 0x01,
+ teEditData = 0x02,
+ teRowColumn = 0x04,
+ teAll = teAddRemove | teEditData | teRowColumn
+ };
+
+ VISU_TableDlg( QWidget* parent,
+ _PTR(Study) study,
+ VISU::Table_i* table,
+ bool allowEdition = false,
+ int which = ttAuto,
+ Qt::Orientation orient = Qt::Horizontal,
+ bool showColumnTitles = true );
+ ~VISU_TableDlg();
+
+protected:
+ void keyPressEvent( QKeyEvent* e );
+
+private slots:
+ void help();
+
+private:
+ QString tableTitle( int type );
+
+private:
+ typedef QMap<int, TableWidget*> TableMap;
+ typedef QMap<int, WidgetCointainer*> ContMap;
+
+ TableMap myTableMap;
+ ContMap myContMap;
+ QCheckBox* myEditCheck;
+ QCheckBox* myUpdateCheck;
+ QPushButton* myOKBtn;
+ QPushButton* myHelpBtn;
+
+ _PTR(Study) myStudy;
+ VISU::Table_i* myTable;
+};
+
+class VISU_I_EXPORT VISU_TableDlg::TableWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ TableWidget( QWidget* parent = 0, Qt::Orientation orientation = Qt::Horizontal );
+ ~TableWidget();
+
+ void initialize( _PTR(Study) study, VISU::Table_i* table, int type );
+
+ void setTableTitle( const QString& title );
+ QString getTableTitle();
+ void setNumRows( const int num );
+ int getNumRows();
+ void setNumCols( const int num );
+ int getNumCols();
+ void setRowTitles( QStringList& tlts );
+ void getRowTitles( QStringList& tlts );
+ void setColTitles( QStringList& tlts );
+ void getColTitles( QStringList& tlts );
+ void setUnitsTitle( const QString& tlt );
+ void setUnits( QStringList& units );
+ void getUnits( QStringList& units );
+ void setRowData( int row, QStringList& data );
+ void getRowData( int row, QStringList& data );
+
+ bool eventFilter( QObject* o, QEvent* e);
+
+public slots:
+ void setEditEnabled( bool enable );
+ void showColumnTitles( bool showTitles );
+
+ void updateButtonsState();
+ void addRow();
+ void addCol();
+ void delRow();
+ void delCol();
+ void adjustTable();
+ void selectAll();
+ void clearTable();
+
+ void columnClicked( int );
+ void rowClicked( int );
+
+protected:
+ void updateTableFromServant( bool adjust );
+
+private:
+ _PTR(Study) myStudy;
+ VISU::Table_i* myTableObj;
+ _PTR(GenericAttribute) myAttr;
+ int myType;
+
+ QLineEdit* myTitleEdit;
+ QTableWidget* myTable;
+ QPushButton* myAddRowBtn;
+ QPushButton* myAddColBtn;
+ QPushButton* myDelRowBtn;
+ QPushButton* myDelColBtn;
+ QPushButton* myAdjustBtn;
+ QPushButton* mySelectAllBtn;
+ QPushButton* myClearBtn;
+ QLabel* mySortPolicyLabel;
+ QComboBox* mySortPolicyCombo;
+ Qt::Orientation myOrientation;
+};
+
+class VISU_I_EXPORT NumDelegateItem: public QItemDelegate
+{
+public:
+ enum NumValidator{ NV_Int, NV_Real };
+
+ NumDelegateItem( QObject* parent, NumValidator mode = NV_Int );
+ virtual ~NumDelegateItem();
+
+ virtual QWidget* createEditor( QWidget* parent,
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index ) const;
+ virtual void setEditorData( QWidget* editor,
+ const QModelIndex& index ) const;
+private:
+ int myMode;
+};
+
+#endif // VISU_TABLEDLG_H
+
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Table_i.cc
// Author : Vadim SANDLER
//
#include "VISU_Table_i.hh"
-#include "VISU_CutLines_i.hh"
+#include "VISU_Tools.h"
+#include "VISU_CutLinesBase_i.hh"
+#include "VISU_CutSegment_i.hh"
#include "VISU_Result_i.hh"
#include "VISU_ViewManager_i.hh"
#include "utilities.h"
+#include <Basics_Utils.hxx>
+
using namespace std;
#ifdef _DEBUG_
#else
static int MYDEBUG = 0;
#endif
+
+//# Define delimeter
+#define TLT_DLM ":"
+
+//Absolute deviation
+#define D_MIN "min"
+#define D_MAX "max"
+
+//Percentage deviation
+#define D_PMIN "min%"
+#define D_PMAX "max%"
+
+#define D_EMIN "errmin"
+#define D_EMAX "errmax"
+
+#define D_EPMIN "errmin%"
+#define D_EPMAX "errmax%"
+
+#define D_ERR "error"
+#define D_ERRP "error%"
+
+
//----------------------------------------------------------------
// Table Object
//----------------------------------------------------------------
MESSAGE("Table_i::Table_i - "<<this);
mySObj = theStudy->FindObjectID(theObjectEntry);
myOrientation = VISU::Table::HORIZONTAL;
+ SetStudyDocument(theStudy);
+ BuildDeviationMap();
}
/*!
Destructor
return myOrientation;
}
+
+//----------------------------------------------------------------------------
+void
+VISU::Table_i
+::SortRow(CORBA::Long theRow, VISU::SortOrder theSortOrder, VISU::SortPolicy theSortPolicy)
+{
+ SALOMEDS::SObject_var SO = mySObj;
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
+ if ( !SO->_is_nil() ) {
+ SALOMEDS::GenericAttribute_var anAttr;
+ if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
+ SALOMEDS::AttributeTableOfInteger_var anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
+ anInt->SortRow( theRow, (SALOMEDS::AttributeTable::SortOrder)theSortOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)theSortPolicy );
+ }
+ else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
+ SALOMEDS::AttributeTableOfReal_var aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
+ aReal->SortRow( theRow, (SALOMEDS::AttributeTable::SortOrder)theSortOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)theSortPolicy );
+ }
+ UpdateCurves( std::map<int, int>() );
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::Table_i
+::SortColumn(CORBA::Long theColumn, VISU::SortOrder theSortOrder, VISU::SortPolicy theSortPolicy)
+{
+ SALOMEDS::SObject_var SO = mySObj;
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
+ if ( !SO->_is_nil() ) {
+ SALOMEDS::GenericAttribute_var anAttr;
+ if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
+ SALOMEDS::AttributeTableOfInteger_var anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
+ anInt->SortColumn( theColumn, (SALOMEDS::AttributeTable::SortOrder)theSortOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)theSortPolicy );
+ }
+ else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
+ SALOMEDS::AttributeTableOfReal_var aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
+ aReal->SortColumn( theColumn, (SALOMEDS::AttributeTable::SortOrder)theSortOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)theSortPolicy );
+ }
+ UpdateCurves( std::map<int, int>() );
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::Table_i
+::SortByRow(CORBA::Long theRow, VISU::SortOrder theSortOrder, VISU::SortPolicy theSortPolicy)
+{
+ SALOMEDS::SObject_var SO = mySObj;
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
+ if ( !SO->_is_nil() ) {
+ SALOMEDS::GenericAttribute_var anAttr;
+ if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
+ SALOMEDS::AttributeTableOfInteger_var anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
+ anInt->SortByRow( theRow, (SALOMEDS::AttributeTable::SortOrder)theSortOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)theSortPolicy );
+ }
+ else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
+ SALOMEDS::AttributeTableOfReal_var aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
+ aReal->SortByRow( theRow, (SALOMEDS::AttributeTable::SortOrder)theSortOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)theSortPolicy );
+ }
+ UpdateCurves( std::map<int, int>() );
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::Table_i
+::SortByColumn(CORBA::Long theColumn, VISU::SortOrder theSortOrder, VISU::SortPolicy theSortPolicy)
+{
+ SALOMEDS::SObject_var SO = mySObj;
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
+ if ( !SO->_is_nil() ) {
+ SALOMEDS::LongSeq_var aRowIndices;
+ SALOMEDS::GenericAttribute_var anAttr;
+ if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
+ SALOMEDS::AttributeTableOfInteger_var anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
+ aRowIndices = anInt->SortByColumn( theColumn, (SALOMEDS::AttributeTable::SortOrder)theSortOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)theSortPolicy );
+ }
+ else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
+ SALOMEDS::AttributeTableOfReal_var aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
+ aRowIndices = aReal->SortByColumn( theColumn, (SALOMEDS::AttributeTable::SortOrder)theSortOrder,
+ (SALOMEDS::AttributeTable::SortPolicy)theSortPolicy );
+ }
+ std::map<int, int> aMixData;
+ for ( int i = 0, n = aRowIndices->length(); i < n; i++ )
+ aMixData[ aRowIndices[i] ] = i+1;
+ UpdateCurves( aMixData );
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::Table_i
+::UpdateCurves(std::map<int,int> theMixData)
+{
+ SALOMEDS::SObject_var SO = mySObj;
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
+ SALOMEDS::ChildIterator_var CI = GetStudyDocument()->NewChildIterator( SO );
+ for ( CI->InitEx( true ); CI->More(); CI->Next() ) {
+ CORBA::Object_var anObj = SObjectToObject( CI->Value() );
+ VISU::Curve_var aCurve = VISU::Curve::_narrow( anObj );
+ if ( !aCurve->_is_nil() ) {
+ if ( VISU::Curve_i* pCurve = dynamic_cast<VISU::Curve_i*>( GetServant( aCurve ).in() ) ) {
+ int aHRow = pCurve->GetHRow(), aVRow = pCurve->GetVRow();
+ if ( theMixData.find( aHRow ) != theMixData.end() )
+ pCurve->SetHRow( theMixData[ aHRow ] );
+ if ( theMixData.find( aVRow ) != theMixData.end() )
+ pCurve->SetVRow( theMixData[ aVRow ] );
+ UpdatePlot2d( pCurve, eUpdateData );
+ }
+ }
+ }
+}
+//----------------------------------------------------------------------------
+bool
+VISU::Table_i::parseTitle(const QString theTitle,
+ QString& theOutTitle,
+ DeviationType& theType,
+ bool& isMin) {
+ QStringList lst = theTitle.split(TLT_DLM);
+ theType = NoneDvtn;
+ isMin = false;
+ theOutTitle.clear();
+ if(lst.size() >= 2) {
+ QString s1 = lst[0];
+ QString s2 = lst[1];
+ if(QString::compare(lst[0], D_MIN, Qt::CaseInsensitive) == 0){
+ theType = AbsoluteDvtn;
+ isMin = true;
+ } else if(QString::compare(lst[0], D_MAX, Qt::CaseInsensitive) == 0) {
+ theType = AbsoluteDvtn;
+ isMin = false;
+ } else if(QString::compare(lst[0], D_PMIN, Qt::CaseInsensitive) == 0) {
+ theType = PercentageDvtn;
+ isMin = true;
+ } else if(QString::compare(lst[0], D_PMAX, Qt::CaseInsensitive) == 0) {
+ theType = PercentageDvtn;
+ isMin = false;
+ } else if(QString::compare(lst[0], D_EMIN, Qt::CaseInsensitive) == 0) {
+ theType = ErrorDvtn;
+ isMin = true;
+ } else if(QString::compare(lst[0], D_EMAX, Qt::CaseInsensitive) == 0) {
+ theType = ErrorDvtn;
+ isMin = false;
+ } else if(QString::compare(lst[0], D_EPMIN, Qt::CaseInsensitive) == 0) {
+ theType = ErrorPercentageDvtn;
+ isMin = true;
+ } else if(QString::compare(lst[0], D_EPMAX, Qt::CaseInsensitive) == 0) {
+ theType = ErrorPercentageDvtn;
+ isMin = false;
+ } else if(QString::compare(lst[0], D_ERR, Qt::CaseInsensitive) == 0) {
+ theType = SimpleErrorDvtn;
+ } else if(QString::compare(lst[0], D_ERRP, Qt::CaseInsensitive) == 0) {
+ theType = SimpleErrorPercentageDvtn;
+ }
+ }
+ if(theType == NoneDvtn){
+ return false;
+ } else {
+ for(int i = 1; i < lst.size();i++ )
+ theOutTitle += lst[i];
+ return true;
+ }
+}
+//----------------------------------------------------------------------------
+double
+VISU::Table_i
+::calculateDeviation(DeviationType theType, double value,double deviationValue, bool isMin){
+ double result;
+ switch(theType) {
+ case AbsoluteDvtn:
+ result = deviationValue;
+ break;
+ case PercentageDvtn:
+ result = value*deviationValue;
+ break;
+ case SimpleErrorDvtn:
+ case ErrorDvtn:
+ result = value + (isMin ? -1.0 : 1.0)*deviationValue;
+ break;
+ case ErrorPercentageDvtn:
+ case SimpleErrorPercentageDvtn:
+ result = value *( 1 + (isMin ? -1.0 : 1.0)*deviationValue);
+ break;
+ default: result = 0.;
+ }
+ return isMin ? value - result : result - value;
+}
+
+QString
+VISU::Table_i
+::deviationLabel(DeviationData* info) {
+ QString lbl;
+ if(info) {
+ bool add = true;
+ switch(info->minDeviation()){
+ case SimpleErrorDvtn:
+ lbl = D_ERR;
+ add = false;
+ break;
+ case SimpleErrorPercentageDvtn:
+ lbl = D_ERRP;
+ add = false;
+ break;
+ case AbsoluteDvtn:
+ lbl = D_MIN;
+ break;
+ case PercentageDvtn:
+ lbl = D_PMIN;
+ break;
+ case ErrorDvtn:
+ lbl = D_EMIN;
+ break;
+ case ErrorPercentageDvtn:
+ lbl = D_EPMIN;
+ break;
+ }
+ if(add) {
+ lbl += " / ";
+ switch(info->maxDeviation()){
+ case AbsoluteDvtn:
+ lbl += D_MAX;
+ break;
+ case PercentageDvtn:
+ lbl += D_PMAX;
+ break;
+ case ErrorDvtn:
+ lbl += D_EMAX;
+ break;
+ case ErrorPercentageDvtn:
+ lbl += D_EPMAX;
+ break;
+ }
+ }
+ }
+ return lbl;
+}
+
+//----------------------------------------------------------------------------
+bool
+VISU::Table_i
+::hasDeviationData(const int row) {
+ return myDeviationMap.contains(row);
+}
+
+//----------------------------------------------------------------------------
+VISU::DeviationData*
+VISU::Table_i::getDeviationInfo(const int row) {
+ if(hasDeviationData(row))
+ return &myDeviationMap[row];
+ return NULL;
+}
+
+//----------------------------------------------------------------------------
+bool
+VISU::Table_i
+::isDeviationRow(const int row) {
+ DeviationMap::const_iterator it = myDeviationMap.begin();
+ for( ; it != myDeviationMap.end(); it++) {
+ if((*it).minRow() == row || (*it).maxRow() == row)
+ return true;
+ }
+ return false;
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::Table_i
+::BuildDeviationMap() {
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributeTableOfInteger_var anInt;
+ SALOMEDS::AttributeTableOfReal_var aReal;
+ SALOMEDS::StringSeq_var rowTitles = new SALOMEDS::StringSeq();
+ SALOMEDS::StringSeq_var rowUnits = new SALOMEDS::StringSeq();
+
+ if ( !mySObj->_is_nil() ) {
+ if ( Builder->FindAttribute( mySObj, anAttr, "AttributeTableOfInteger" ) ) {
+ anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
+ rowTitles = anInt->GetRowTitles();
+ rowUnits = anInt->GetRowUnits();
+ }
+ else if ( Builder->FindAttribute( mySObj, anAttr, "AttributeTableOfReal" ) ) {
+ aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
+ rowTitles = aReal->GetRowTitles();
+ rowUnits = aReal->GetRowUnits();
+ }
+ }
+ int nbTitles = rowTitles->length();
+ int nbUnits = rowUnits->length();
+
+ QString realTitle;
+ DeviationType deviationType;
+ bool isMin;
+
+ //Deviation candidates map:
+ //Key - title without keyword, pair { "deviation type" , "id of row" }
+ QMap<QString, QPair<DeviationType,int> > minCandidatesMap;
+ QMap<QString, QPair<DeviationType,int> > maxCandidatesMap;
+ QMap<QString, QPair<DeviationType,int> > CandidatesMap;
+ if( nbTitles > 0 ) {
+ for(int i = 0; i < nbTitles; i++ ) {
+ if(parseTitle(rowTitles[i].in(), realTitle, deviationType, isMin)) {
+ if( deviationType == SimpleErrorDvtn || deviationType == SimpleErrorPercentageDvtn ){
+ if(!CandidatesMap.contains(realTitle)) {
+ CandidatesMap[realTitle] = QPair<DeviationType, int>(deviationType,i);
+ } else {
+ minCandidatesMap.remove(realTitle);
+ maxCandidatesMap.remove(realTitle);
+ CandidatesMap.remove(realTitle);
+ }
+ continue;
+ }
+ if(isMin) {
+ if(!minCandidatesMap.contains(realTitle)){
+ minCandidatesMap[realTitle] = QPair<DeviationType, int>(deviationType,i);
+ } else {
+ minCandidatesMap.remove(realTitle);
+ maxCandidatesMap.remove(realTitle);
+ CandidatesMap.remove(realTitle);
+ }
+ } else {
+ if(!maxCandidatesMap.contains(realTitle)){
+ maxCandidatesMap[realTitle] = QPair<DeviationType, int>(deviationType,i);
+ } else {
+ minCandidatesMap.remove(realTitle);
+ maxCandidatesMap.remove(realTitle);
+ CandidatesMap.remove(realTitle);
+ }
+ }
+ }
+ }
+ QString currentTitle;
+ for(int i = 0; i < nbTitles; i++ ) {
+ currentTitle = rowTitles[i].in();
+ if(minCandidatesMap.contains(currentTitle) && maxCandidatesMap.contains(currentTitle)) {
+ //check for the units
+ if(nbUnits > 0) {
+ if(i < nbUnits) {
+ const char* s1 = rowUnits[i].in();
+ const char* s2 = rowUnits[minCandidatesMap[currentTitle].second].in();
+ const char* s3 = rowUnits[maxCandidatesMap[currentTitle].second].in();
+ if(strcmp(s1,s2) != 0 || strcmp(s1,s3) != 0 ) continue;
+ } else continue;
+ }
+ myDeviationMap[i] = DeviationData(minCandidatesMap[currentTitle].second,
+ maxCandidatesMap[currentTitle].second,
+ minCandidatesMap[currentTitle].first,
+ maxCandidatesMap[currentTitle].first);
+ } else if(CandidatesMap.contains(currentTitle)) {
+ //check for the units
+ if(nbUnits > 0) {
+ if(i < nbUnits) {
+ const char* s1 = rowUnits[i].in();
+ const char* s2 = rowUnits[CandidatesMap[currentTitle].second].in();
+ if(strcmp(s1,s2) != 0) continue;
+ } else continue;
+ }
+ myDeviationMap[i] = DeviationData(CandidatesMap[currentTitle].second,
+ CandidatesMap[currentTitle].second,
+ CandidatesMap[currentTitle].first,
+ CandidatesMap[currentTitle].first);
+ }
+ }
+ }
+}
+
//----------------------------------------------------------------------------
SALOMEDS::SObject_var
VISU::Table_i
// mpv (PAL 5357): if name attribute already exist at this label, use it as name of table
if ( GetName() == "" )
if ( !mySObj->_is_nil() ) {
- CutLines_i* pCutLines = NULL;
+ CutLinesBase_i* pCutLines = NULL;
CORBA::Object_var anObj = SObjectToObject(mySObj);
if(!CORBA::is_nil(anObj)){
- VISU::CutLines_var aCutLines = VISU::CutLines::_narrow(anObj);
+ VISU::CutLinesBase_var aCutLines = VISU::CutLinesBase::_narrow(anObj);
if(!aCutLines->_is_nil())
- pCutLines = dynamic_cast<CutLines_i*>(GetServant(aCutLines).in());
+ pCutLines = dynamic_cast<CutLinesBase_i*>(GetServant(aCutLines).in());
}
if (!pCutLines)
if (mySObj->GetName()) SetName(mySObj->GetName(), false);
SALOMEDS::SObject_var SO = mySObj;
if ( !SO->_is_nil() ) {
- CutLines_i* pCutLines = NULL;
+ CutLinesBase_i* pCutLines = NULL;
CORBA::Object_var anObj = SObjectToObject(SO);
if(!CORBA::is_nil(anObj)){
- VISU::CutLines_var aCutLines = VISU::CutLines::_narrow(anObj);
+ VISU::CutLinesBase_var aCutLines = VISU::CutLinesBase::_narrow(anObj);
if(!aCutLines->_is_nil())
- pCutLines = dynamic_cast<CutLines_i*>(GetServant(aCutLines).in());
+ pCutLines = dynamic_cast<CutLinesBase_i*>(GetServant(aCutLines).in());
}
SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
// look for component
if ( !theRestoring ) {
- SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
- // create SObject and set attributes
- QString aComment;
- if(pCutLines)
- aComment.sprintf("myComment=%s;mySourceId=CutLines",GetComment());
- else{
- aComment.sprintf("myComment=%s;mySourceId=TableAttr",GetComment());
- SALOMEDS::SObject_var aFatherSObject = SO->GetFather();
- if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){
- SALOMEDS::AttributeString_var aCommentAttr =
- SALOMEDS::AttributeString::_narrow(anAttr);
- CORBA::String_var aValue = aCommentAttr->Value();
- Storable::TRestoringMap aMap;
- Storable::StringToMap(aValue.in(),aMap);
- bool anIsExist;
- QString aMethodName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist);
- if(anIsExist){
- if( aMethodName == "ImportTables" ){
- aComment.sprintf("myComment=%s;mySourceId=TableFile",GetComment());
- }
- }
- }
- }
+ SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
+ // create SObject and set attributes
+ QString aComment;
+ if(pCutLines)
+ aComment.sprintf("myComment=%s;mySourceId=CutLines",GetComment());
+ else{
+ aComment.sprintf("myComment=%s;mySourceId=TableAttr",GetComment());
+ SALOMEDS::SObject_var aFatherSObject = SO->GetFather();
+ if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){
+ SALOMEDS::AttributeString_var aCommentAttr =
+ SALOMEDS::AttributeString::_narrow(anAttr);
+ CORBA::String_var aValue = aCommentAttr->Value();
+ Storable::TRestoringMap aMap;
+ Storable::StringToMap(aValue.in(),aMap);
+ bool anIsExist;
+ QString aMethodName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist);
+ if(anIsExist){
+ if( aMethodName == "ImportTables" ){
+ aComment.sprintf("myComment=%s;mySourceId=TableFile",GetComment());
+ }
+ }
+ }
+ }
- string anEntry = CreateAttributes( GetStudyDocument(),
- SO->GetID(),//SComponent->GetID(),
- "ICON_TREE_TABLE",
- GetID(),
- GetName(),
- "",
- aComment.toLatin1().data(),
- pCutLines );
- // create SObject referenced to real table object
- mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID( anEntry.c_str() ));
- if(pCutLines) {
- pCutLines->BuildTableOfReal(mySObj);
- }
- // mpv (PAL5357): reference attributes are unnecessary now
- //SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
- //Builder->Addreference( refSO, SO );
+ string anEntry = CreateAttributes( GetStudyDocument(),
+ SO->GetID(),//SComponent->GetID(),
+ "ICON_TREE_TABLE",
+ GetID(),
+ GetName(),
+ "",
+ aComment.toLatin1().data(),
+ pCutLines );
+ // create SObject referenced to real table object
+ mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID( anEntry.c_str() ));
+ if(pCutLines) {
+ bool isCutSegment = dynamic_cast<CutSegment_i*>(pCutLines);
+ pCutLines->BuildTableOfReal(mySObj, isCutSegment);
+ }
+ // mpv (PAL5357): reference attributes are unnecessary now
+ //SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
+ //Builder->Addreference( refSO, SO );
}
return this;
*/
VISU::Curve_i::Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable,
CORBA::Long theHRow, CORBA::Long theVRow,
- CORBA::Long theZRow )
+ CORBA::Long theZRow, CORBA::Boolean theIsV2 )
: PrsObject_i(theStudy), myTable( theTable ), myHRow( theHRow ),
- myVRow( theVRow ), myZRow( theZRow )
+ myVRow( theVRow ), myZRow( theZRow ), myIsV2( theIsV2 ), myDeviationEnabled(false)
{
myAuto = true;
myLine = VISU::Curve::SOLIDLINE;
myLineWidth = 0;
myMarker = VISU::Curve::CIRCLE;
myColor.R = 0.0; myColor.G = 0.0; myColor.B = 0.0;
+ myScale = 1.0;
}
/*!
Destructor
return myLineWidth;
}
+//----------------------------------------------------------------------------
+void
+VISU::Curve_i
+::SetScale( CORBA::Double theCoef )
+{
+ myScale = theCoef;
+ UpdatePlot2d( this, eUpdateData );
+}
+
+//----------------------------------------------------------------------------
+CORBA::Double
+VISU::Curve_i
+::GetScale()
+{
+ return myScale;
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::Curve_i
+::RemoveScale()
+{
+ SetScale( 1.0 );
+}
+
//----------------------------------------------------------------------------
/*!
Creates curve object
}
return 0;
}
+
+int VISU::Curve_i::GetDeviationData( double*& theMin, double*& theMax, QList<int>& theIndexes) {
+ if(!hasDeviation())
+ return 0;
+
+ theIndexes.clear();
+
+ DeviationData *info = myTable->getDeviationInfo(myVRow - 1);
+ int minRow = info->minRow() + 1;
+ int maxRow = info->maxRow() + 1;
+
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry().c_str());
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributeTableOfInteger_var anInt;
+ SALOMEDS::AttributeTableOfReal_var aReal;
+
+ int nbPoints = 0;
+ if ( !SO->_is_nil() ) {
+ if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
+ anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
+ int nbCols = anInt->GetNbColumns();
+ int nbRows = anInt->GetNbRows();
+ if ( nbCols > 0 && myHRow > 0 && myVRow && minRow > 0 && maxRow > 0 &&
+ myHRow <= nbRows && myVRow <= nbRows && minRow <= nbRows && maxRow <= nbRows ) {
+ for ( int j = 1; j <= nbCols; j++ ) {
+ if ( anInt->HasValue( myHRow, j ) && anInt->HasValue( myVRow, j ) &&
+ anInt->HasValue( minRow, j ) && anInt->HasValue( maxRow, j ) )
+ nbPoints++;
+ }
+
+ if ( nbPoints > 0 ) {
+ theMin = new double[ nbPoints ];
+ theMax = new double[ nbPoints ];
+ int k = 0;
+ int value;
+ for ( int j = 1; j <= nbCols; j++ ) {
+ if ( anInt->HasValue( myHRow, j ) && anInt->HasValue( myVRow, j ) &&
+ anInt->HasValue( minRow, j ) && anInt->HasValue( maxRow, j )) {
+ value = anInt->GetValue(myVRow,j);
+ theMin[k] = Table_i::calculateDeviation(info->minDeviation(),value, anInt->GetValue(minRow,j), true);
+ theMax[k] = Table_i::calculateDeviation(info->maxDeviation(),value, anInt->GetValue(maxRow,j), false);
+ k++;
+ theIndexes.push_back(j-1);
+ }
+ } // for ( ...
+ } // nbPoints > 0
+ } // nbCols > 0 && myHRow > 0 && myVRow ...
+ } // Builder->FindAttribute(...
+ else if( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
+ aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
+ int nbCols = aReal->GetNbColumns();
+ int nbRows = aReal->GetNbRows();
+ if ( nbCols > 0 && myHRow > 0 && myVRow && minRow > 0 && maxRow > 0 &&
+ myHRow <= nbRows && myVRow <= nbRows && minRow <= nbRows && maxRow <= nbRows) {
+ for ( int j = 1; j <= nbCols; j++ ) {
+ if ( aReal->HasValue( myHRow, j ) && aReal->HasValue( myVRow, j ) &&
+ aReal->HasValue( minRow, j ) && aReal->HasValue( maxRow, j ) )
+ nbPoints++;
+ }
+
+ if ( nbPoints > 0 ) {
+ theMin = new double[ nbPoints ];
+ theMax = new double[ nbPoints ];
+ int k = 0;
+ double value;
+ for ( int j = 1; j <= nbCols; j++ ) {
+ if ( aReal->HasValue( myHRow, j ) && aReal->HasValue( myVRow, j ) &&
+ aReal->HasValue( minRow, j ) && aReal->HasValue( maxRow, j )) {
+ value = aReal->GetValue(myVRow,j);
+ theMin[k] = Table_i::calculateDeviation(info->minDeviation(),value, aReal->GetValue(minRow,j), true);
+ theMax[k] = Table_i::calculateDeviation(info->maxDeviation(),value, aReal->GetValue(maxRow,j), false);
+ k++;
+ theIndexes.push_back(j-1);
+ }
+ } // for ( ..
+ } // nbPoints > 0
+ } // nbCols > 0 && myHRow > 0 && myVRow ...
+ } // Builder->FindAttribute( ...
+ } // !SO->_is_nil()
+ return nbPoints;
+}
/*!
Creates curve Plot2d presentation object
*/
SPlot2d_Curve* VISU::Curve_i::CreatePresentation()
{
SPlot2d_Curve* crv = new SPlot2d_Curve();
+ crv->setYAxis( myIsV2 ? QwtPlot::yRight : QwtPlot::yLeft );
crv->setHorTitle( GetHorTitle().c_str() );
string tlt = GetTitle();
if ( tlt.length() <= 0 )
crv->setIO(new SALOME_InteractiveObject(aString.in(), "VISU", GetName().c_str()));
if ( myTable )
crv->setTableIO(new SALOME_InteractiveObject(myTable->GetObjectEntry().c_str(), "VISU", myTable->GetName().c_str()));
+
+ if(!myContainers.isEmpty())
+ crv->addOwners(myContainers);
return crv;
}
/*!
bool ok = false;
QString z_str = VISU::Storable::FindValue(theMap,"myZRow", &ok);
myZRow = ok ? z_str.toInt() : 0;
+ ok = false;
+ QString v2_str = VISU::Storable::FindValue(theMap,"myIsV2", &ok);
+ myIsV2 = ok ? v2_str.toInt() : false;
+ QString scale_str = VISU::Storable::FindValue(theMap,"myScale", &ok);
+ myScale = ok ? scale_str.toDouble() : 1.0;
myColor.R = VISU::Storable::FindValue(theMap,"myColor.R").toDouble();
myColor.G = VISU::Storable::FindValue(theMap,"myColor.G").toDouble();
myColor.B = VISU::Storable::FindValue(theMap,"myColor.B").toDouble();
Storable::DataToStream( theStr, "myHRow", myHRow );
Storable::DataToStream( theStr, "myVRow", myVRow );
Storable::DataToStream( theStr, "myZRow", myZRow );
+ Storable::DataToStream( theStr, "myIsV2", myIsV2 );
+ Storable::DataToStream( theStr, "myScale", myScale );
Storable::DataToStream( theStr, "myColor.R", myColor.R );
Storable::DataToStream( theStr, "myColor.G", myColor.G );
Storable::DataToStream( theStr, "myColor.B", myColor.B );
SALOMEDS::Study_var aStudy = theSObject->GetStudy();
VISU::Table_i* pTable = GetTable(aStudy, theSObject->GetFather());
if( pTable != NULL ) {
- VISU::Curve_i* pResent = new VISU::Curve_i( aStudy, pTable, 0, 0, 0 );
+ VISU::Curve_i* pResent = new VISU::Curve_i( aStudy, pTable, 0, 0, 0, false );
return pResent->Restore( theMap, theSObject);
}
return NULL;
void VISU::Curve_i::RemoveFromStudy()
{
+
+ //remove curve from containers
+ PortableServer::POA_ptr aPOA = GetPOA();
+ ContainerSet::ConstIterator it = myContainers.begin();
+ for ( ; it != myContainers.end(); it++ ) {
+ SALOMEDS::SObject_var aSObject = GetStudyDocument()->FindObjectID( (*it).toLatin1().data() );
+ if ( aSObject->_is_nil() ) continue;
+
+ CORBA::Object_var anObj = VISU::SObjectToObject( aSObject );
+ if ( CORBA::is_nil( anObj ) ) continue;
+ VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>( VISU::GetServant( anObj.in() ).in() );
+ if ( !aContainer ) continue;
+ aContainer->RemoveCurve(VISU::Curve::_narrow(aPOA->servant_to_reference(this)));
+ }
+
struct TRemoveFromStudy: public SALOME_Event
{
VISU::Curve_i* myRemovable;
return mySObj;
}
+
+/*!
+ Add container.
+ id - owner of the curve
+*/
+void VISU::Curve_i::addContainer(const QString& id) {
+ myContainers.insert(id);
+}
+
+/*!
+ Remove Container
+ id - entry of the container
+*/
+void VISU::Curve_i::removeContainer(const QString& id) {
+ myContainers.insert(id);
+}
+
+/*!
+ Get all owners of the curve.
+ \return owners of the curve.
+*/
+VISU::ContainerSet VISU::Curve_i::getContainers() const {
+ return myContainers;
+}
+
+/*!
+ Return true if on the curve were assigned deviation data
+*/
+bool VISU::Curve_i::hasDeviation() {
+ return myTable && myTable->hasDeviationData(myVRow-1);
+}
+
+/*!
+ Enable/disable deviation data displaying.
+*/
+void VISU::Curve_i::ShowDeviation(CORBA::Boolean flag) {
+ if(flag && hasDeviation())
+ myDeviationEnabled = flag;
+ else
+ myDeviationEnabled = false;
+}
+/*!
+ Return enable deviation flag
+*/
+bool VISU::Curve_i::isDeviationShown() {
+ return myDeviationEnabled;
+}
+
//----------------------------------------------------------------
// Container Object
//----------------------------------------------------------------
SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::SObject_var newSO = Builder->NewObject( mySO );
Builder->Addreference( newSO, SO );
+ pCurve->addContainer(GetEntry().c_str());
}
}
}
Builder->RemoveObject( childSO );
}
}
+ pCurve->removeContainer(GetEntry().c_str());
}
}
}
*/
CORBA::Long VISU::Container_i::GetNbCurves()
{
- Update();
+ // Update();
return myCurves.count();
}
/*!
}
SALOMEDS::SObject_var
-VISU::ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy)
+VISU::ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy,
+ bool theFirstStrAsTitle)
{
+ // Set "C" numeric locale to import numbers correctly
+ Kernel_Utils::Localizer loc;
+
TTableContainer aContainer;
- ImportTables( theFileName, aContainer );
+ ImportTables( theFileName, aContainer, theFirstStrAsTitle );
if ( aContainer.empty() )
return SALOMEDS::SObject::_nil();
anAttr = aStudyBuilder->FindOrCreateAttribute(aFileObject, "AttributeString");
SALOMEDS::AttributeString_var aComment = SALOMEDS::AttributeString::_narrow(anAttr);
QString aString;
- aString.sprintf("myComment=ImportTables;myFileName=%s",
- aFileInfo.absoluteFilePath().toLatin1().data());
+ aString.sprintf("myComment=ImportTables;myFileName=%s;myFirstStrAsTitle=%d",
+ aFileInfo.absoluteFilePath().toLatin1().data(),theFirstStrAsTitle);
aComment->SetValue(aString.toLatin1().data());
- for(int i = 0, iEnd = aContainer.size(); i < iEnd; i++){
+ for(int i = 0, iEnd = aContainer.size(); i < iEnd; i++) {
PTableIDMapper aTableIDMapper = aContainer[i];
const TTable2D& aTable2D = *aTableIDMapper;
SALOMEDS::SObject_var aRealObject = aStudyBuilder->NewObject(aFileObject);
if(MYDEBUG) MESSAGE("aTable2D.myTitle = "<<aTable2D.myTitle);
if ( aTable2D.myTitle != "" ) {
aName->SetValue(aTable2D.myTitle.c_str());
- } else {
+ }
+ else {
QString aNewName;
aNewName.sprintf("Table:%d",i);
aName->SetValue(aNewName.toLatin1().data());
TTable2D aNewTable2D;
aTable2D.getColumns(aNewTable2D);
int kEnd = aNewTable2D.myRows[0].myValues.size();
- aTableOfReal->SetNbColumns(kEnd);
- for(int j = 0, jEnd = aNewTable2D.myRows.size(); j < jEnd; j++){
+ // check empty columns
+ TColStd_MapOfInteger EmptyColumns;
+ for(int j = 0, jEnd = aNewTable2D.myRows.size(); j < jEnd; j++) {
+ bool hasVal = false;
+ for(int k = 0; k < kEnd; k++) {
+ QString aVal = aNewTable2D.myRows[j].myValues[k].c_str();
+ bool anIsOk = false;
+ double aValue = aVal.toDouble(&anIsOk);
+ if(anIsOk) {
+ hasVal = true;
+ break;
+ }
+ }
+ if(!hasVal) {
+ EmptyColumns.Add(j);
+ }
+ }
+ // create table of real
+ aTableOfReal->SetNbColumns( kEnd - EmptyColumns.Extent() );
+ int currNum = -1;
+ for(int j = 0, jEnd = aNewTable2D.myRows.size(); j < jEnd; j++) {
+ if( EmptyColumns.Contains(j) ) continue;
+ currNum++;
if(MYDEBUG) MESSAGE("j = "<<j<<"; kEnd = "<<kEnd);
-
- for(int k = 0; k < kEnd; k++){
+ for(int k = 0; k < kEnd; k++) {
QString aVal = aNewTable2D.myRows[j].myValues[k].c_str();
bool anIsOk = false;
double aValue = aVal.toDouble(&anIsOk);
- if(anIsOk && !aVal.contains("NAN",Qt::CaseInsensitive) && !aVal.contains("INF",Qt::CaseInsensitive))
- aTableOfReal->PutValue(aValue,j+1,k+1);
+ if( anIsOk && !aVal.contains("NAN",Qt::CaseInsensitive) &&
+ !aVal.contains("INF",Qt::CaseInsensitive) ) {
+ aTableOfReal->PutValue(aValue,currNum+1,k+1);
+ }
}
-
- aTableOfReal->SetRowTitle(j+1,aNewTable2D.myRows[j].myTitle.c_str());
- aTableOfReal->SetRowUnit(j+1,aNewTable2D.myRows[j].myUnit.c_str());
+ aTableOfReal->SetRowTitle(currNum+1,aNewTable2D.myRows[j].myTitle.c_str());
+ aTableOfReal->SetRowUnit(currNum+1,aNewTable2D.myRows[j].myUnit.c_str());
}
for(int k = 0; k < kEnd; k++)
aTableOfReal->SetColumnTitle(k+1,aNewTable2D.myColumnTitles[k].c_str());
return aFileObject;
}
+
+//=======================================================================
+//function : updateStrForCSV
+//purpose : auxilary for ExportTableToFile
+//=======================================================================
+void updateStrForCSV(QString& aStr, const char aSep)
+{
+ int index = aStr.indexOf('"');
+ while(index>=0) {
+ aStr.insert(index,'"');
+ if( index+2 >= aStr.size() ) break;
+ index = aStr.indexOf('"',index+2);
+ }
+ index = aStr.indexOf(aSep);
+ if(index>=0) {
+ // current string contains separator => need to use "..."
+ aStr.insert(0,'"');
+ aStr.push_back('"');
+ }
+}
+
+
+//=======================================================================
+//function : ExportTableToFile
+//purpose :
+//=======================================================================
template<class TTableAttr> bool ExportTableToFile(const TTableAttr& aTabAttr,
const char* theFileName)
{
if (CORBA::is_nil(aTabAttr))
return false;
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
QFile aFile(theFileName);
aFile.open(QIODevice::WriteOnly);
SALOMEDS::StringSeq_var aRowUnits = aTabAttr->GetRowUnits();
SALOMEDS::StringSeq_var aColumnTitles = aTabAttr->GetColumnTitles();
+ //--------------------------------------------------
+ // write as *.csv file if it is needed
+ //--------------------------------------------------
+ QString tmp(theFileName);
+ tmp = tmp.trimmed();
+ tmp = tmp.right(3).trimmed();
+ if( tmp == QString("csv") ) {
+ const char aSep = ',';
+ // write column titles
+ QString aLine(aRowTitles[0]);
+ updateStrForCSV(aLine,aSep);
+ for(int i=1; i<aRowsNb; i++) {
+ aLine += aSep;
+ QString aTmp(aRowTitles[i]);
+ updateStrForCSV(aTmp,aSep);
+ aLine += aTmp;
+ }
+ aLine += "\n";
+ aFile.write(aLine.toLatin1() );
+ // write table data
+ QString aValue;
+ for (int j = 1; j <= aColNb; j++) {
+ QString aLine = "";
+ if(aTabAttr->HasValue(1,j)) {
+ aLine = aValue.sprintf("%.16g",(double)aTabAttr->GetValue(1,j));
+ }
+ for (int i = 2; i <= aRowsNb; i++) {
+ if(aTabAttr->HasValue(i,j)) {
+ aLine += aSep + aValue.sprintf("%.16g",(double)aTabAttr->GetValue(i,j));
+ }
+ else aLine += aSep;
+ }
+ aLine += "\n";
+ aFile.write(aLine.toLatin1() );
+ }
+
+ aFile.close();
+ return true;
+ }
+ //--------------------------------------------------
+ // end of writing as *.csv file
+ //--------------------------------------------------
+
/* The given table is rare (some cells is empty) or not? */
bool isRareTable = false;
for (int i = 1; i <= aRowsNb; i++)
/* COLUMN_TITLES */
if ( anAbscissTitle.length() || anOrdinate.length() ) {
- aLine = "#COLUMN_TITLES: " + anAbscissTitle + " | " + anOrdinate + "\n";
+ aLine = "#COLUMN_TITLES: " + anAbscissTitle + " | " + anOrdinate;
+ int tmpind = aLine.indexOf("\n");
+ while(tmpind>=0) {
+ aLine.remove(tmpind,1);
+ tmpind = aLine.indexOf("\n");
+ }
+ aLine += "\n";
aFile.write(aLine.toLatin1() );
}
QString aUnitsSep = "";
QString aTitlesStr = "#COLUMN_TITLES: ";
QString aUnitsStr = "#COLUMN_UNITS: ";
- for (int i = 1; i <= aRowsNb; i++)
- {
- if (!QString(aRowTitles[i-1]).trimmed().isEmpty()) {
- aTitlesStr += (aTitlesSep + aRowTitles[i-1]);
- if (aTitlesSep.isEmpty()) aTitlesSep = " | ";
- }
- if (!QString(aRowUnits[i-1]).trimmed().isEmpty()) {
- aUnitsStr += (aUnitsSep + aRowUnits[i-1]);
- if (aUnitsSep.isEmpty()) aUnitsSep = " ";
- }
+ for (int i = 1; i <= aRowsNb; i++) {
+ if (!QString(aRowTitles[i-1]).trimmed().isEmpty()) {
+ aTitlesStr += (aTitlesSep + aRowTitles[i-1]);
+ if (aTitlesSep.isEmpty()) aTitlesSep = " | ";
+ }
+ if (!QString(aRowUnits[i-1]).trimmed().isEmpty()) {
+ aUnitsStr += (aUnitsSep + aRowUnits[i-1]);
+ if (aUnitsSep.isEmpty()) aUnitsSep = " ";
}
+ }
+ int tmpind = aTitlesStr.indexOf("\n");
+ while(tmpind>=0) {
+ aTitlesStr.remove(tmpind,1);
+ tmpind = aTitlesStr.indexOf("\n");
+ }
aTitlesStr += "\n";
aUnitsStr += "\n";
aFile.write(aTitlesStr.toLatin1());
/* CURVE COORDINATES */
QString aSep, aValue, aColTitle;
- for (int j = 1; j <= aColNb; j++)
- {
- aLine = ""; aSep = "";
- for (int i = 1; i <= aRowsNb; i++)
- {
- aLine += (aSep + aValue.sprintf("%.16g", (double)(aTabAttr->GetValue(i,j))));
- if (aSep.isEmpty()) aSep = " ";
- }
- if (!aLine.trimmed().isEmpty()) {
- aColTitle = aColumnTitles[j-1];
- if (!aColTitle.trimmed().isEmpty())
- aLine = aLine + " #TITLE: " + aColTitle;
- aLine += "\n";
- aFile.write(aLine.toLatin1());
- }
+ for (int j = 1; j <= aColNb; j++) {
+ aLine = ""; aSep = "";
+ for (int i = 1; i <= aRowsNb; i++) {
+ aLine += (aSep + aValue.sprintf("%.16g", (double)(aTabAttr->GetValue(i,j))));
+ if (aSep.isEmpty()) aSep = " ";
}
+ if (!aLine.trimmed().isEmpty()) {
+ aColTitle = aColumnTitles[j-1];
+ if (!aColTitle.trimmed().isEmpty())
+ aLine = aLine + " #TITLE: " + aColTitle;
+ aLine += "\n";
+ aFile.write(aLine.toLatin1());
+ }
+ }
} //end of else
aFile.close();
{
//Find table
SALOMEDS::GenericAttribute_var anAttr ;
- if (theTable->FindAttribute(anAttr, "AttributeTableOfReal"))
- {
- SALOMEDS::AttributeTableOfReal_var aTabAttr = SALOMEDS::AttributeTableOfReal ::_narrow(anAttr);
- return ExportTableToFile ( aTabAttr , theFileName);
-
- }
+ if (theTable->FindAttribute(anAttr, "AttributeTableOfReal")) {
+ SALOMEDS::AttributeTableOfReal_var aTabAttr =
+ SALOMEDS::AttributeTableOfReal ::_narrow(anAttr);
+ return ExportTableToFile ( aTabAttr , theFileName);
+ }
else if (theTable->FindAttribute(anAttr, "AttributeTableOfInteger")) {
-
- SALOMEDS::AttributeTableOfInteger_var aTabAttr = SALOMEDS::AttributeTableOfInteger ::_narrow(anAttr);
+ SALOMEDS::AttributeTableOfInteger_var aTabAttr =
+ SALOMEDS::AttributeTableOfInteger ::_narrow(anAttr);
return ExportTableToFile ( aTabAttr , theFileName);
-
}
return false;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Table_i.hh
// Author : Vadim SANDLER
#include "VISU_PrsObject_i.hh"
#include <QStringList>
+#include <QSet>
+#include <QMap>
class SPlot2d_Curve;
-namespace VISU{
+namespace VISU {
+ typedef enum {NoneDvtn = 0,
+ AbsoluteDvtn, // min, max
+ PercentageDvtn, // min%, max%
+ ErrorDvtn, // errmin, errmax
+ ErrorPercentageDvtn, // errmin%, errmax%
+ SimpleErrorDvtn, // error
+ SimpleErrorPercentageDvtn // error%
+ } DeviationType;
+
+ class VISU_I_EXPORT DeviationData {
+ public:
+ DeviationData(){
+ _minRow = -1;_maxRow = -1;
+ _minType = NoneDvtn;_maxType = NoneDvtn;
+ }
+ DeviationData(const int minC, const int maxC,
+ const DeviationType minT, const DeviationType maxT) {
+ _minRow = minC; _maxRow = maxC;
+ _minType = minT ; _maxType = maxT;
+ }
+ int minRow() const {return _minRow;}
+ int maxRow() const {return _maxRow;}
+ DeviationType minDeviation() const {return _minType;}
+ DeviationType maxDeviation() const {return _maxType;}
+
+ private:
+ int _minRow;
+ int _maxRow;
+ DeviationType _minType;
+ DeviationType _maxType;
+ };
+
+ typedef QMap<int, DeviationData> DeviationMap;
+
//==============================================================================
class VISU_I_EXPORT Table_i : public virtual POA_VISU::Table,
public virtual PrsObject_i
virtual CORBA::Long GetNbRows();
virtual CORBA::Long GetNbColumns();
+ virtual void SortRow(CORBA::Long theRow, VISU::SortOrder theSortOrder, VISU::SortPolicy theSortPolicy);
+ virtual void SortColumn(CORBA::Long theColumn, VISU::SortOrder theSortOrder, VISU::SortPolicy theSortPolicy);
+ virtual void SortByRow(CORBA::Long theRow, VISU::SortOrder theSortOrder, VISU::SortPolicy theSortPolicy);
+ virtual void SortByColumn(CORBA::Long theColumn, VISU::SortOrder theSortOrder, VISU::SortPolicy theSortPolicy);
+
+ virtual bool hasDeviationData(const int);
+ virtual bool isDeviationRow(const int);
+ virtual DeviationData* getDeviationInfo(const int);
virtual void RemoveFromStudy();
protected:
Storable* Build(int theRestoring);
+ void UpdateCurves(std::map<int, int> theMixData);
+ void BuildDeviationMap();
protected:
VISU::Table::Orientation myOrientation;
std::string myTitle;
SALOMEDS::SObject_var mySObj;
+ DeviationMap myDeviationMap;
public:
virtual Storable* Create();
const std::string& thePrefix,
CORBA::Boolean theIsMultiFile);
+ static bool parseTitle(const QString theTitle,
+ QString& theOutTitle,
+ DeviationType& theType,
+ bool& isMin);
+
+ static double calculateDeviation(DeviationType theType, double value,double deviationValue, bool isMin);
+
+ static QString deviationLabel(DeviationData* );
+
virtual void ToStream( std::ostringstream& theStr );
static const std::string myComment;
virtual const char* GetComment() const;
virtual std::string GetObjectEntry();
};
- SALOMEDS::SObject_var ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy);
+ SALOMEDS::SObject_var ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy,
+ bool theFirstStrAsTitle = false);
bool ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName);
//==============================================================================
+
+ typedef QSet<QString> ContainerSet;
+
class VISU_I_EXPORT Curve_i : public virtual POA_VISU::Curve,
public virtual PrsObject_i
{
Curve_i( const Curve_i& );
public:
Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable,
- CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow );
+ CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow,
+ CORBA::Boolean theIsV2 );
virtual ~Curve_i();
virtual VISU::VISUType GetType() { return VISU::TCURVE;};
virtual VISU::Curve::LineType GetLine();
virtual CORBA::Long GetLineWidth();
+ virtual void SetScale( CORBA::Double theCoef );
+ virtual CORBA::Double GetScale();
+ virtual void RemoveScale();
+
+ virtual void addContainer(const QString& id);
+ virtual void removeContainer(const QString& id);
+ virtual ContainerSet getContainers() const;
+
virtual void RemoveFromStudy();
virtual SALOMEDS::SObject_var GetSObject();
+ virtual void ShowDeviation(CORBA::Boolean);
+ virtual bool isDeviationShown();
+ virtual bool hasDeviation();
+
protected:
Storable* Build(int theRestoring);
int myHRow;
int myVRow;
int myZRow;
+ bool myIsV2;
+ double myScale;
struct SALOMEDS::Color myColor;
VISU::Curve::MarkerType myMarker;
VISU::Curve::LineType myLine;
std::string myTitle;
bool myAuto;
SALOMEDS::SObject_var mySObj;
+ ContainerSet myContainers;
+ bool myDeviationEnabled;
public:
virtual Storable* Create();
+
+ Table_i* getTable() const {return myTable;}
+
+ int GetHRow() const { return myHRow; }
+ void SetHRow( const int theHRow ) { myHRow = theHRow; }
+
+ int GetVRow() const { return myVRow; }
+ void SetVRow( const int theVRow ) { myVRow = theVRow; }
+
+ int GetZRow() const { return myZRow; }
+ void SetZRow( const int theZRow ) { myZRow = theZRow; }
- int GetHRow() const { return myHRow;}
- int GetVRow() const { return myVRow;}
- int GetZRow() const { return myZRow;}
+ int GetIsV2() const { return myIsV2; }
+ void SetIsV2( const int theIsV2 ) { myIsV2 = theIsV2; }
virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO);
virtual std::string GetHorUnits();
virtual std::string GetVerUnits();
virtual int GetData( double*& theHorList, double*& theVerList, QStringList& );
+ virtual int GetDeviationData( double*& theMin, double*& theMax, QList<int>& );
virtual SPlot2d_Curve* CreatePresentation();
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_TimeAnimation.cxx
// Author : Vitaly SMETANNIKOV
// Module : VISU
#ifdef WNT
#include <windows.h>
-#include <vfw.h>
#include <QMessageBox>
#endif
#include "VISU_CutPlanes_i.hh"
#include "VISU_Plot3D_i.hh"
#include "VISU_CutLines_i.hh"
+#include "VISU_CutSegment_i.hh"
#include "VISU_Vectors_i.hh"
#include "VISU_StreamLines_i.hh"
#include "VISU_GaussPoints_i.hh"
};
+ //------------------------------------------------------------------------
+ class DumpPath
+ {
+ QString myPath;
+ QMutex myPathMutex;
+ public:
+ DumpPath(QString thePath = QString())
+ : myPath(thePath) {}
+
+ QString GetPath() {
+ QString aPath;
+ myPathMutex.lock();
+ aPath = myPath;
+ myPathMutex.unlock();
+ return aPath;
+ }
+ void SetPath(QString thePath) {
+ myPathMutex.lock();
+ myPath = thePath;
+ myPathMutex.unlock();
+ }
+ };
+
+
//------------------------------------------------------------------------
struct TCompositeMinMaxController : virtual TVTKMinMaxController
{
void
AddController(ColoredPrs3d_i* theReference,
- VISU::PMinMaxController theMinMaxController)
+ VISU::PMinMaxController theMinMaxController)
{
myMinMaxContainer[ TKey( theReference ) ] = theMinMaxController;
}
{
TMinMaxContainer::iterator anIter = myMinMaxContainer.find( TKey( theFromPrs3 ) );
if ( anIter != myMinMaxContainer.end() ) {
- myMinMaxContainer.erase( anIter );
- myMinMaxContainer[ TKey( theToPrs3d ) ] = VISU::CreateDefaultMinMaxController( theToPrs3d );
+ myMinMaxContainer.erase( anIter );
+ myMinMaxContainer[ TKey( theToPrs3d ) ] = VISU::CreateDefaultMinMaxController( theToPrs3d );
}
}
{
vtkFloatingPointType aMin = TMinMaxController::GetComponentMin(theCompID);
if ( !myMinMaxContainer.empty() ) {
- TMinMaxContainer::const_iterator anIter = myMinMaxContainer.begin();
- for(; anIter != myMinMaxContainer.end(); anIter++){
- VISU::PMinMaxController aMinMaxController = anIter->second;
- aMin = std::min(aMin, aMinMaxController->GetComponentMin(theCompID));
- }
+ TMinMaxContainer::const_iterator anIter = myMinMaxContainer.begin();
+ for(; anIter != myMinMaxContainer.end(); anIter++){
+ VISU::PMinMaxController aMinMaxController = anIter->second;
+ aMin = std::min(aMin, aMinMaxController->GetComponentMin(theCompID));
+ }
}
return aMin;
}
{
vtkFloatingPointType aMax = TMinMaxController::GetComponentMax(theCompID);
if ( !myMinMaxContainer.empty() ) {
- TMinMaxContainer::const_iterator anIter = myMinMaxContainer.begin();
- for(; anIter != myMinMaxContainer.end(); anIter++){
- VISU::PMinMaxController aMinMaxController = anIter->second;
- aMax = std::max(aMax, aMinMaxController->GetComponentMax(theCompID));
- }
+ TMinMaxContainer::const_iterator anIter = myMinMaxContainer.begin();
+ for(; anIter != myMinMaxContainer.end(); anIter++){
+ VISU::PMinMaxController aMinMaxController = anIter->second;
+ aMax = std::max(aMax, aMinMaxController->GetComponentMax(theCompID));
+ }
}
return aMax;
}
myAnimEntry = "";
- myDumpPath = "";
+ myDumpPath = new VISU::DumpPath( "" );
+
myAVIMaker = "jpeg2yuv";
+
+ myDumpMode = VISU::GetResourceMgr()->integerValue("VISU", "dump_mode", 0);
+ myTimeStampFrequency = VISU::GetResourceMgr()->integerValue("VISU", "time_stamp_frequency", 1);
}
delete myExecutionState;
- myDumpPath = "";
+ delete myDumpPath;
/* Terminates the execution of the thread.
* The thread may or may not be terminated immediately,
VISU::Storable::TRestoringMap aFMap = VISU::Storable::GetStorableMap(myFieldsLst.first().myField);
long aNumComp = VISU::Storable::FindValue(aFMap, "myNumComponent").toLong();
if ( aNumCompCurr != aNumComp )
- return false;
+ return false;
}
if ( !myFieldsLst.isEmpty() )
if (!theData.myActors.empty()) {
for (int i = 0, iEnd = theData.myActors.size(); i < iEnd; i++) {
if (theData.myActors[i] != 0) {
- theData.myActors[i]->RemoveFromRender(aRen);
+ theData.myActors[i]->RemoveFromRender(aRen);
}
}
theData.myActors.clear();
if (!theData.myPrs.empty()) {
for (int i = 0, iEnd = theData.myPrs.size(); i < iEnd; i++)
if (theData.myPrs[i] != 0) {
- theData.myPrs[i]->_remove_ref();
+ theData.myPrs[i]->_remove_ref();
}
theData.myPrs.clear();
}
template<class TPrs3d>
void
GeneratePresentations(_PTR(Study) theStudy,
- FieldData& theData,
- VISU::Result_i* theResult,
- bool theIsRangeDefined,
- CORBA::Double theTimeMin,
- CORBA::Double theTimeMax,
- QList<long> theSequence)
+ FieldData& theData,
+ VISU::Result_i* theResult,
+ bool theIsRangeDefined,
+ CORBA::Double theTimeMin,
+ CORBA::Double theTimeMax,
+ QList<long> theSequence)
{
_PTR(ChildIterator) anIter = theStudy->NewChildIterator(theData.myField);
anIter->Next(); // First is reference on support
long aSequenceIndex = 1;
for(; anIter->More(); anIter->Next(), aSequenceIndex++){
if (aFrameId == theData.myNbTimes) {
- MESSAGE("There are extra timestamps in field");
- return;
+ MESSAGE("There are extra timestamps in field");
+ return;
}
_PTR(SObject) aTimeStamp = anIter->Value();
if(!aTimeStamp)
- continue;
+ continue;
long aSequenceId = -1;
theData.myTiming[aFrameId] = VISU_TimeAnimation::getTimeValue(aTimeStamp);
if (theIsRangeDefined) {
- if (theData.myTiming[aFrameId] < theTimeMin)
- continue;
- if (theData.myTiming[aFrameId] > theTimeMax)
- break;
+ if (theData.myTiming[aFrameId] < theTimeMin)
+ continue;
+ if (theData.myTiming[aFrameId] > theTimeMax)
+ break;
}
else if (isSequenceDefined) {
- aSequenceId = theSequence.indexOf( aSequenceIndex );
- if( aSequenceId == -1 )
- continue;
+ aSequenceId = theSequence.indexOf( aSequenceIndex );
+ if( aSequenceId == -1 )
+ continue;
}
VISU::Storable::TRestoringMap aTimeMap = VISU::Storable::GetStorableMap(aTimeStamp);
#endif
if(aPresent->Apply(false)){
/*
- if(isSequenceDefined)
- {
- theData.myPrs[aSequenceId] = aPresent;
- aFrameId++;
- }
- else
+ if(isSequenceDefined)
+ {
+ theData.myPrs[aSequenceId] = aPresent;
+ aFrameId++;
+ }
+ else
*/
theData.myPrs[aFrameId++] = aPresent;
anIsCreated = true;
INFOS("Unknown exception was occured!");
}
if(!anIsCreated)
- aPresent->_remove_ref();
+ aPresent->_remove_ref();
}
theData.myNbFrames = aFrameId;
if (theData.myPrsType != VISU::TGAUSSPOINTS) {
for(long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++) {
- if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(theData.myPrs[aFrameId])){
- aPrs->SetOffset(theData.myOffset);
- }
+ if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(theData.myPrs[aFrameId])){
+ aPrs->SetOffset(theData.myOffset);
+ }
}
}
}
switch (aData.myPrsType) {
case VISU::TSCALARMAP:
GeneratePresentations<ScalarMap_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TISOSURFACES: // Iso Surfaces
GeneratePresentations<IsoSurfaces_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TCUTPLANES: // Cut Planes
GeneratePresentations<CutPlanes_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TCUTLINES: // Cut Lines
GeneratePresentations<CutLines_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
+ break;
+ case VISU::TCUTSEGMENT: // Cut Segment
+ GeneratePresentations<CutSegment_i>(myStudy,
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TPLOT3D: // Plot3d
GeneratePresentations<Plot3D_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TDEFORMEDSHAPE: // Deformed Shape
GeneratePresentations<DeformedShape_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TVECTORS: // Vectors
GeneratePresentations<Vectors_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TSTREAMLINES: // Stream Lines
GeneratePresentations<StreamLines_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TGAUSSPOINTS: // Gauss Points
GeneratePresentations<GaussPoints_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TSCALARMAPONDEFORMEDSHAPE: // Scalar map on deformed shape
case VISU::TDEFORMEDSHAPEANDSCALARMAP:
GeneratePresentations<DeformedShapeAndScalarMap_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
default:
MESSAGE("Not implemented for this presentation type: " << aData.myPrsType);
if (theFieldNum == getNbFields() - 1) {
if ( aData.myPrsType != VISU::TGAUSSPOINTS && aData.myPrsType != TDEFORMEDSHAPEANDSCALARMAP && aData.myPrsType != TSCALARMAPONDEFORMEDSHAPE) {
- // Initialize the MinMax controller
- VISU::PCompositeMinMaxController aMinMaxController(new VISU::TCompositeMinMaxController());
- if ( myAnimationMode == VISU::Animation::PARALLEL ) {
- FieldData& aFieldData = getFieldData(theFieldNum);
- VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0];
- aMinMaxController->AddController( aPrs3d, VISU::CreateDefaultMinMaxController( aPrs3d ) );
- } else {
- for (int aFieldId = 0; aFieldId < getNbFields(); aFieldId++) {
- FieldData& aFieldData = getFieldData(aFieldId);
- VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0];
- aMinMaxController->AddController( aPrs3d, VISU::CreateDefaultMinMaxController( aPrs3d ) );
- }
- }
-
- double aMin = getMinFieldsValue(myFieldsLst);
- double aMax = getMaxFieldsValue(myFieldsLst);
-
- for (int aFieldId = 0; aFieldId < getNbFields(); aFieldId++) {
- FieldData& aFieldData = getFieldData(aFieldId);
- for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
- VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[aFrameId];
- aPrs3d->SetMinMaxController(aMinMaxController);
- if (VISU::IsoSurfaces_i* anIsoSurfaces = dynamic_cast<VISU::IsoSurfaces_i*>(aPrs3d))
- anIsoSurfaces->SetSubRange(aMin, aMax);
- }
- }
+ // Initialize the MinMax controller
+ VISU::PCompositeMinMaxController aMinMaxController(new VISU::TCompositeMinMaxController());
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) {
+ FieldData& aFieldData = getFieldData(theFieldNum);
+ VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0];
+ aMinMaxController->AddController( aPrs3d, VISU::CreateDefaultMinMaxController( aPrs3d ) );
+ } else {
+ for (int aFieldId = 0; aFieldId < getNbFields(); aFieldId++) {
+ FieldData& aFieldData = getFieldData(aFieldId);
+ VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0];
+ aMinMaxController->AddController( aPrs3d, VISU::CreateDefaultMinMaxController( aPrs3d ) );
+ }
+ }
+
+ double aMin = getMinFieldsValue(myFieldsLst);
+ double aMax = getMaxFieldsValue(myFieldsLst);
+
+ for (int aFieldId = 0; aFieldId < getNbFields(); aFieldId++) {
+ FieldData& aFieldData = getFieldData(aFieldId);
+ for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
+ VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[aFrameId];
+ aPrs3d->SetMinMaxController(aMinMaxController);
+ if (VISU::IsoSurfaces_i* anIsoSurfaces = dynamic_cast<VISU::IsoSurfaces_i*>(aPrs3d))
+ anIsoSurfaces->SetSubRange(aMin, aMax);
+ }
+ }
}
}
}
for (long j = 0; j < aData.myNbFrames; j++) {
VISU_Actor* aActor = NULL;
try{
- aData.myPrs[j]->SetOffset(aData.myOffset);
- aActor = aData.myPrs[j]->CreateActor();
- myView->AddActor(aActor);
- bool condition = ( myAnimationMode == VISU::Animation::PARALLEL ) ? (j == 0) : (j == 0 && i == 0);
- if(condition)
- aActor->VisibilityOn();
- else
- aActor->VisibilityOff();
+ aData.myPrs[j]->SetOffset(aData.myOffset);
+ aActor = aData.myPrs[j]->CreateActor();
+ myView->AddActor(aActor);
+ bool condition = ( myAnimationMode == VISU::Animation::PARALLEL ) ? (j == 0) : (j == 0 && i == 0);
+ if(condition)
+ aActor->VisibilityOn();
+ else
+ aActor->VisibilityOff();
}catch(...){ //catch(std::runtime_error& exc){
- aNoError = false;
- myLastError += QString("%1 ").arg(aData.myTiming[j]);
+ aNoError = false;
+ myLastError += QString("%1 ").arg(aData.myTiming[j]);
}
aData.myActors[j] = aActor;
}
myFrame = 0;
myLastError += QString(" timestamp(s) cannot be created.");
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
myView->Repaint();
return aNoError;
}
FieldData& aData = myFieldsLst[i];
if (!aData.myActors.empty()) {
for (int i = 0, iEnd = aData.myActors.size(); i < iEnd; i++) {
- if (aData.myActors[i] != 0) {
- aData.myActors[i]->RemoveFromRender(aRen);
- }
+ if (aData.myActors[i] != 0) {
+ aData.myActors[i]->RemoveFromRender(aRen);
+ }
}
aData.myActors.clear();
}
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- visibilityOff(i, myFrame);
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ visibilityOff(i, myFrame);
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
aFieldId = aPair.first;
aFrameId = aPair.second;
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- visibilityOff(aFieldId, aFrameId);
+ visibilityOff(aFieldId, aFrameId);
}
myFrame++;
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ myFieldsLst[i].myActors[myFrame]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
aFieldId = aPair.first;
aFrameId = aPair.second;
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
+ myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
+ myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
}
myView->Repaint();
}
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- visibilityOff(i, myFrame);
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ visibilityOff(i, myFrame);
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
aFieldId = aPair.first;
aFrameId = aPair.second;
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- visibilityOff(aFieldId, aFrameId);
+ visibilityOff(aFieldId, aFrameId);
}
myFrame--;
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ myFieldsLst[i].myActors[myFrame]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
aFieldId = aPair.first;
aFrameId = aPair.second;
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
+ myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
+ myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
}
myView->Repaint();
}
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if(!myFieldsLst[i].myActors.empty())
- if (myFieldsLst[i].myActors[myFrame] != 0)
- visibilityOff(i, myFrame);
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ visibilityOff(i, myFrame);
}
else { //successive animation mode
std::pair<int,long> aPair = getRelativeFrameNumber(myFrame);
long aFrameId = aPair.second;
if(!myFieldsLst[aFieldId].myActors.empty())
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- visibilityOff(aFieldId, aFrameId);
+ visibilityOff(aFieldId, aFrameId);
}
myFrame = 0;
for (i = 0; i < imax; i++)
if(!myFieldsLst[i].myActors.empty())
if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+ myFieldsLst[i].myActors[myFrame]->VisibilityOn();
if(!myFieldsLst[0].myTiming.empty()){
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
myView->Repaint();
}
}
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
- visibilityOff(i, myFrame);
+ visibilityOff(i, myFrame);
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+ myFieldsLst[i].myActors[myFrame]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
aFieldId = aPair.first;
aFrameId = aPair.second;
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
+ myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
+ myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
}
myView->Repaint();
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
- visibilityOff(i, myFrame);
+ visibilityOff(i, myFrame);
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
aFieldId = aPair.first;
aFrameId = aPair.second;
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- visibilityOff(aFieldId, aFrameId);
+ visibilityOff(aFieldId, aFrameId);
}
myFrame = theFrame;
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+ myFieldsLst[i].myActors[myFrame]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
aFieldId = aPair.first;
aFrameId = aPair.second;
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
+ myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
+ myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
}
myView->Repaint();
}
else { //successive animation mode
if ( aFieldId == 0 && aFrameNum <= myFieldsAbsFrames[aFieldId] )
- aRes = aFrameNum;
+ aRes = aFrameNum;
else if ( aFieldId && aFrameNum <= myFieldsAbsFrames[aFieldId] - myFieldsAbsFrames[aFieldId-1] )
- aRes = myFieldsAbsFrames[aFieldId-1] + aFrameNum;
+ aRes = myFieldsAbsFrames[aFieldId-1] + aFrameNum;
}
}
return aRes - 1;
}
else { //successive animation mode
for (int i = 0, iEnd = myFieldsAbsFrames.size(); i < iEnd; i++)
- if ( myFieldsAbsFrames[i] >= theFrame ) {
- aRes.first = i;
- if ( i == 0 )
- aRes.second = theFrame - 1;
- else
- aRes.second = theFrame-myFieldsAbsFrames[i-1] - 1;
- break;
- }
+ if ( myFieldsAbsFrames[i] >= theFrame ) {
+ aRes.first = i;
+ if ( i == 0 )
+ aRes.second = theFrame - 1;
+ else
+ aRes.second = theFrame-myFieldsAbsFrames[i-1] - 1;
+ break;
+ }
}
}
return aRes;
if (myExecutionState->IsActive()) {
for (int i = 0; i < getNbFields(); i++) {
FieldData& aData = myFieldsLst[i];
- if (aData.myNbFrames == 0)
- continue;
+ if (aData.myNbFrames == 0)
+ continue;
if (myFrame > 0) {
if (aData.myActors[myFrame-1] != 0)
visibilityOff(i, myFrame-1);
} else {
- if (aData.myActors[aData.myNbFrames-1] != 0)
- visibilityOff(i, aData.myNbFrames-1);
+ if (aData.myActors[aData.myNbFrames-1] != 0)
+ visibilityOff(i, aData.myNbFrames-1);
}
if (aData.myActors[myFrame] != 0 && myView) {
ProcessVoidEvent(new TVoidMemFunEvent<VISU_Actor>(aData.myActors[myFrame],
}
}
if (!myView)
- return;
+ return;
bool repainArg = false;
ProcessVoidEvent(new TVoidMemFun1ArgEvent<SVTK_ViewWindow,bool>(myView,
&SVTK_ViewWindow::Repaint,
}
}
int delay = (int)(1000. * k / mySpeed);
- theIsDumping = !myDumpPath.isEmpty();
+ theIsDumping = !myDumpPath->GetPath().isEmpty();
if (delay < 1 && theIsDumping) {
// We must unlock mutex for some time before grabbing to allow view updating
delay = 1;
// We must unlock mutex for some time before grabbing to allow view updating
msleep(delay);
if (!myExecutionState->IsActive())
- return;
+ return;
if (!(aFirstFieldData.myField)) // break, if field was deleted.
- break;
+ break;
saveImages( 0, aOneVal, aNbFiles, theIndexList );
}
if (myFrame == aFirstFieldData.myNbFrames) {
if (!myCycling) {
aHasNextFrame = false;
- myFrame--;
+ myFrame--;
}
else
- myFrame = 0;
+ myFrame = 0;
}
} // while (aHasNextFrame && myExecutionState->IsActive())
}
if ( !aData.myPrs[0] ) continue;
for (; aFrame < aData.myNbFrames && myExecutionState->IsActive(); aFrame++, myFrame++)
{
- ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>
(this, &VISU_TimeAnimation::_emitFrameChanged,
myFrame, myFieldsLst[aFieldId].myTiming[aFrame]));
- if (myExecutionState->IsActive()) {
+ if (myExecutionState->IsActive()) {
if (aFrame > 0) {
if (aData.myActors[aFrame-1] != 0)
visibilityOff(aFieldId, aFrame-1);
&VISU_Actor::VisibilityOn));
}
- if (!myView)
- return;
+ if (!myView)
+ return;
bool repainArg = false;
ProcessVoidEvent(new TVoidMemFun1ArgEvent<SVTK_ViewWindow,bool>(myView,
&SVTK_ViewWindow::Repaint,
repainArg));
- }
-
- k = 1;
- if (myProportional) {
- switch (aFrame) {
- case 0:
- break;
- case 1:
- if (aFirstFieldData.myNbFrames > 2)
- k = (aFirstFieldData.myTiming[aFrame+1] -
- aFirstFieldData.myTiming[aFrame]) / aOneVal;
- break;
- default:
- if (aFrame < (aFirstFieldData.myNbFrames - 1))
- k = (aFirstFieldData.myTiming[aFrame+1] -
- aFirstFieldData.myTiming[aFrame]) / aOneVal;
- }
- }
- int delay = (int)(1000. * k / mySpeed);
- theIsDumping = !myDumpPath.isEmpty();
- if (delay < 1 && theIsDumping) {
- // We must unlock mutex for some time before grabbing to allow view updating
- delay = 1;
- }
- msleep(delay);
-
- if (!myExecutionState->IsActive()) return;
-
- if (theIsDumping) {
- // We must unlock mutex for some time before grabbing to allow view updating
- msleep(delay);
- if (!myExecutionState->IsActive()) return;
-
- if (!(myFieldsLst[aFieldId].myField)) // break, if field was deleted.
- break;
-
- saveImages( aFieldId, aOneVal, aNbFiles, theIndexList );
- }
+ }
+
+ k = 1;
+ if (myProportional) {
+ switch (aFrame) {
+ case 0:
+ break;
+ case 1:
+ if (aFirstFieldData.myNbFrames > 2)
+ k = (aFirstFieldData.myTiming[aFrame+1] -
+ aFirstFieldData.myTiming[aFrame]) / aOneVal;
+ break;
+ default:
+ if (aFrame < (aFirstFieldData.myNbFrames - 1))
+ k = (aFirstFieldData.myTiming[aFrame+1] -
+ aFirstFieldData.myTiming[aFrame]) / aOneVal;
+ }
+ }
+ int delay = (int)(1000. * k / mySpeed);
+ theIsDumping = !myDumpPath->GetPath().isEmpty();
+ if (delay < 1 && theIsDumping) {
+ // We must unlock mutex for some time before grabbing to allow view updating
+ delay = 1;
+ }
+ msleep(delay);
+
+ if (!myExecutionState->IsActive()) return;
+
+ if (theIsDumping) {
+ // We must unlock mutex for some time before grabbing to allow view updating
+ msleep(delay);
+ if (!myExecutionState->IsActive()) return;
+
+ if (!(myFieldsLst[aFieldId].myField)) // break, if field was deleted.
+ break;
+
+ saveImages( aFieldId, aOneVal, aNbFiles, theIndexList );
+ }
} // for (; aFrame < aData.myNbFrames && myExecutionState->IsActive(); aFrame++, myFrame++)
} // for (int aFieldId = 0;
//------------------------------------------------------------------------
void VISU_TimeAnimation::saveImages( int theFieldId,
- double& theOneVal, int& theNbFiles,
- QList<int>& theIndexList )
+ double& theOneVal, int& theNbFiles,
+ QList<int>& theIndexList )
{
if (myDumpFormat.compare("AVI") != 0) {
- QString aFile(myDumpPath);
+ QString aFile(myDumpPath->GetPath());
int aFrameNb = myFrame; // parallel animation mode
if ( myAnimationMode == VISU::Animation::SUCCESSIVE ) // successive animation mode
aFile += ".";
aFile += myDumpFormat.toLower();
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (myView,&SVTK_ViewWindow::RefreshDumpImage)); // IPAL13602
+ (myView,&SVTK_ViewWindow::RefreshDumpImage)); // IPAL13602
ProcessEvent(new TMemFun2ArgEvent<SUIT_ViewWindow,bool,const QString&,const QString&>
- (myView,&SUIT_ViewWindow::dumpViewToFormat,aFile,myDumpFormat));
+ (myView,&SUIT_ViewWindow::dumpViewToFormat,aFile,myDumpFormat));
} else {
- QFileInfo aFileInfo(myDumpPath);
+ QFileInfo aFileInfo(myDumpPath->GetPath());
QString aDirPath = aFileInfo.absolutePath();
QString aBaseName = aFileInfo.fileName();
+ if( myTimeStampFrequency > 1 && myFrame % myTimeStampFrequency != 0 )
+ return;
+
switch (myFrame) {
case 0:
break;
break;
default:
if (myProportional) {
- FieldData& aFirstFieldData = myFieldsLst[0];
- double p = (aFirstFieldData.myTiming[myFrame] -
- aFirstFieldData.myTiming[myFrame-1]) / theOneVal;
- myFileIndex += (long) (5*p);
+ FieldData& aFirstFieldData = myFieldsLst[0];
+ double p = (aFirstFieldData.myTiming[myFrame] -
+ aFirstFieldData.myTiming[myFrame-1]) / theOneVal;
+ myFileIndex += (long) (5*p);
} else {
- myFileIndex += 5;
+ myFileIndex += 5;
}
}
int height = img.height(); height = (height/16)*16;
QImage copy = img.copy(0, 0, width, height);
if (copy.save(aFile, "JPEG")) {
- theIndexList.append(myFileIndex);
- theNbFiles++;
+ theIndexList.append(myFileIndex);
+ theNbFiles++;
}
}
}
return;
}
- bool isDumping = !myDumpPath.isEmpty();
+ bool isDumping = !myDumpPath->GetPath().isEmpty();
myFileIndex = 0;
QList<int> anIndexList;
// make AVI file if need
if (isDumping && myDumpFormat.compare("AVI") == 0 && myExecutionState->IsActive()) {
- double aFPS = 17.3 * mySpeed;
+ double aFPS = 17.3 * mySpeed / myTimeStampFrequency;
- QFileInfo aFileInfo(myDumpPath);
+ QFileInfo aFileInfo(myDumpPath->GetPath());
QString aDirPath = aFileInfo.absolutePath();
QString aBaseName = aFileInfo.fileName();
// add missing files
if (anIndexList.count() > 1) {
- QString aFFile = aDirPath + QDir::separator() + aBaseName;
+ QString aFFile = aDirPath + "/" + aBaseName;
aFFile += QString("_%1.jpeg");
int aStartIndex = anIndexList[0], anEndIndex;
for (int i = 1; i < anIndexList.count(); i++) {
- anEndIndex = anIndexList[i];
- QString aCurFile = aFFile.arg(QString::number(aStartIndex).rightJustified(8, '0'));
- QStringList aCommands;
- for (int j = aStartIndex+1; j < anEndIndex; j++) {
- QString aFile = aFFile.arg(QString::number(j).rightJustified(8, '0'));
- aCommands.append(QString("ln -s %1 %2").arg(aCurFile).arg(aFile));
- }
- system(aCommands.join(" ; \\\n").toLatin1().data());
- aStartIndex = anEndIndex;
+ anEndIndex = anIndexList[i];
+ QString aCurFile = aFFile.arg(QString::number(aStartIndex).rightJustified(8, '0'));
+ QStringList aCommands;
+ QString aSeparator;
+ for (int j = aStartIndex+1; j < anEndIndex; j++) {
+ QString aFile = aFFile.arg(QString::number(j).rightJustified(8, '0'));
+#ifndef WIN32
+ aCommands.append(QString("ln -s %1 %2").arg(aCurFile).arg(aFile));
+ aSeparator = QString(" ; \\\n");
+#else
+ aCommands.append(QString("COPY /Y %1 %2 > NUL").arg(QString(aCurFile).replace("/","\\\\")).arg(QString(aFile).replace("/","\\\\")));
+ aSeparator = QString(" & ");
+#endif
+ }
+ system(aCommands.join(aSeparator).toLatin1().data());
+ aStartIndex = anEndIndex;
}
}
// make AVI file
- QString aPattern = aDirPath + QDir::separator() + aBaseName;
+ QString aPattern = aDirPath + "/" + aBaseName;
aPattern += "_\%08d.jpeg";
QString aCmd = myAVIMaker;
aCmd += QString(" -f %1").arg(aFPS);
// aCmd += QString(" -n %1").arg(aNbFiles);
aCmd += QString(" -n %1").arg(myFileIndex+1);
- aCmd += QString(" -j %1").arg(aPattern);
+ aCmd += QString(" -j \"%1\"").arg(aPattern);
aCmd += " | yuv2lav";
- aCmd += QString(" -o %1").arg(myDumpPath);
+ aCmd += QString(" -o \"%1\"").arg(myDumpPath->GetPath());
+ #ifdef WIN32
+ aCmd += " -f aA";
+ #endif
system(aCmd.toLatin1().data());
// remove temporary jpeg files
+#ifndef WIN32
aCmd = "( ";
aCmd += QString("cd %1").arg(aDirPath);
aCmd += "; ls";
aCmd += QString(" | egrep '%1_[0-9]*.jpeg'").arg(aBaseName);
aCmd += " | xargs rm";
aCmd += " )";
+#else
+ QString tmpFile = QString("_") + aBaseName + "_tempfile";
+ QString diskName = aDirPath.split("/")[0];
+ aCmd = diskName + " && (cd " + aDirPath.replace("/","\\\\") +
+ " && ((dir /b | findstr " + aBaseName + "_[0-9]*.jpeg > " + tmpFile +
+ ") & (for /f %i in (" + tmpFile + ") do (del \"%i\")) & (del " + tmpFile + "))) > NUL";
+#endif
system(aCmd.toLatin1().data());
}
ok = false;
int aLeftIndex = aLeftIndexStr.toLong( &ok );
if( !ok )
- continue;
+ continue;
ok = false;
int aRightIndex = aRightIndexStr.toLong( &ok );
if( !ok )
- continue;
+ continue;
if( aLeftIndex >= aRightIndex )
- continue;
+ continue;
for( int i = aLeftIndex; i <= aRightIndex; i++ )
- theIndices.append( i );
+ theIndices.append( i );
isCorrect = true;
}
return isCorrect;
}
+//------------------------------------------------------------------------
+void VISU_TimeAnimation::dumpTo(const char* thePath)
+{
+ myDumpPath->SetPath( QString( thePath ) );
+}
+
//------------------------------------------------------------------------
std::string VISU_TimeAnimation::setDumpFormat(const char* theFormat)
{
QList<QByteArray> aDumpFormats = QImageWriter::supportedImageFormats();
if (myDumpFormat.isEmpty() ||
(aDumpFormats.indexOf(theFormat) < 0 && myDumpFormat.compare("AVI") != 0)) {
- if (aDumpFormats.indexOf("JPEG"))
+ if (aDumpFormats.indexOf("JPEG") >= 0 ||
+ aDumpFormats.indexOf("jpeg") >= 0)
myDumpFormat = "JPEG";
else
myDumpFormat = aDumpFormats.at(0);
return myDumpFormat.toLatin1().data();
}
+//------------------------------------------------------------------------
+void VISU_TimeAnimation::setTimeStampFrequency(CORBA::Long theFrequency)
+{
+ myTimeStampFrequency = theFrequency;
+}
+
//------------------------------------------------------------------------
bool VISU_TimeAnimation::checkAVIMaker() const
{
QList<QByteArray> aDumpFormats = QImageWriter::supportedImageFormats();
- if (aDumpFormats.indexOf("JPEG") < 0) return false;
+ if (aDumpFormats.indexOf("JPEG") < 0 &&
+ aDumpFormats.indexOf("jpeg") < 0)
+ return false;
- QString aCmd("which ");
- aCmd += myAVIMaker;
- aCmd += " >& /dev/null";
+ QString aCmd;
+#ifndef WIN32
+ aCmd = "which " + myAVIMaker + " 2> /dev/null";
+#else
+ aCmd = "setlocal & set P2=.;%PATH% & (for %e in (%PATHEXT%) do @for %i in (" + myAVIMaker + "%e) do @if NOT \"%~$P2:i\"==\"\" exit /b 0) & exit /b 1";
+#endif
int iErr = system(aCmd.toLatin1().data());
return (iErr == 0);
}
case VISU::TCUTLINES:
aPrsCmt = VISU::CutLines_i::myComment;
break;
+ case VISU::TCUTSEGMENT:
+ aPrsCmt = VISU::CutSegment_i::myComment;
+ break;
case VISU::TPLOT3D:
aPrsCmt = VISU::Plot3D_i::myComment;
break;
{
if (myStudy->GetProperties()->IsLocked()) {
SUIT_MessageBox::warning(0,
- QObject::tr("WRN_VISU_WARNING"),
- QObject::tr("WRN_STUDY_LOCKED"),
- QObject::tr("BUT_OK"));
+ QObject::tr("WRN_VISU_WARNING"),
+ QObject::tr("WRN_STUDY_LOCKED"),
+ QObject::tr("BUT_OK"));
return SALOMEDS::SObject::_nil();
}
QString aComment;
aComment.sprintf("myComment=ANIMATION;myTimeMinVal=%g;myTimeMaxVal=%g;mySequence=%s;myMode=%d",
myTimeMinVal,
- myTimeMaxVal,
- mySequence.toLatin1().data(),
- myAnimationMode);
+ myTimeMaxVal,
+ mySequence.toLatin1().data(),
+ myAnimationMode);
string anEntry = VISU::CreateAttributes(myStudy,
- aSComponentEntry.c_str(),
- VISU::NO_ICON,
- VISU::NO_IOR,
+ aSComponentEntry.c_str(),
+ VISU::NO_ICON,
+ VISU::NO_IOR,
GenerateName().toLatin1().data(),
- VISU::NO_PERFSITENT_REF,
- aComment.toLatin1().data(),
- true);
+ VISU::NO_PERFSITENT_REF,
+ aComment.toLatin1().data(),
+ true);
myAnimEntry = anEntry.c_str();
_PTR(SObject) aAnimSObject = myStudy->FindObjectID(anEntry.c_str());
string aPrsComment = strOut.str();
string aPrsMyComment = aData.myPrs[0]->GetComment();
if(aPrsMyComment == "PRSMERGER")
- aPrsMyComment = "SCALARMAP";
+ aPrsMyComment = "SCALARMAP";
VISU::CreateAttributes(myStudy,
- newObj->GetID().c_str(),
- VISU::NO_ICON,
- VISU::NO_IOR,
- aPrsMyComment.c_str(),
- VISU::NO_PERFSITENT_REF,
- aPrsComment.c_str(),
- true);
+ newObj->GetID().c_str(),
+ VISU::NO_ICON,
+ VISU::NO_IOR,
+ aPrsMyComment.c_str(),
+ VISU::NO_PERFSITENT_REF,
+ aPrsComment.c_str(),
+ true);
}
}
aStudyBuilder->CommitCommand();
- return VISU::GetSObject(aAnimSObject);
+ return VISU::GetSObject(aAnimSObject)._retn();
}
//------------------------------------------------------------------------
QString aComment;
aComment.sprintf("myComment=ANIMATION;myTimeMinVal=%g;myTimeMaxVal=%g;mySequence=%s;myMode=%d",
myTimeMinVal,
- myTimeMaxVal,
- mySequence.toLatin1().data(),
- myAnimationMode);
+ myTimeMaxVal,
+ mySequence.toLatin1().data(),
+ myAnimationMode);
_PTR(GenericAttribute) anAttr;
anAttr = aStudyBuilder->FindOrCreateAttribute(aAnimSObject, "AttributeString");
} else {
VISU::CreateAttributes(myStudy,
- aRefObj->GetID().c_str(),
- VISU::NO_ICON,
- VISU::NO_IOR,
+ aRefObj->GetID().c_str(),
+ VISU::NO_ICON,
+ VISU::NO_IOR,
aPrsNameTxt.c_str(),
- VISU::NO_PERFSITENT_REF,
- aPrsComment.c_str(),
- true);
+ VISU::NO_PERFSITENT_REF,
+ aPrsComment.c_str(),
+ true);
}
}
aStudyBuilder->CommitCommand();
aData.myPrsType = VISU::TCUTPLANES;
else if (strName == VISU::CutLines_i::myComment.c_str())
aData.myPrsType = VISU::TCUTLINES;
+ else if (strName == VISU::CutSegment_i::myComment.c_str())
+ aData.myPrsType = VISU::TCUTSEGMENT;
else if (strName == VISU::Plot3D_i::myComment.c_str())
aData.myPrsType = VISU::TPLOT3D;
else if (strName == VISU::DeformedShape_i::myComment.c_str())
}
for (int i = 1; i < aData.myNbFrames; i++) {
if (!aData.myPrs[0])
- continue;
+ continue;
bool anIsFixedRange = false;
if (aData.myPrsType != VISU::TGAUSSPOINTS) {
- if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(aData.myPrs[i]))
- anIsFixedRange = aPrs->IsRangeFixed();
+ if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(aData.myPrs[i]))
+ anIsFixedRange = aPrs->IsRangeFixed();
}
if (aData.myPrsType == VISU::TDEFORMEDSHAPEANDSCALARMAP) {
- if (VISU::DeformedShapeAndScalarMap_i* aDeformedPrs =
- dynamic_cast<VISU::DeformedShapeAndScalarMap_i*>(aData.myPrs[i])) {
- //Set correct time stamp number
- int aTimeStampNum = aDeformedPrs->GetScalarTimeStampNumber();
- aDeformedPrs->SameAs(aData.myPrs[0]);
- aDeformedPrs->SetScalarField(aDeformedPrs->GetScalarEntity(),
- aDeformedPrs->GetScalarFieldName(),
- aTimeStampNum);
- }
+ if (VISU::DeformedShapeAndScalarMap_i* aDeformedPrs =
+ dynamic_cast<VISU::DeformedShapeAndScalarMap_i*>(aData.myPrs[i])) {
+ //Set correct time stamp number
+ int aTimeStampNum = aDeformedPrs->GetScalarTimeStampNumber();
+ aDeformedPrs->SameAs(aData.myPrs[0]);
+ aDeformedPrs->SetScalarField(aDeformedPrs->GetScalarEntity(),
+ aDeformedPrs->GetScalarFieldName(),
+ aTimeStampNum);
+ }
}
else
- aData.myPrs[i]->SameAs(aData.myPrs[0]);
+ aData.myPrs[i]->SameAs(aData.myPrs[0]);
}
}
string aStr = aAnimSObject->GetID();
if ( !aPrs_i )
THROW_SALOME_CORBA_EXCEPTION("Error : invalid dynamic cast of the given presentation to VISU::ColoredPrs3d_i",
- SALOME::INTERNAL_ERROR);
+ SALOME::INTERNAL_ERROR);
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
FieldData& aData = myFieldsLst[theFieldNum];
if ( aData.myPrs.empty() )
THROW_SALOME_CORBA_EXCEPTION("Error : presentations for the given field is not yet created!",
- SALOME::INTERNAL_ERROR);
+ SALOME::INTERNAL_ERROR);
if ( aPrs_i->GetCResult() != aData.myPrs[0]->GetCResult() )
THROW_SALOME_CORBA_EXCEPTION("Error : the MED file is not the same!",
- SALOME::INTERNAL_ERROR);
+ SALOME::INTERNAL_ERROR);
for (int i = 0; i < aData.myNbFrames; i++) {
bool anIsFixedRange = false;
if (aData.myPrsType != VISU::TGAUSSPOINTS) {
- if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(aData.myPrs[i]))
- anIsFixedRange = aPrs->IsRangeFixed();
+ if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(aData.myPrs[i]))
+ anIsFixedRange = aPrs->IsRangeFixed();
}
aData.myPrs[i]->SameAs(aPrs_i);
}
FieldData& aData = myFieldsLst[f];
if ( aData.myPrs.empty() )
- THROW_SALOME_CORBA_EXCEPTION("Error : presentations for the given field is not yet created!",
- SALOME::INTERNAL_ERROR);
+ THROW_SALOME_CORBA_EXCEPTION("Error : presentations for the given field is not yet created!",
+ SALOME::INTERNAL_ERROR);
for (int i = 0; i < aData.myNbFrames; i++) {
- aData.myPrs[i]->SameAs(aPrs_i);
+ aData.myPrs[i]->SameAs(aPrs_i);
}
}
}
return CORBA::string_dup(aDumpFormat.c_str());
}
+void VISU_TimeAnimation_i::setTimeStampFrequency(CORBA::Long theFrequency)
+{
+ myAnim->setTimeStampFrequency(theFrequency);
+}
+
+CORBA::Long VISU_TimeAnimation_i::getTimeStampFrequency()
+{
+ return myAnim->getTimeStampFrequency();
+}
+
CORBA::Boolean VISU_TimeAnimation_i::isCycling()
{
return myAnim->isCycling();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_TimeAnimation.h
// Author : Vitaly SMETANNIKOV
// Module : VISU
//class Result_i;
class ColoredPrs3d_i;
class ExecutionState;
+ class DumpPath;
}
struct FieldData
{
Q_OBJECT;
+ public:
+ enum DumpMode { DM_None = 0, DM_Picture, DM_Video };
+
protected:
CORBA::Boolean _generateFrames();
void _connectView();
static double getTimeValue (_PTR(SObject) theTimestamp);
VISU_TimeAnimation(_PTR(Study) theStudy,
- VISU::View3D_ptr theView3D = VISU::View3D::_nil());
+ VISU::View3D_ptr theView3D = VISU::View3D::_nil());
~VISU_TimeAnimation();
virtual VISU::VISUType GetType() { return VISU::TNONE;};
bool getIndicesFromSequence( QString theSequence, QList<long>& theIndices );
- void dumpTo(const char* thePath) { myDumpPath = thePath; }
+ void dumpTo(const char* thePath);
std::string setDumpFormat(const char* theFormat);
+
+ void setTimeStampFrequency(CORBA::Long theFrequency);
+ CORBA::Long getTimeStampFrequency() { return myTimeStampFrequency; }
+
+ int getDumpMode() const { return myDumpMode; }
+
bool checkAVIMaker() const;
QString getLastErrorMsg() { return myLastError; }
bool myCleaningMemoryAtEachFrame;
_PTR(Study) myStudy;
+ VISU::DumpPath* myDumpPath;
+
VISU::Animation::AnimationMode myAnimationMode;
double myTimeMinVal, myTimeMaxVal; //!< Range of time stams, set by user
double myTimeMin , myTimeMax ; //!< Range of time stams, available for animation
QString mySequence;
- QString myDumpPath;
QString myDumpFormat;
QString myAVIMaker;
long myFileIndex;
SVTK_ViewWindow* myView;
+ int myDumpMode;
+ int myTimeStampFrequency;
+
QString myAnimEntry;
static int myNBAnimations;
virtual void dumpTo(const char* thePath);
virtual char* setDumpFormat(const char* theFormat);
+ virtual void setTimeStampFrequency(CORBA::Long theFrequency);
+ virtual CORBA::Long getTimeStampFrequency();
+
virtual CORBA::Boolean isCycling();
virtual CORBA::Boolean isCleaningMemoryAtEachFrame();
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VISU_Tools.cxx
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#include "VISU_Tools.h"
+
+#include "VISU_Gen_i.hh"
+#include "VISU_Table_i.hh"
+#include "VISU_ViewManager_i.hh"
+
+#include <VISU_ActorBase.h>
+
+#include <LightApp_Displayer.h>
+
+#include <SalomeApp_Study.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Module.h>
+
+#include <SPlot2d_ViewModel.h>
+#include <Plot2d_ViewFrame.h>
+#include <Plot2d_ViewManager.h>
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
+//=============================================================================
+namespace VISU
+{
+ //------------------------------------------------------------
+ // Internal function used by several public functions below
+ void
+ UpdateCurve(VISU::Curve_i* theCurve,
+ Plot2d_ViewFrame* thePlot,
+ SPlot2d_Curve* plotCurve,
+ int theDisplaying)
+ {
+ if ( theDisplaying == VISU::eErase ) {
+ if ( plotCurve && thePlot )
+ thePlot->eraseCurve( plotCurve, false );
+ }
+ else if ( theDisplaying == VISU::eDisplay || theDisplaying == VISU::eDisplayOnly ) {
+ if ( plotCurve ) {
+ plotCurve->setHorTitle( theCurve->GetHorTitle().c_str() );
+ //plotCurve->setVerTitle( ( theCurve->GetVerTitle().c_str() ) );
+ plotCurve->setVerTitle( theCurve->GetName().c_str() );
+ plotCurve->setHorUnits( theCurve->GetHorUnits().c_str() );
+ plotCurve->setVerUnits( theCurve->GetVerUnits().c_str() );
+ plotCurve->setScale( theCurve->GetScale() );
+ double* xList = 0;
+ double* yList = 0;
+ QStringList zList;
+ int nbPoints = theCurve->GetData( xList, yList, zList );
+ if ( nbPoints > 0 && xList && yList ) {
+ plotCurve->setData( xList, yList, nbPoints, zList );
+ }
+ if(theCurve->isDeviationShown()){
+ double* min = 0;
+ double* max = 0;
+ QList<int> indexes;
+ int nbPoints = theCurve->GetDeviationData( min, max, indexes );
+ if ( nbPoints > 0 && min && max ) {
+ plotCurve->setDeviationData(min, max, indexes);
+ delete min;
+ delete max;
+ }
+ } else {
+ plotCurve->clearDeviationData();
+ }
+ if ( !theCurve->IsAuto() ) {
+ plotCurve->setLine( (Plot2d::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
+ plotCurve->setMarker( (Plot2d::MarkerType)theCurve->GetMarker() );
+ SALOMEDS::Color color = theCurve->GetColor();
+ plotCurve->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
+ }
+ plotCurve->setAutoAssign( theCurve->IsAuto() );
+ if( thePlot )
+ thePlot->displayCurve( plotCurve, false );
+ }
+ else {
+ Plot2d_Curve* crv = theCurve->CreatePresentation();
+ if ( crv ) {
+ if( thePlot )
+ thePlot->displayCurve( crv, false );
+ theCurve->SetLine( (VISU::Curve::LineType)crv->getLine(), crv->getLineWidth() );
+ theCurve->SetMarker( (VISU::Curve::MarkerType)crv->getMarker());
+ SALOMEDS::Color newColor;
+ newColor.R = crv->getColor().red()/255.;
+ newColor.G = crv->getColor().green()/255.;
+ newColor.B = crv->getColor().blue()/255.;
+ theCurve->SetColor( newColor );
+ crv->setAutoAssign( theCurve->IsAuto() );
+ }
+ }
+ }
+ }
+
+ //------------------------------------------------------------
+ void
+ PlotTable(SalomeApp_Study* theStudy,
+ Plot2d_ViewFrame* thePlot,
+ VISU::Table_i* table,
+ int theDisplaying)
+ {
+ if ( !thePlot )
+ return;
+
+ if ( theDisplaying == VISU::eDisplayOnly )
+ thePlot->EraseAll();
+ QList<Plot2d_Curve*> clist;
+ thePlot->getCurves( clist );
+ _PTR(Study) aStudy = theStudy->studyDS();
+ _PTR(SObject) TableSO = aStudy->FindObjectID( table->GetEntry() );
+ if ( TableSO ) {
+ _PTR(ChildIterator) Iter = aStudy->NewChildIterator( TableSO );
+ for ( ; Iter->More(); Iter->Next() ) {
+ CORBA::Object_var childObject = VISU::ClientSObjectToObject( Iter->Value() );
+ if( !CORBA::is_nil( childObject ) ) {
+ CORBA::Object_ptr aCurve = VISU::Curve::_narrow( childObject );
+ if( !CORBA::is_nil( aCurve ) ) {
+ VISU::Curve_i* theCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
+ SPlot2d_Curve* plotCurve = 0;
+ SPlot2d_Curve* tmpCurve;
+ for ( int i = 0; i < clist.count(); i++ ) {
+ tmpCurve = dynamic_cast<SPlot2d_Curve*>( clist.at( i ) );
+ if (tmpCurve && tmpCurve->hasIO() &&
+ theCurve->GetEntry() == tmpCurve->getIO()->getEntry()) {
+ plotCurve = tmpCurve;
+ break;
+ }
+ }
+
+ UpdateCurve( theCurve, thePlot, plotCurve, theDisplaying );
+ CurveVisibilityChanged(theCurve, theDisplaying, true, false, true);
+
+ if ( theDisplaying == VISU::eErase && plotCurve ) {
+ clist.removeAll(plotCurve );
+ }
+ }
+ }
+ }
+ thePlot->Repaint();
+ SetVisibilityState(table->GetEntry(),GetStateByDisplaying(theDisplaying));
+ }
+
+ }
+
+ //------------------------------------------------------------
+ void
+ PlotCurve(Plot2d_ViewFrame* thePlot,
+ VISU::Curve_i* theCurve,
+ int theDisplaying)
+ {
+ if ( !thePlot )
+ return;
+
+// if ( theDisplaying == VISU::eDisplayOnly )
+// thePlot->EraseAll();
+ QList<Plot2d_Curve*> clist;
+ thePlot->getCurves( clist );
+ SPlot2d_Curve* plotCurve = 0;
+ SPlot2d_Curve* tmpCurve;
+ if(theDisplaying == VISU::eErase) {
+ // 23.06.2008 skl for IPAL17672
+ for (int i = 0; i < clist.count(); i++) {
+ tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
+ if (tmpCurve && tmpCurve->hasIO() &&
+ theCurve->GetEntry() == tmpCurve->getIO()->getEntry()) {
+ plotCurve = tmpCurve;
+ thePlot->eraseCurve(clist.at(i));
+ break;
+ }
+ }
+ UpdateCurve(theCurve, thePlot, plotCurve, theDisplaying);
+ }
+ else {
+ for (int i = 0; i < clist.count(); i++) {
+ tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
+ if (tmpCurve && tmpCurve->hasIO() &&
+ theCurve->GetEntry() == tmpCurve->getIO()->getEntry()) {
+ plotCurve = tmpCurve;
+ }
+ else if (theDisplaying == VISU::eDisplayOnly) {
+ thePlot->eraseCurve(clist.at(i));
+ }
+ }
+ UpdateCurve(theCurve, thePlot, plotCurve, theDisplaying);
+ }
+
+ thePlot->Repaint();
+
+ SetVisibilityState(theCurve->GetEntry(),GetStateByDisplaying(theDisplaying));
+ CurveVisibilityChanged(theCurve,theDisplaying,false, true, true);
+ }
+
+ //------------------------------------------------------------
+ void
+ PlotRemoveCurve(SalomeApp_Application* theApp,
+ VISU::Curve_i* pCrv)
+ {
+ QString anEntry = pCrv->GetEntry().c_str();
+ ViewManagerList pvm_list;
+ theApp->viewManagers( SPlot2d_Viewer::Type(), pvm_list );
+ ViewManagerList::Iterator pvm_it = pvm_list.begin();
+ for( ; pvm_it != pvm_list.end(); pvm_it++ ){
+ Plot2d_ViewManager* pvm = dynamic_cast<Plot2d_ViewManager*>( *pvm_it );
+ if( pvm ){
+ SPlot2d_Viewer* aSPlot2d = dynamic_cast<SPlot2d_Viewer*>( pvm->getViewModel() );
+ if( aSPlot2d ){
+ Plot2d_ViewFrame* thePlot = aSPlot2d->getActiveViewFrame();
+ if(thePlot){
+ QList<Plot2d_Curve*> clist;
+ thePlot->getCurves( clist );
+ for (int i = 0; i < clist.count(); i++) {
+ if(SPlot2d_Curve* plotCurve = dynamic_cast<SPlot2d_Curve*>(clist[i]))
+ if(plotCurve->hasIO() && (plotCurve->getIO()->getEntry() == anEntry))
+ thePlot->eraseCurve(clist[i]);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ //------------------------------------------------------------
+ // Internal function used by the function below
+ SPlot2d_Curve* GetCurveByIO( const Handle(SALOME_InteractiveObject)& theIObject,
+ Plot2d_ViewFrame* thePlot )
+ {
+ if ( !theIObject.IsNull() && thePlot ) {
+ CurveDict aCurves = thePlot->getCurves();
+ CurveDict::Iterator it = aCurves.begin();
+ for( ; it != aCurves.end(); ++it ) {
+ SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>( it.value() );
+ if(aCurve) {
+ if ( aCurve->hasIO() && aCurve->getIO()->isSame( theIObject ) )
+ return aCurve;
+ }
+ }
+ }
+ return NULL;
+ }
+
+ //------------------------------------------------------------
+ void
+ PlotContainer(Plot2d_ViewFrame* thePlot,
+ VISU::Container_i* container,
+ int theDisplaying)
+ {
+ if ( !thePlot || !container)
+ return;
+
+ if ( theDisplaying == VISU::eDisplayOnly )
+ thePlot->EraseAll();
+ QList<Plot2d_Curve*> clist;
+ thePlot->getCurves( clist );
+ if ( container->GetNbCurves() > 0 ) {
+ int nbCurves = container->GetNbCurves();
+ SetVisibilityState(container->GetEntry(), GetStateByDisplaying(theDisplaying));
+ for ( int k = 1; k <= nbCurves; k++ ) {
+ VISU::Curve_i* theCurve = container->GetCurve( k );
+ if ( theCurve && theCurve->IsValid() ) {
+ SPlot2d_Curve* plotCurve = GetCurveByIO(new SALOME_InteractiveObject(theCurve->GetEntry().c_str(), "", ""), thePlot);
+
+ UpdateCurve( theCurve, thePlot, plotCurve, theDisplaying );
+
+ if ( plotCurve && theDisplaying == VISU::eErase ) {
+ clist.removeAll( plotCurve );
+ }
+ CurveVisibilityChanged(theCurve, theDisplaying, true, true, true);
+ }
+ }
+ }
+
+ thePlot->Repaint();
+ if(GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)){
+ thePlot->fitAll();
+ }
+
+ qApp->processEvents();
+ }
+
+ //------------------------------------------------------------
+ void
+ CreatePlot(VISU_Gen_i* theVisuGen,
+ Plot2d_ViewFrame* thePlot,
+ _PTR(SObject) theTableSO)
+ {
+ _PTR(GenericAttribute) anAttr;
+ if ( theTableSO &&
+ ( theTableSO->FindAttribute( anAttr, "AttributeTableOfInteger" ) ||
+ theTableSO->FindAttribute( anAttr, "AttributeTableOfReal" ) ) ) {
+ CORBA::Object_var aTable = VISU::ClientSObjectToObject(theTableSO);
+ CORBA::Object_var aContainer = theVisuGen->CreateContainer();
+
+ if ( !CORBA::is_nil( aTable ) && !CORBA::is_nil( aContainer ) ) {
+ VISU::Table_i* pTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
+ VISU::Container_i* pContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
+
+ if ( pContainer && pTable ) {
+ for ( int i = 2; i <= pTable->GetNbRows(); i++ ) {
+ CORBA::Object_var aNewCurve = theVisuGen->CreateCurve( pTable->_this(), 1, i );
+ if( !CORBA::is_nil( aNewCurve ) ) {
+ VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>( VISU::GetServant(aNewCurve).in() );
+ if ( pCrv ) {
+ pContainer->AddCurve( pCrv->_this() );
+ }
+ }
+ }
+ PlotContainer( thePlot, pContainer, VISU::eDisplay );
+
+ QString anEntry = pContainer->GetEntry().c_str();
+ _PTR(Study) aStudy = theTableSO->GetStudy();
+ _PTR(SObject) aContainerSO = aStudy->FindObjectID(anEntry.toLatin1().data());
+ _PTR(SObject) aParentSO = aContainerSO->GetFather();
+ }
+ }
+ }
+ }
+
+ //------------------------------------------------------------
+ void SetVisibilityState(std::string entry, Qtx::VisibilityState state) {
+ if(entry.empty())
+ return;
+
+ if( SUIT_Session* aSession = SUIT_Session::session() )
+ if( SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(aSession->activeApplication()) )
+ if( SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy()) )
+ aStudy->setVisibilityState(entry.c_str(), state);
+
+ }
+
+ //------------------------------------------------------------
+ void SetVisibilityState(SALOME_Actor *theActor, Qtx::VisibilityState state) {
+ if(!theActor || !theActor->hasIO() || !theActor->getIO()->hasEntry())
+ return;
+ SetVisibilityState(theActor->getIO()->getEntry(), state);
+ }
+
+ void CurveVisibilityChanged(VISU::Curve_i* theCurve,
+ int theDisplaying,
+ bool updateCurve,
+ bool updateTable,
+ bool updateContainers) {
+
+ SUIT_Session* aSession = SUIT_Session::session();
+ if (!aSession) return;
+
+ SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(aSession->activeApplication());
+ if ( !anApp ) return;
+
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() );
+ if ( !aStudy ) return;
+
+ SalomeApp_Module* aModule = dynamic_cast<SalomeApp_Module*>( anApp->module( anApp->moduleTitle( "VISU" ) ) );
+ if ( !aModule ) return;
+
+ LightApp_Displayer* aDisplayer = aModule->displayer();
+
+ SUIT_ViewManager* aManager = anApp->activeViewManager();
+
+ Qtx::VisibilityState state = ( aManager && aManager->getType() == SPlot2d_Viewer::Type() ) ?
+ GetStateByDisplaying(theDisplaying) : Qtx::UnpresentableState;
+
+ if ( updateCurve )
+ SetVisibilityState( theCurve->GetEntry(), state );
+
+ if ( updateTable ) {
+ Table_i* aTable = theCurve->getTable();
+ if ( aTable && !(aStudy->visibilityState( aTable->GetEntry().c_str() ) == state) ) {
+ _PTR(SObject) TableSO = aStudy->studyDS()->FindObjectID( aTable->GetEntry() );
+ if ( TableSO ) {
+ bool isTableVisible = false;
+ if ( aDisplayer && state != Qtx::UnpresentableState ) {
+ _PTR(ChildIterator) Iter = aStudy->studyDS()->NewChildIterator( TableSO );
+ for ( ; Iter->More() && !isTableVisible ; Iter->Next() ) {
+ CORBA::Object_var childObject = VISU::ClientSObjectToObject( Iter->Value() );
+ if ( CORBA::is_nil( childObject ) ) continue;
+ VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>( VISU::GetServant( childObject.in() ).in() );
+ isTableVisible = aCurve && aDisplayer->IsDisplayed( aCurve->GetEntry().c_str() );
+ }
+ } // if ( aDisplayer ... )
+ if ( state != Qtx::UnpresentableState )
+ SetVisibilityState( aTable->GetEntry(), ( isTableVisible ? Qtx::ShownState : Qtx::HiddenState ) );
+ else
+ SetVisibilityState( aTable->GetEntry(), state );
+ } // if ( TableSO )
+ } // if ( aTable )
+ } // if ( updateTable )
+
+ if ( updateContainers ) {
+ ContainerSet aContainers = theCurve->getContainers();
+ ContainerSet::ConstIterator it = aContainers.begin();
+ for ( ; it != aContainers.end(); it++ ) {
+ //Check that state of container is not set already
+ if(aStudy->visibilityState(*it) == state) continue;
+ _PTR(SObject) aSObject = aStudy->studyDS()->FindObjectID( (*it).toLatin1().data() );
+ if ( !aSObject ) continue;
+ bool isContainerDisplayed = false;
+ if ( aDisplayer && state != Qtx::UnpresentableState ) {
+ CORBA::Object_var anObj = VISU::ClientSObjectToObject( aSObject );
+ if ( CORBA::is_nil( anObj ) ) continue;
+ VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>( VISU::GetServant( anObj.in() ).in() );
+ if ( !aContainer ) continue;
+ int nbCurves = aContainer->GetNbCurves();
+ for ( int k = 1; k <= nbCurves && !isContainerDisplayed; k++ ) {
+ VISU::Curve_i* aCurve = aContainer->GetCurve( k );
+ isContainerDisplayed = aCurve && aDisplayer->IsDisplayed( aCurve->GetEntry().c_str() );
+ }
+ } // if ( aDisplayer ... )
+ if ( state != Qtx::UnpresentableState )
+ SetVisibilityState( (*it).toLatin1().constData(), ( isContainerDisplayed ? Qtx::ShownState : Qtx::HiddenState ) );
+ else {
+ SetVisibilityState( (*it).toLatin1().constData(), state );
+ }
+ } // for ( ; it != aContainers.end(); it++ )
+ } //updateContainers
+ }
+
+ Qtx::VisibilityState GetStateByDisplaying(int theDisplaying)
+ {
+ Qtx::VisibilityState state = Qtx::UnpresentableState;
+ if(theDisplaying == eDisplayAll ||
+ theDisplaying == eDisplay ||
+ theDisplaying == eDisplayOnly ) {
+ state = Qtx::ShownState;
+
+ } else if (theDisplaying == eErase || theDisplaying == eEraseAll) {
+ state = Qtx::HiddenState;
+ }
+ return state;
+ }
+
+ void updateContainerVisibility(VISU::Container_i* theContainer)
+ {
+ if ( !theContainer ) return;
+
+ SUIT_Session* aSession = SUIT_Session::session();
+ if (!aSession) return;
+
+ SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(aSession->activeApplication());
+ if ( !anApp ) return;
+
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() );
+ if ( !aStudy ) return;
+
+ SalomeApp_Module* aModule = dynamic_cast<SalomeApp_Module*>( anApp->module( anApp->moduleTitle( "VISU" ) ) );
+ if ( !aModule ) return;
+
+ SUIT_ViewManager* aManager = anApp->activeViewManager();
+ int nbCurves = theContainer->GetNbCurves();
+
+ Qtx::VisibilityState state = ( aManager && aManager->getType() == SPlot2d_Viewer::Type() && nbCurves > 0 ) ?
+ Qtx::HiddenState : Qtx::UnpresentableState;
+
+ LightApp_Displayer* aDisplayer = aModule->displayer();
+
+ if ( nbCurves > 0 && aDisplayer ) {
+ for ( int k = 1; k <= nbCurves; k++ ) {
+ VISU::Curve_i* aCurve = theContainer->GetCurve( k );
+ if ( aCurve && aDisplayer->IsDisplayed( aCurve->GetEntry().c_str() ) ) {
+ state = Qtx::ShownState;
+ break;
+ }
+ }
+ }
+ aStudy->setVisibilityState( theContainer->GetEntry().c_str(), state );
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : VISU_Tools.h
+// Author : Oleg UVAROV
+// Module : VISU
+//
+#ifndef VISU_TOOLS_H
+#define VISU_TOOLS_H
+
+#include "VISUConfig.hh"
+#include "VISU_I.hxx"
+
+#include <Qtx.h>
+
+#include <SALOMEDSClient_Study.hxx>
+
+class SPlot2d_Curve;
+class Plot2d_ViewFrame;
+class SalomeApp_Study;
+class SalomeApp_Application;
+class VISU_ActorBase;
+class SALOME_Actor;
+
+namespace VISU
+{
+ class Gen_i;
+ class Table_i;
+ class Curve_i;
+ class Container_i;
+
+ /*! Display/Erase/Update a curve presentation.
+ * Parameter \a frame may be NULL, in this case there is only update without display/erase
+ */
+ VISU_I_EXPORT void UpdateCurve( VISU::Curve_i*,
+ Plot2d_ViewFrame*,
+ SPlot2d_Curve*,
+ int theDisplaying );
+
+ VISU_I_EXPORT void PlotTable( SalomeApp_Study*,
+ Plot2d_ViewFrame*,
+ VISU::Table_i*,
+ int theDisplaying );
+
+ VISU_I_EXPORT void PlotCurve( Plot2d_ViewFrame*,
+ VISU::Curve_i*,
+ int theDisplaying );
+
+ VISU_I_EXPORT void PlotRemoveCurve(SalomeApp_Application*,
+ VISU::Curve_i* );
+
+ VISU_I_EXPORT void PlotContainer( Plot2d_ViewFrame*,
+ VISU::Container_i*,
+ int theDisplaying );
+
+ VISU_I_EXPORT void CreatePlot( VISU_Gen_i*,
+ Plot2d_ViewFrame*,
+ _PTR(SObject) theTableSO );
+
+ VISU_I_EXPORT void SetVisibilityState(std::string entry, Qtx::VisibilityState state);
+ VISU_I_EXPORT void SetVisibilityState(SALOME_Actor *theActor, Qtx::VisibilityState state);
+
+ VISU_I_EXPORT void CurveVisibilityChanged(VISU::Curve_i* theCurve,
+ int theDisplaying,
+ bool updateCurve,
+ bool updateTable,
+ bool updateContainers);
+
+ VISU_I_EXPORT Qtx::VisibilityState GetStateByDisplaying(int theDisplaying);
+ VISU_I_EXPORT void updateContainerVisibility(VISU::Container_i* theContainer);
+}
+
+#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Vectors_i.cc
// Author : Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_PrsObject_i.hxx
// Author : Alexey PETROV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ViewManager_i.cc
// Author : Alexey PETROV
#include "VISU_View_i.hh"
#include "VISU_Prs3d_i.hh"
#include "VISU_Table_i.hh"
+#include "VISU_Tools.h"
#include "VISU_Actor.h"
#include "VISU_ActorFactory.h"
#include "SVTK_ViewWindow.h"
#include "SVTK_ViewModel.h"
+#include "VTKViewer_Algorithm.h"
#include "SPlot2d_Curve.h"
+#include "SPlot2d_ViewModel.h"
#include "Plot2d_ViewFrame.h"
#include "Plot2d_ViewWindow.h"
#include "Plot2d_ViewModel.h"
+#include "Plot2d_ViewManager.h"
#include "SalomeApp_Study.h"
#include "SalomeApp_Application.h"
QList<SUIT_Application*> anApplications = aSession->applications();
QList<SUIT_Application*>::Iterator anIter = anApplications.begin();
while ( anIter != anApplications.end() ) {
- SUIT_Application* anApp = *anIter;
- if (SUIT_Study* aSStudy = anApp->activeStudy()) {
- if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
+ SUIT_Application* anApp = *anIter;
+ if (SUIT_Study* aSStudy = anApp->activeStudy()) {
+ if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
if (_PTR(Study) aCStudy = aStudy->studyDS()) {
//if (myStudyName == aCStudy->Name()) {
if (myStudyId == aCStudy->StudyId()) {
- myResult = dynamic_cast<SalomeApp_Application*>(anApp);
- break;
- }
- }
- }
- }
- anIter++;
+ myResult = dynamic_cast<SalomeApp_Application*>(anApp);
+ break;
+ }
+ }
+ }
+ }
+ anIter++;
}
if (!myResult) {
//MESSAGE("Error: application is not found for study : " << myStudyName);
{
VISU::View3D_i* aView = new View3D_i (myApplication);
if (aView->Create(0))
- myResult = aView->_this();
+ myResult = aView->_this();
}
};
{
//if (CheckStudy(myStudyDocument)) {
if (myApplication) {
- TViewFrame* pView = new TViewFrame (myApplication);
- if (pView->Create(1)) {
- myResult = pView->_this();
- qApp->processEvents(); // Fix for bug 9929
- }
+ TViewFrame* pView = new TViewFrame (myApplication);
+ if (pView->Create(1)) {
+ myResult = pView->_this();
+ qApp->processEvents(); // Fix for bug 9929
+ }
}
}
};
Table_ptr myTable;
public:
TCreateTableViewFrameEvent (SalomeApp_Application* theApplication,
- Table_ptr theTable):
+ Table_ptr theTable):
TCreateViewEvent(theApplication),
myTable(theTable),
myResult(VISU::TableView::_nil())
virtual void Execute()
{
//if (CheckStudy(myStudyDocument)) {
- VISU::TableView_i* pView = new TableView_i (myApplication);
- if (pView->Create(myTable) != NULL)
- myResult = pView->_this();
+ VISU::TableView_i* pView = new TableView_i (myApplication);
+ if (pView->Create(myTable) != NULL)
+ myResult = pView->_this();
//}
}
typedef VISU::TableView_ptr TResult;
View_ptr myView;
public:
TEvent(View_ptr theView):
- myView(theView)
+ myView(theView)
{}
virtual void Execute(){
- if (!CORBA::is_nil(myView)) {
- if (VISU::View_i* pView = dynamic_cast<VISU::View_i*>(VISU::GetServant(myView).in())) {
- pView->Close();
- pView->_remove_ref();
- }
- }
+ if (!CORBA::is_nil(myView)) {
+ if (VISU::View_i* pView = dynamic_cast<VISU::View_i*>(VISU::GetServant(myView).in())) {
+ pView->Close();
+ pView->_remove_ref();
+ }
+ }
}
};
if (!vf) return NULL;
if(MYDEBUG) MESSAGE("UpdateViewer - theDisplaing = "<<theDisplaing<<"; thePrs = "<<thePrs);
vtkRenderer *aRen = vf->getRenderer();
- vtkActorCollection *anActColl = aRen->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRen->GetActors());
+ vtkActorCollection* anActColl = aCopy.GetActors();
vtkActor *anActor;
VISU_Actor *anVISUActor = NULL, *aResActor = NULL;
- for(anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL;){
- if(anActor->IsA("VISU_Actor")){
- anVISUActor = VISU_Actor::SafeDownCast(anActor);
- if (thePrs == anVISUActor->GetPrs3d()) {
- aResActor = anVISUActor;
- if(theDisplaing < eErase)
- aResActor->VisibilityOn();
- else
- aResActor->VisibilityOff();
- } else {
- if(theDisplaing > eDisplay)
- anVISUActor->VisibilityOff();
- else
- anVISUActor->VisibilityOn();
+ for(anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL;) {
+ if( anActor->IsA("VISU_Actor") ) {
+ anVISUActor = VISU_Actor::SafeDownCast(anActor);
+ if (thePrs == anVISUActor->GetPrs3d()) {
+ aResActor = anVISUActor;
+ if(theDisplaing < eErase) {
+ aResActor->VisibilityOn();
+ VISU::SetVisibilityState(aResActor, Qtx::ShownState);
+ }
+ else {
+ aResActor->VisibilityOff();
+ VISU::SetVisibilityState(aResActor, Qtx::HiddenState);
+ }
+ } else {
+ if(theDisplaing == eEraseAll || theDisplaing == eDisplayOnly) {
+ anVISUActor->VisibilityOff();
+ VISU::SetVisibilityState(anVISUActor, Qtx::HiddenState);
+ }
+ else if ( theDisplaing == eDisplayAll ) {
+ anVISUActor->VisibilityOn();
+ VISU::SetVisibilityState(anVISUActor, Qtx::ShownState);
+ }
+ }
+ } else if ( anActor->IsA("SALOME_Actor") && (theDisplaing == eEraseAll || theDisplaing == eDisplayOnly) ) {
+ // rnv : fix for the 21254: EDF 1861 VISU: Eye symbol and VISU presentations.
+ // Take into account presentations created in other modules.
+ SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(anActor);
+ if( aSActor ) {
+ aSActor->VisibilityOff();
+ VISU::SetVisibilityState(aSActor, Qtx::HiddenState);
}
}
}
+
if (aResActor) {
RepaintView(theViewWindow);
return aResActor;
}
- if(thePrs != NULL && theDisplaing < eErase){
+ if(thePrs != NULL && theDisplaing < eErase) {
try{
- anVISUActor = thePrs->CreateActor();
- vf->AddActor(anVISUActor);
+ anVISUActor = thePrs->CreateActor();
+ vf->AddActor(anVISUActor);
+ VISU::SetVisibilityState(anVISUActor, Qtx::ShownState);
}catch(std::exception& exc){
- if(MYDEBUG) INFOS(exc.what());
- return NULL;
+ if(MYDEBUG) INFOS(exc.what());
+ return NULL;
}catch(...){
- if(MYDEBUG) INFOS("Unknown exception was occured!!!");
- return NULL;
+ if(MYDEBUG) INFOS("Unknown exception was occured!!!");
+ return NULL;
}
}
RepaintView(theViewWindow);
return anVISUActor;
}
- void UpdatePlot2d (Plot2d_ViewFrame *theView,int theDisplaying, Curve_i* theCurve)
+ struct TUpdatePlot2dEvent: public SALOME_Event
+ {
+ Curve_i* myCurve;
+ int myDisplaying;
+
+ TUpdatePlot2dEvent (Curve_i* theCurve, const int theDisplaying):
+ myCurve(theCurve),
+ myDisplaying(theDisplaying)
+ {}
+
+ virtual void Execute()
+ {
+ SalomeApp_Application* anApp = NULL;
+ CORBA::String_var studyName = myCurve->GetStudyDocument()->Name();
+ std::string aStudyName = studyName.in();
+ SUIT_Session* aSession = SUIT_Session::session();
+ QList<SUIT_Application*> anApplications = aSession->applications();
+ QList<SUIT_Application*>::Iterator anIter = anApplications.begin();
+ while (anIter != anApplications.end()) {
+ SUIT_Application* aSUITApp = *anIter;
+ if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) {
+ if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
+ if (_PTR(Study) aCStudy = aStudy->studyDS()) {
+ if (aStudyName == aCStudy->Name()) {
+ anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
+ break;
+ }
+ }
+ }
+ }
+ anIter++;
+ }
+ if (!anApp)
+ return;
+
+ ViewManagerList aViewManagerList;
+ anApp->viewManagers(SPlot2d_Viewer::Type(), aViewManagerList);
+ SUIT_ViewManager* aViewManager;
+ foreach( aViewManager, aViewManagerList ) {
+ if (Plot2d_ViewManager* aManager = dynamic_cast<Plot2d_ViewManager*>(aViewManager)) {
+ if (SPlot2d_Viewer* aViewer = dynamic_cast<SPlot2d_Viewer*>(aManager->getViewModel())) {
+ if (Plot2d_ViewFrame* aViewFrame = aViewer->getActiveViewFrame()) {
+ UpdatePlot2d(myCurve, myDisplaying, aViewFrame);
+ }
+ }
+ }
+ }
+ }
+ };
+
+ void UpdatePlot2d (Curve_i* theCurve, int theDisplaying, Plot2d_ViewFrame* theView)
{
if(MYDEBUG) MESSAGE("UpdatePlot2d - theDisplaying = " << theDisplaying);
- if (!theView)
+ if (!theView) {
+ // update all views
+ ProcessVoidEvent(new TUpdatePlot2dEvent(theCurve, theDisplaying));
return;
+ }
QList<Plot2d_Curve*> clist;
theView->getCurves(clist);
if (theDisplaying == eEraseAll) {
for (int i = 0; i < clist.count(); i++) {
- if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing all : curve - " << clist.at(i));
- theView->eraseCurve(clist.at(i));
+ if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing all : curve - " << clist.at(i));
+ theView->eraseCurve(clist.at(i));
}
} else if (theDisplaying == eErase) {
if (theCurve) {
- for (int i = 0; i < clist.count(); i++) {
- SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
- if (aSPlot2dC->hasIO() &&
- !strcmp(theCurve->GetEntry().c_str(), aSPlot2dC->getIO()->getEntry())) {
- if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing : curve - " << aSPlot2dC);
- theView->eraseCurve(aSPlot2dC);
- }
- }
- }
- } else if (theDisplaying == eDisplay) {
- if (theCurve) {
- bool bFound = false;
- for (int i = 0; i < clist.count(); i++) {
- SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
- if (aSPlot2dC->hasIO() &&
- !strcmp(theCurve->GetEntry().c_str(), aSPlot2dC->getIO()->getEntry())) {
- if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve - " << aSPlot2dC);
- aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
- aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
- aSPlot2dC->setHorUnits( theCurve->GetHorUnits().c_str() );
- aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
- double* xList = 0;
- double* yList = 0;
- QStringList zList;
- int nbPoints = theCurve->GetData( xList, yList, zList );
- if (nbPoints > 0 && xList && yList) {
- aSPlot2dC->setData( xList, yList, nbPoints, zList );
- }
- if (!theCurve->IsAuto()) {
- aSPlot2dC->setLine((Plot2d::LineType)theCurve->GetLine(),
- theCurve->GetLineWidth());
- aSPlot2dC->setMarker((Plot2d::MarkerType)theCurve->GetMarker());
- SALOMEDS::Color color = theCurve->GetColor();
- aSPlot2dC->setColor(QColor((int)(color.R*255.),
- (int)(color.G*255.),
- (int)(color.B*255.)));
- }
- aSPlot2dC->setAutoAssign(theCurve->IsAuto());
- theView->displayCurve(aSPlot2dC);
- bFound = true;
- }
- }
- if (!bFound) {
- Plot2d_Curve* crv = theCurve->CreatePresentation();
- if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve (new) - "<<crv );
- if (crv) {
- theView->displayCurve( crv );
- theCurve->SetLine( (VISU::Curve::LineType)crv->getLine(), crv->getLineWidth() );
- theCurve->SetMarker( (VISU::Curve::MarkerType)crv->getMarker());
- SALOMEDS::Color newColor;
- newColor.R = crv->getColor().red()/255.;
- newColor.G = crv->getColor().green()/255.;
- newColor.B = crv->getColor().blue()/255.;
- theCurve->SetColor( newColor );
- crv->setAutoAssign( theCurve->IsAuto() );
- }
- }
+ for (int i = 0; i < clist.count(); i++) {
+ SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
+ if (aSPlot2dC->hasIO() &&
+ !strcmp(theCurve->GetEntry().c_str(), aSPlot2dC->getIO()->getEntry())) {
+ if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing : curve - " << aSPlot2dC);
+ theView->eraseCurve(aSPlot2dC);
+ }
+ }
}
- } else if (theDisplaying == eDisplayOnly) {
+ } else if (theDisplaying == eDisplay ||
+ theDisplaying == eDisplayOnly ||
+ theDisplaying == eUpdateData) {
if (theCurve) {
- bool bFound = false;
- for (int i = 0; i < clist.count(); i++) {
- SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
- if (aSPlot2dC->hasIO() &&
- !strcmp(theCurve->GetEntry().c_str(), aSPlot2dC->getIO()->getEntry())) {
- if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve - " << aSPlot2dC);
- aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
- aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
- aSPlot2dC->setHorUnits( theCurve->GetHorUnits().c_str() );
- aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
- double* xList = 0;
- double* yList = 0;
- QStringList zList;
- int nbPoints = theCurve->GetData( xList, yList, zList );
- if ( nbPoints > 0 && xList && yList ) {
- aSPlot2dC->setData( xList, yList, nbPoints, zList );
- }
- if ( !theCurve->IsAuto() ) {
- aSPlot2dC->setLine((Plot2d::LineType)theCurve->GetLine(), theCurve->GetLineWidth());
- aSPlot2dC->setMarker((Plot2d::MarkerType)theCurve->GetMarker());
- SALOMEDS::Color color = theCurve->GetColor();
- aSPlot2dC->setColor(QColor((int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.)));
- }
- aSPlot2dC->setAutoAssign(theCurve->IsAuto());
- theView->displayCurve(aSPlot2dC);
- bFound = true;
- } else {
- theView->eraseCurve(aSPlot2dC);
- }
- }
- if (!bFound) {
- Plot2d_Curve* crv = theCurve->CreatePresentation();
- if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve (new) - " << crv);
- if (crv) {
- theView->displayCurve(crv);
- theCurve->SetLine((VISU::Curve::LineType)crv->getLine(), crv->getLineWidth());
- theCurve->SetMarker((VISU::Curve::MarkerType)crv->getMarker());
- SALOMEDS::Color newColor;
- newColor.R = crv->getColor().red()/255.;
- newColor.G = crv->getColor().green()/255.;
- newColor.B = crv->getColor().blue()/255.;
- theCurve->SetColor(newColor);
- crv->setAutoAssign(theCurve->IsAuto());
- }
- }
+ bool bFound = false;
+ for (int i = 0; i < clist.count(); i++) {
+ SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
+ if (aSPlot2dC->hasIO() &&
+ !strcmp(theCurve->GetEntry().c_str(), aSPlot2dC->getIO()->getEntry())) {
+ if (theDisplaying == eUpdateData) {
+ if(MYDEBUG) MESSAGE("UpdatePlot2d - updating data : curve - " << aSPlot2dC);
+ aSPlot2dC->setScale(theCurve->GetScale());
+ }
+ else {
+ if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve - " << aSPlot2dC);
+ }
+ double* xList = 0;
+ double* yList = 0;
+ QStringList zList;
+ int nbPoints = theCurve->GetData( xList, yList, zList );
+ if (nbPoints > 0 && xList && yList) {
+ aSPlot2dC->setData( xList, yList, nbPoints, zList );
+ }
+ if (theDisplaying == eUpdateData) {
+ theView->updateCurve(aSPlot2dC, true);
+ } else {
+ aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
+ aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
+ aSPlot2dC->setHorUnits( theCurve->GetHorUnits().c_str() );
+ aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
+ if (!theCurve->IsAuto()) {
+ aSPlot2dC->setLine((Plot2d::LineType)theCurve->GetLine(),
+ theCurve->GetLineWidth());
+ aSPlot2dC->setMarker((Plot2d::MarkerType)theCurve->GetMarker());
+ SALOMEDS::Color color = theCurve->GetColor();
+ aSPlot2dC->setColor(QColor((int)(color.R*255.),
+ (int)(color.G*255.),
+ (int)(color.B*255.)));
+ }
+ aSPlot2dC->setAutoAssign(theCurve->IsAuto());
+ theView->displayCurve(aSPlot2dC);
+ bFound = true;
+ }
+ } else if (theDisplaying == eDisplayOnly) {
+ theView->eraseCurve(aSPlot2dC);
+ }
+ }
+ if (!bFound && theDisplaying != eUpdateData) {
+ Plot2d_Curve* crv = theCurve->CreatePresentation();
+ if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve (new) - "<<crv );
+ if (crv) {
+ theView->displayCurve( crv );
+ theCurve->SetLine( (VISU::Curve::LineType)crv->getLine(), crv->getLineWidth() );
+ theCurve->SetMarker( (VISU::Curve::MarkerType)crv->getMarker());
+ SALOMEDS::Color newColor;
+ newColor.R = crv->getColor().red()/255.;
+ newColor.G = crv->getColor().green()/255.;
+ newColor.B = crv->getColor().blue()/255.;
+ theCurve->SetColor( newColor );
+ crv->setAutoAssign( theCurve->IsAuto() );
+ }
+ }
}
}
}
return NULL;
vtkRenderer* aRenderer = theViewWindow->getRenderer();
- vtkActorCollection* anActors = aRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection* anActors = aCopy.GetActors();
return SVTK::Find<VISU_Actor>(anActors, VISU::TIsSamePrs3d(thePrs3d));
}
return NULL;
vtkRenderer* aRenderer = theViewWindow->getRenderer();
- vtkActorCollection* anActors = aRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection* anActors = aCopy.GetActors();
return SVTK::Find<VISU_ActorBase>(anActors, VISU::TIsSameActor(theActor));
}
QList<SUIT_Application*> anApplications = aSession->applications();
QList<SUIT_Application*>::Iterator anIter = anApplications.begin();
while ( anIter != anApplications.end() ) {
- SUIT_Application* aSUITApp = *anIter;
- if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) {
+ SUIT_Application* aSUITApp = *anIter;
+ if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) {
if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
if (_PTR(Study) aCStudy = aStudy->studyDS()) {
if (aStudyName == aCStudy->Name()) {
anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
- break;
- }
- }
- }
+ break;
+ }
+ }
+ }
}
- anIter++;
+ anIter++;
}
if (!anApp)
return;
QList<SUIT_ViewManager*>::Iterator anVMIter = aViewManagerList.begin();
for (; anVMIter != aViewManagerList.end(); anVMIter++ ) {
SUIT_ViewManager* aViewManager = *anVMIter;
- QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
- if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
- if (Plot2d_ViewWindow* vw = dynamic_cast<Plot2d_ViewWindow*>(aViewWindow)) {
+ QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+ for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
+ if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
+ if (Plot2d_ViewWindow* vw = dynamic_cast<Plot2d_ViewWindow*>(aViewWindow)) {
Plot2d_ViewFrame* vf = vw->getViewFrame();
- QList<Plot2d_Curve*> clist;
- vf->getCurves(clist);
- for (int i = 0; i < clist.count(); i++) {
+ QList<Plot2d_Curve*> clist;
+ vf->getCurves(clist);
+ for (int i = 0; i < clist.count(); i++) {
if (SPlot2d_Curve* cu = dynamic_cast<SPlot2d_Curve*>(clist.at(i))) {
- if (cu->hasIO() &&
- strcmp(myPrs->GetEntry().c_str(), cu->getIO()->getEntry())) {
- vf->eraseCurve(cu);
- }
- }
- }
- vf->Repaint();
- //jfa tmp:aViewFrame->unHighlightAll();
+ if (cu->hasIO() &&
+ strcmp(myPrs->GetEntry().c_str(), cu->getIO()->getEntry())) {
+ vf->eraseCurve(cu);
+ }
+ }
+ }
+ vf->Repaint();
+ //jfa tmp:aViewFrame->unHighlightAll();
}
}
}
if (_PTR(Study) aCStudy = aStudy->studyDS()) {
if (aStudyName == aCStudy->Name()) {
anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
- break;
- }
- }
- }
+ break;
+ }
+ }
+ }
}
}
if (!anApp)
SUIT_ViewManager* aViewManager = anVMIter.current();
QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
- if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
- if (Plot2d_ViewWindow* vw = dynamic_cast<Plot2d_ViewWindow*>(aViewWindow)) {
+ if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
+ if (Plot2d_ViewWindow* vw = dynamic_cast<Plot2d_ViewWindow*>(aViewWindow)) {
Plot2d_ViewFrame* vf = vw->getViewFrame();
QList<Plot2d_Curve> clist;
vf->getCurves(clist);
- for (int i = 0; i < clist.count(); i++) {
+ for (int i = 0; i < clist.count(); i++) {
if (SPlot2d_Curve* cu = dynamic_cast<SPlot2d_Curve*>(clist.at(i))) {
- if (cu->hasIO() &&
- strcmp(cu->getIO()->getEntry(), thePrs->GetEntry()) == 0) {
- vf->eraseCurve(cu);
- }
- }
- }
- vf->Repaint();
- //jfa tmp:aViewFrame->unHighlightAll();
+ if (cu->hasIO() &&
+ strcmp(cu->getIO()->getEntry(), thePrs->GetEntry()) == 0) {
+ vf->eraseCurve(cu);
+ }
+ }
+ }
+ vf->Repaint();
+ //jfa tmp:aViewFrame->unHighlightAll();
}
}
}
if (_PTR(Study) aCStudy = aStudy->studyDS()) {
if (aStudyName == aCStudy->Name()) {
anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
- break;
- }
- }
- }
+ break;
+ }
+ }
+ }
}
anIter++;
}
SUIT_ViewManager* aViewManager = *anVMIter;
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
- if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
- if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
+ if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
+ if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
VISU_Actor* anActor = NULL;
- vtkActorCollection *anActColl = vw->getRenderer()->GetActors();
- anActColl->InitTraversal();
+ VTK::ActorCollectionCopy aCopy(vw->getRenderer()->GetActors());
+ vtkActorCollection *anActColl = aCopy.GetActors();
+ anActColl->InitTraversal();
vtkActor *aVTKActor = anActColl->GetNextActor();
- for (; !anActor && aVTKActor; aVTKActor = anActColl->GetNextActor()) {
+ for (; !anActor && aVTKActor; aVTKActor = anActColl->GetNextActor()) {
if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(aVTKActor)) {
- if (thePrs == anVISUActor->GetPrs3d()) {
- anActor = anVISUActor;
+ if (thePrs == anVISUActor->GetPrs3d()) {
+ anActor = anVISUActor;
}
}
}
if (anActor) {
- vw->RemoveActor(anActor);
+ vw->RemoveActor(anActor);
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ViewManager_i.hh
// Author : Alexey PETROV
void RepaintView (SUIT_ViewWindow* theViewWindow);
- enum Displaing {eDisplayAll, eDisplay, eDisplayOnly, eErase, eEraseAll};
+ enum Displaing {eDisplayAll, eDisplay, eDisplayOnly, eErase, eEraseAll, eUpdateData};
VISU_I_EXPORT VISU_Actor* UpdateViewer (SUIT_ViewWindow* theViewWindow, int theDisplaing, Prs3d_i* thePrs = NULL);
- void UpdatePlot2d (Plot2d_ViewFrame *theView, int theDisplaying, Curve_i* theCurve);
+ void UpdatePlot2d (Curve_i* theCurve, int theDisplaying, Plot2d_ViewFrame* theView = NULL);
VISU_I_EXPORT VISU_Actor* FindActor(SVTK_ViewWindow* theViewWindow, VISU::Prs3d_i* thePrs3d);
VISU_I_EXPORT VISU_ActorBase* FindActorBase(SVTK_ViewWindow* theViewWindow, VISU::TActorFactory* theActor);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_View_i.cc
// Author : Alexey PETROV
// Module : VISU
//
#include "VISU_View_i.hh"
+#include "VISU_Tools.h"
#include "VISU_Gen_i.hh"
#include "VISU_Prs3d_i.hh"
#include "VISU_PointMap3d_i.hh"
#include "VISU_ScalarMap_i.hh"
#include "VISU_ViewManager_i.hh"
-
-#include "VisuGUI_TableDlg.h"
+#include "VISU_TableDlg.h"
#include "VISU_Actor.h"
#include "VISU_ScalarMapAct.h"
#include "SVTK_ViewWindow.h"
#include "SVTK_ViewModel.h"
+#include "VTKViewer_Algorithm.h"
#include "SPlot2d_ViewModel.h"
#include "Plot2d_ViewFrame.h"
ProcessVoidEvent(new TVoidMemFunEvent<Plot2d_ViewFrame>(myView,&Plot2d_ViewFrame::Repaint));
}
+ struct TCloseViewEvent: public SALOME_Event
+ {
+ SUIT_ViewWindow* myView;
+ TCloseViewEvent (SUIT_ViewWindow* theView):
+ myView(theView)
+ {}
+
+ virtual void Execute()
+ {
+ if ( myView ) myView->close();
+ }
+ };
+
void XYPlot_i::Close()
{
- //jfa: may be need to be enclosed in SALOME_Event?
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- aVW->close();
- //QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
- //int aPos = aViews.find(myViewWindow);
- //if (aPos >= 0)
- // myViewWindow->close();
+ ProcessVoidEvent(new TCloseViewEvent(GetViewWindow()));
+ QApplication::sendPostedEvents();
}
XYPlot_i::~XYPlot_i() {
virtual void Execute()
{
+ Qtx::VisibilityState state = (myDisplaing == eDisplay ||myDisplaing == eDisplayOnly) ?
+ Qtx::ShownState : Qtx::HiddenState;
// is it Curve ?
if (Curve_i* aCurve = dynamic_cast<Curve_i*>(VISU::GetServant(myPrsObj).in())) {
- UpdatePlot2d(myView,myDisplaing,aCurve);
+ UpdatePlot2d(aCurve,myDisplaing,myView);
+ VISU::SetVisibilityState(aCurve->GetEntry(),state);
+ VISU::CurveVisibilityChanged(aCurve, myDisplaing , false, true, true);
}
// is it Container ?
if (Container_i* aContainer = dynamic_cast<Container_i*>(VISU::GetServant(myPrsObj).in())) {
+ VISU::SetVisibilityState(aContainer->GetEntry(),state);
int nbCurves = aContainer->GetNbCurves();
for ( int i = 1; i <= nbCurves; i++ ) {
VISU::Curve_i* aCurve = aContainer->GetCurve( i );
if ( aCurve && aCurve->IsValid() ) {
- UpdatePlot2d(myView,myDisplaing,aCurve);
+ UpdatePlot2d(aCurve,myDisplaing,myView);
+ VISU::CurveVisibilityChanged(aCurve, myDisplaing , true, true, true);
}
}
myView->Repaint();
CORBA::Object_var childObject = VISU::ClientSObjectToObject(Iter->Value());
if (!CORBA::is_nil(childObject)) {
CORBA::Object_ptr aCurve = VISU::Curve::_narrow(childObject);
- if (!CORBA::is_nil(aCurve))
- UpdatePlot2d(myView, myDisplaing,
- dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in()));
+ if (!CORBA::is_nil(aCurve)) {
+ Curve_i* crv = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
+ UpdatePlot2d(crv, myDisplaing, myView);
+ VISU::CurveVisibilityChanged(crv, myDisplaing , true, false, true);
+ }
}
}
myView->Repaint();
+ VISU::SetVisibilityState(aTable->GetEntry(),state);
}
}
}
SalomeApp_Application* myApplication;
VISU::Table_i* myTable;
- typedef VisuGUI_TableDlg* TResult;
+ typedef VISU_TableDlg* TResult;
TResult myResult;
TCreateTableViewEvent (SalomeApp_Application* theApplication,
if (SUIT_Study* aSStudy = myApplication->activeStudy()) {
if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
if (_PTR(Study) aCStudy = aStudy->studyDS()) {
- _PTR(SObject) aSObject = aCStudy->FindObjectID(myTable->GetObjectEntry());
- if (aSObject) {
- myResult = new VisuGUI_TableDlg (myApplication->desktop(),
- aSObject,
- false,
- VisuGUI_TableDlg::ttAuto,
- Qt::Vertical);
- myResult->show();
- }
+ myResult = new VISU_TableDlg (myApplication->desktop(),
+ aCStudy,
+ myTable,
+ false,
+ VISU_TableDlg::ttAuto,
+ Qt::Vertical);
+ myResult->show();
}
}
}
void TableView_i::SetTitle (const char* theTitle)
{
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VisuGUI_TableDlg,const QString&,QString>
- (myView, &VisuGUI_TableDlg::setWindowTitle, QString(theTitle)));
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_TableDlg,const QString&,QString>
+ (myView, &VISU_TableDlg::setWindowTitle, QString(theTitle)));
}
char* TableView_i::GetTitle()
{
SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(myViewWindow);
vtkRenderer* aRenderer = aViewWindow->getRenderer();
- vtkActorCollection* anActors = aRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection* anActors = aCopy.GetActors();
anActors->InitTraversal();
while (vtkActor *anAct = anActors->GetNextActor()) {
if (VISU_ActorBase* anActor = dynamic_cast<VISU_ActorBase*>(anAct)) {
void View3D_i::Close()
{
- //jfa: may be need to be enclosed in SALOME_Event?
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- aVW->close();
- //QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
- //int aPos = aViews.find(myViewWindow);
- //if (aPos >= 0)
- // myViewWindow->close();
+ ProcessVoidEvent(new TCloseViewEvent(GetViewWindow()));
+ QApplication::sendPostedEvents();
}
-
+
View3D_i::~View3D_i()
{
if(MYDEBUG) MESSAGE("View3D_i::~View3D_i");
myResult("Unknown error occured")
{}
virtual void Execute() {
+ VISU::VISUType aType = myPrs->GetType();
switch (myPrsType) {
case VISU::INSIDEFRAME:
{
- VISU::VISUType aType = myPrs->GetType();
if (aType != VISU::TSCALARMAP &&
aType != VISU::TDEFORMEDSHAPE &&
aType != VISU::TSCALARMAPONDEFORMEDSHAPE &&
}
break;
case VISU::SURFACEFRAME:
- myResult = "Surfaceframe representation is available only for mesh presentation.";
- return;
+ {
+ if (aType != VISU::TSCALARMAP &&
+ aType != VISU::TDEFORMEDSHAPE &&
+ aType != VISU::TSCALARMAPONDEFORMEDSHAPE &&
+ aType != VISU::TDEFORMEDSHAPEANDSCALARMAP &&
+ aType != VISU::TCUTPLANES &&
+ aType != VISU::TISOSURFACES &&
+ aType != VISU::TPLOT3D) {
+ myResult = "Surfaceframe representation is not available for this type of presentations.";
+ return;
+ }
+ }
+ break;
case VISU::SHRINK:
myResult = "Use SetShrinked() method to shrink/unshrink presentation.";
return;
}
};
+ class TSetQuadratic2DPresentationTypeEvent: public TPrsManageEvent {
+ private:
+ Quadratic2DPresentationType myPrsType;
+ public:
+ typedef string TResult;
+ TResult myResult;
+ TSetQuadratic2DPresentationTypeEvent(View3D_i* theView3D,
+ ScalarMap_ptr thePrs,
+ Quadratic2DPresentationType theType):
+ TPrsManageEvent(theView3D, thePrs), myPrsType(theType),
+ myResult("Unknown error occured")
+ {}
+ virtual void Execute()
+ {
+ VISU::VISUType aType = myPrs->GetType();
+ if (aType != VISU::TSCALARMAP &&
+ aType != VISU::TDEFORMEDSHAPE &&
+ aType != VISU::TSCALARMAPONDEFORMEDSHAPE &&
+ aType != VISU::TDEFORMEDSHAPEANDSCALARMAP) {
+ myResult = "2D Quadratic element representation is not available for this type of presentations.";
+ return;
+ }
+ if (VISU_Actor* anActor = GetMyActor()) {
+ if(myPrsType == VISU::LINES)
+ anActor->SetQuadratic2DRepresentation(VISU_Actor::eLines);
+ else if(myPrsType == VISU::ARCS)
+ anActor->SetQuadratic2DRepresentation(VISU_Actor::eArcs);
+
+ SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
+ vw->Repaint();
+ myResult = "";
+ } else {
+ myResult = myError;
+ }
+ }
+ };
+
+ class TGetQuadratic2DPresentationTypeEvent: public TPrsManageEvent {
+ public:
+ typedef VISU::Quadratic2DPresentationType TResult;
+ TResult myResult;
+ TGetQuadratic2DPresentationTypeEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
+ TPrsManageEvent(theView3D, thePrs), myResult(VISU::LINES) {}
+ virtual void Execute() {
+ if (VISU_Actor* anActor = GetMyActor()) {
+ if(anActor->GetQuadratic2DRepresentation() == VISU_Actor::eLines)
+ myResult = VISU::LINES;
+ else if(anActor->GetQuadratic2DRepresentation() == VISU_Actor::eArcs)
+ myResult = VISU::ARCS;
+ }
+ }
+ };
+
PresentationType View3D_i::GetPresentationType(ScalarMap_ptr thePrs)
{
return ProcessEvent(new TGetPrsTypeEvent(this,thePrs));
return ProcessEvent(new TGetLineWidthEvent(this,thePrs));
}
+ Quadratic2DPresentationType View3D_i::GetQuadratic2DPresentationType(ScalarMap_ptr thePrs)
+ {
+ return ProcessEvent(new TGetQuadratic2DPresentationTypeEvent(this,thePrs));
+ }
+
char* View3D_i::SetPresentationType(ScalarMap_ptr thePrs, PresentationType thePrsType)
{
string aRet = ProcessEvent(new TSetPrsTypeEvent(this,thePrs,thePrsType));
string aRet = ProcessEvent(new TSetLineWidthEvent(this,thePrs,theLineWidth));
return CORBA::string_dup(aRet.c_str());
}
+
+ char* View3D_i::SetQuadratic2DPresentationType(ScalarMap_ptr thePrs, Quadratic2DPresentationType theType)
+ {
+ string aRet = ProcessEvent(new TSetQuadratic2DPresentationTypeEvent(this,thePrs,theType));
+ return CORBA::string_dup(aRet.c_str());
+ }
}
+
+
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_View_i.hh
// Author : Alexey PETROV
class QWidget;
-class VisuGUI_TableDlg;
+class VISU_TableDlg;
class SalomeApp_Application;
virtual void GetFitRanges(double& xMin, double& xMax, double& yMin, double& yMax);
virtual void Close();
+
+ Plot2d_ViewFrame* GetView() { return myView; }
protected:
Plot2d_ViewFrame* myView;
public:
virtual void Close();
protected:
- VisuGUI_TableDlg* myView;
+ VISU_TableDlg* myView;
public:
virtual Storable* Create (VISU::Table_ptr theTable);
};
virtual CORBA::Boolean IsShaded (ScalarMap_ptr thePrs);
virtual CORBA::Double GetOpacity (ScalarMap_ptr thePrs);
virtual CORBA::Double GetLineWidth (ScalarMap_ptr thePrs);
+ virtual Quadratic2DPresentationType GetQuadratic2DPresentationType(ScalarMap_ptr thePrs);
virtual char* SetPresentationType(ScalarMap_ptr thePrs, PresentationType thePrsType);
virtual char* SetShrinked (ScalarMap_ptr thePrs, CORBA::Boolean isShrinked);
virtual char* SetShaded (ScalarMap_ptr thePrs, CORBA::Boolean isShaded);
virtual char* SetOpacity (ScalarMap_ptr thePrs, CORBA::Double theOpacity);
virtual char* SetLineWidth (ScalarMap_ptr thePrs, CORBA::Double theLineWidth);
+ virtual char* SetQuadratic2DPresentationType(ScalarMap_ptr thePrs, Quadratic2DPresentationType theType);
protected:
static int myNbViewParams;
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : Makefile.am
# Author : Paul RASCLE, EDF
SWIG_DEF = libVISU_Swig.i
salomeinclude_HEADERS = $(SWIG_DEF) VISU_Gen_s.hh
+salomepython_PYTHON = libVISU_Swig.py
+salomepyexec_LTLIBRARIES = _libVISU_Swig.la
-# Libraries targets
-lib_LTLIBRARIES = _libVISU_Swig.la
dist__libVISU_Swig_la_SOURCES = $(SWIG_DEF) VISU_Gen_s.hh VISU_Gen_s.cc
nodist__libVISU_Swig_la_SOURCES = libVISU_Swig_wrap.cxx
$(GUI_CXXFLAGS) \
$(MED_CXXFLAGS) \
$(BOOST_CPPFLAGS) \
- -I$(srcdir)/../CONVERTOR -I$(srcdir)/../PIPELINE
+ -I$(srcdir) -I$(srcdir)/../CONVERTOR -I$(srcdir)/../PIPELINE
_libVISU_Swig_la_LDFLAGS = -module
_libVISU_Swig_la_LIBADD = $(PYTHON_LIBS) ../CONVERTOR/libVisuConvertor.la ../PIPELINE/libVisuPipeLine.la
dist_salomescript_DATA = batchmode_visu.py batchmode_visu_table.py batchmode_visu_view3d.py \
visu_med.py visu_view3d.py visu.py visu_gui.py visu_prs_example.py \
visu_table.py visu_big_table.py visu_view.py visu_delete.py \
- visu_swig_test.py visu_split_views.py \
+ visu_split_views.py \
visu_succcessive_animation.py visu_apply_properties.py visu_apply_properties_successive.py \
- batchmode_visu_view.py visu_cache.py visu_pointmap3d.py \
+ batchmode_visu_view.py visu_cache.py visu_pointmap3d.py visu_view3d_parameters.py visu_evolution.py \
VISU_Example_01.py VISU_Example_02.py VISU_Example_03.py VISU_Example_04.py \
- VISU_Example_05.py VISU_Example_06.py VISU_Example_07.py
-
-nodist_salomescript_DATA = libVISU_Swig.py
+ VISU_Example_05.py VISU_Example_06.py VISU_Example_07.py VISU_Example_08.py \
+ VISU_Example_09.py
dist_sharedpkgpython_DATA = VISU_shared_modules.py
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# T 2.23, 28: Displaying fields (scalar and vectorial) on nodes, change presentation options.
# Uses MED files ResOK_0000.med and Fields_group3D.med
# This script is equivalent to non-regression test script 003/A1
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# T 2.24: Save/retrieve view parameters.
# Uses MED file fra.med from ${DATA_DIR}/MedFiles directory.
# This script is equivalent to non-regression test script 003/A3
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Animation of "vitesse" field, stored in file TimeStamps.med
# This script is equivalent to non-regression test script 003/A5
#
print 'Importing "TimeStamps.med"................',
myVisu = visu_gui.myVisu
+myVisu.SetCurrentStudy(salome.myStudy)
myResult = myVisu.ImportFile(medFile)
if myResult is None : print "Error"
else : print "OK"
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Show some results presentations in different 3D and 2D viewers
# with different options (view parameters and display modes).
# Uses MED files fra.med and TimeStamps.med from ${DATA_DIR}/MedFiles directory.
import time
import math
import VISU
+import salome
import SALOMEDS
from visu_gui import *
aDelay = 1
+myVisu.SetCurrentStudy(salome.myStudy)
+
myViewManager = myVisu.GetViewManager();
myView = myViewManager.Create3DView();
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Create a table and show it in Plot2d viewer
# This script is equivalent to script VISU_SWIG/visu_big_table.py
#
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Import a table from file and show it in Plot2d viewer
#
import salome
# >>> Import a tables from a file ============================================
aFileName = os.getenv("DATA_DIR") + "/Tables/tables_test.xls"
-sobj = myVisu.ImportTables(aFileName)
+sobj = myVisu.ImportTables(aFileName, False)
# >>> Create container and insert curves =====================================
myContainer = myVisu.CreateContainer()
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Manage view parameters of presentations:
# Representation Mode, Shrink, Shading, Opacity, Line Width
#
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# Set different point markers for presentation
+#
+import salome
+
+import VISU
+import visu_gui
+
+import os
+import time
+
+data_dir = os.getenv("DATA_DIR")
+sleep_delay = 1
+
+myVisu = visu_gui.myVisu
+myVisu.SetCurrentStudy(salome.myStudy)
+myViewManager = myVisu.GetViewManager()
+myView = myViewManager.Create3DView()
+
+medFile = "fra.med"
+aMeshName ="LE VOLUME"
+anEntity = VISU.NODE
+aFieldName = "VITESSE";
+aTimeStampId = 1
+
+medFile = data_dir + "/MedFiles/" + medFile
+
+print "Build Scalar Map presentation"
+myResult = myVisu.ImportFile(medFile)
+aScalarMap = myVisu.ScalarMapOnField(myResult,aMeshName,anEntity,aFieldName,aTimeStampId)
+myView.Display(aScalarMap);
+myView.FitAll();
+
+print "Set representation type to Point"
+myView.SetPresentationType(aScalarMap, VISU.POINT)
+time.sleep(sleep_delay)
+
+print "Set standard marker 1"
+aScalarMap.SetMarkerStd(VISU.MT_PLUS, VISU.MS_10)
+myView.Update()
+time.sleep(sleep_delay)
+
+print "Set standard marker 2"
+aScalarMap.SetMarkerStd(VISU.MT_STAR, VISU.MS_35)
+myView.Update()
+time.sleep(sleep_delay)
+
+print "Set standard marker 3"
+aScalarMap.SetMarkerStd(VISU.MT_O, VISU.MS_25)
+myView.Update()
+time.sleep(sleep_delay)
+
+print "Set custom marker 1"
+texture_1 = myVisu.LoadTexture(os.path.join(data_dir, "Textures", "texture1.dat"))
+aScalarMap.SetMarkerTexture(texture_1)
+myView.Update()
+time.sleep(sleep_delay)
+
+print "Set custom marker 2"
+texture_2 = myVisu.LoadTexture(os.path.join(data_dir, "Textures", "texture2.dat"))
+aScalarMap.SetMarkerTexture(texture_2)
+myView.Update()
+time.sleep(sleep_delay)
+
+print "Set custom marker 3"
+texture_3 = myVisu.LoadTexture(os.path.join(data_dir, "Textures", "texture3.dat"))
+aScalarMap.SetMarkerTexture(texture_3)
+myView.Update()
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# Displaying curves attached to different Y axes of Plot2d view
+#
+import salome
+import time
+import SALOMEDS
+import VISU
+
+sleep_delay = 1
+
+# >>> Getting study builder
+myStudy = salome.myStudy
+myBuilder = myStudy.NewBuilder()
+
+# >>> Getting (loading) VISU component
+myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "VISU")
+myComponent = myStudy.FindComponent("VISU")
+myVisu.SetCurrentStudy(myStudy)
+if not myComponent:
+ myComponent = myBuilder.NewComponent("VISU")
+ aName = myBuilder.FindOrCreateAttribute(myComponent, "AttributeName")
+ aName.SetValue( salome.sg.getComponentUserName("VISU") )
+
+ A2 = myBuilder.FindOrCreateAttribute(myComponent, "AttributePixMap");
+ aPixmap = A2._narrow(SALOMEDS.AttributePixMap);
+ aPixmap.SetPixMap( "ICON_OBJBROWSER_Visu" );
+
+ myBuilder.DefineComponentInstance(myComponent,myVisu)
+
+# >>> Creating object with Table
+aTableObject = myBuilder.NewObject(myComponent)
+aTableName = myBuilder.FindOrCreateAttribute(aTableObject, "AttributeName")
+aTableName.SetValue("TestTable")
+aTable = myBuilder.FindOrCreateAttribute(aTableObject, "AttributeTableOfReal")
+
+aTable.AddRow([0,1,2,3,4,5,6,7,8,9,10])
+aTable.AddRow([2000,1900,1800,1700,1600,1500,1400,1300,1200,1100,1000])
+aTable.AddRow([1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0])
+aTable.SetTitle("Test table")
+aTable.SetRowTitle(1,"Time")
+aTable.SetRowUnit(1,"s")
+aTable.SetRowTitle(2,"Mass")
+aTable.SetRowUnit(2,"kg")
+aTable.SetRowTitle(3,"Temperature")
+aTable.SetRowUnit(3,"K")
+
+# >>> Create table of integer
+aVisuTable = myVisu.CreateTable(aTableObject.GetID())
+
+# >>> Create curve attached to the left axis
+aCurve1 = myVisu.CreateCurveWithZExt(aVisuTable, 1, 2, 0, False)
+
+# >>> Create curve attached to the right axis
+aCurve2 = myVisu.CreateCurveWithZExt(aVisuTable, 1, 3, 1, True)
+
+# >>> Create container and insert curves
+aContainer = myVisu.CreateContainer()
+aContainer.AddCurve(aCurve1)
+aContainer.AddCurve(aCurve2)
+
+# >>> Create XY plot and display container
+myViewManager = myVisu.GetViewManager();
+myView = myViewManager.CreateXYPlot();
+myView.SetTitle("The viewer for curves")
+myView.Display(aContainer)
+
+# >>> Update Object Browser
+salome.sg.updateObjBrowser(1)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Gen_s.cc
// Author : Alexey PETROV
if(VISU_ScalarMapPL* aScalarMap = theScalarMap->GetImpl()){
aScalarMap->Update();
- myRen->RemoveAllProps();
+ myRen->RemoveAllViewProps();
vtkActor* anActor = vtkActor::New();
anActor->SetMapper(aScalarMap->GetMapper());
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_Gen_s.hh
// Author : Alexey PETROV
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
"""
"""
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : batchmode_visu.py
# Module : VISU
#
from batchmode_salome import *
+import salome
import visu
myVisu = visu.Initialize(orb,naming_service,lcc,myStudyManager,myStudy,10)
if myVisu is None:
raise RuntimeError, "myVisu is none, VISU component is not loaded or found"
-
+
+myVisu.SetCurrentStudy(salome.myStudy)
+
def try_mesh_parameters(theMeshPattern):
aResult = []
if theMeshPattern is None : return aResult ;
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : visu_big_table.py
# Author : Vadim SANDLER
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : test_table.py
# Author : Alexey Petrov
# Module : VISU
#
+import salome
from VISU import *
from batchmode_visu_table import *
+myVisu.SetCurrentStudy(salome.myStudy)
+
myViewMan = myVisu.GetViewManager()
myTable = myViewMan.CreateTableView(myVisuTableReal)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : batchmode_visu_view3d.py
# Module : VISU
#mySession = batchmode_visu.mySession
+myVisu.SetCurrentStudy(salome.myStudy)
+
myViewManager = myVisu.GetViewManager();
myView = myViewManager.Create3DView();
+myView = myViewManager.Create3DView();
+myView.SetTitle("The viewer for CutSegment")
+print "myViewManager.Create3DView()"
+time.sleep(aDelay)
+
+print "myView.SetBackground(...)"
+aColor = SALOMEDS.Color(0.0,0.7,0.3)
+myView.SetBackground(aColor);
+time.sleep(aDelay)
+
+aCutSegment = myVisu.CutSegmentOnField(myResult, aMeshName, anEntity, myFieldName, aTimeStampId)
+aCutSegment.SetPoint1(0.0,0.0,0.0)
+aCutSegment.SetPoint2(0.4,0.05,1.0)
+
+myView.DisplayOnly(aCutSegment);
+myView.FitAll();
+print "myView.DisplayOnly(aCutSegment)"
+time.sleep(aDelay)
+
+aSObj = myStudy.FindObjectIOR(aCutSegment.GetID())
+aTable = myVisu.CreateTable( aSObj.GetID() )
+print "myVisu.CreateTable(...)"
+
+aTableView = myViewManager.CreateTableView(aTable)
+aTableView.SetTitle('Changed Title')
+
+aContainer = myVisu.CreateContainer()
+print "myVisu.CreateContainer(...)"
+
+aCurve = myVisu.CreateCurve( aTable, 1, 2 )
+print aCurve
+aContainer.AddCurve(aCurve)
+
+
+myView = myViewManager.CreateXYPlot();
+myView.SetTitle("The viewer for Curve from CutSegment")
+print "myViewManager.CreateXYPlot()"
+time.sleep(aDelay)
+
+myView.Display(aContainer)
+
+
+
myView = myViewManager.Create3DView();
myView.SetTitle("The viewer for Animation")
print "myViewManager.Create3DView()"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISU_SWIG : binding of C++ implementation and Python
// File : libVISU_Swig.i
// Author : Paul RASCLE, EDF
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : visu.py
# Module : VISU
from omniORB import CORBA
from string import *
from time import sleep
+from salome import ObjectToID
myORB = None
myNamingService = None
return VISU.FACE;
else :
return VISU.CELL;
+
+def getObjectID(obj):
+ ID = ""
+ entry = ObjectToID(obj)
+ if entry is not None:
+ lst = entry.split(":")
+ if len(entry) > 6:
+ ID = entry[6:]
+ return "VISU_" + ID
+ return ID
+
def HasValue(theList, theValue) :
try :
print "ERROR: No Field Object stored in this Study"
return None
+def getSObjectByFatherPathAndName(theStudy, thePath, theName):
+ father = theStudy.FindObjectByPath(thePath)
+ itr = theStudy.NewChildIterator(father)
+ while itr.More():
+ so = itr.Value()
+ if so.GetName()==theName: return so
+ itr.Next()
+ pass
+ return None
+
def SObjectToObject(theSObject) :
# global myORB
if theSObject is None :
else :
aVISUObjList.append(aPrsObj)
+ if HasValue(thePrsTypeList,VISU.TCUTSEGMENT) :
+ print " Creating CutSegmentOnField",
+ aPrsObj = theVisu.CutSegmentOnField(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) + "_TCUTSEGMENT." + thePictureExt
+ aPictureName = re.sub("\s+","_", aPictureName)
+ theView.SavePicture(aPictureName)
+ if theIsAutoDelete :
+ aPrsObj.RemoveFromStudy()
+ else :
+ aVISUObjList.append(aPrsObj)
+
if HasValue(thePrsTypeList,VISU.TPLOT3D) :
print " Creating Plot3DOnField",
aPrsObj = theVisu.Plot3DOnField(theResult,aMeshName,anEntity,
def generateName(prefix = None):
- import whrandom;
- int = whrandom.randint(1,1000);
+ import random;
+ int = random.randint(1,1000);
if prefix is None:
return "Study" + str(int)
else :
print "GetRotateY() = ", str(theObject.GetRotateY())
print "GetRotateY2() = ", str(theObject.GetRotateY2())
+# ----------------------
+# CUT SEGMENT
+# ----------------------
+def try_cutsegment_parameters(thePattern):
+
+ if thePattern is None : return None
+ import copy
+ import random
+
+ anObj = try_scalarmap_parameters(thePattern)
+
+ anObj.SetPoint1(random.randint(-100,100)*random.random(),
+ random.randint(-100,100)*random.random(),
+ random.randint(-100,100)*random.random())
+ anObj.SetPoint2(random.randint(-100,100)*random.random(),
+ random.randint(-100,100)*random.random(),
+ random.randint(-100,100)*random.random())
+
+ return anObj
+
+def dump_cutsegment_parameters(theObject):
+ dump_scalarmap_parameters(theObject)
+
+ x1 = y1 = z1 = 0
+ x2 = y2 = z2 = 0
+ theObject.GetPoint1(x1, y1, z1)
+ theObject.GetPoint1(x2, y2, z2)
+ print "GetPoint1() = " + str(x1) + ", " + str(y1) + ", " + str(z1)
+ print "GetPoint2() = " + str(x2) + ", " + str(y2) + ", " + str(z2)
+
# ----------------------
# STREAM LINES
# ----------------------
curve.SetLine( theLineType, theLineWidth )
pass
return curve
+
+def CreateCurveWithZ( theTable, theHRow, theVRow, theZRow, theTitle, theColor, theMarker, theLineType, theLineWidth ):
+ if theTitle is None: return
+ curve = myLocalVisu.CreateCurveWithZ( theTable, theHRow, theVRow, theZRow );
+ if curve:
+ curve.SetTitle( theTitle )
+ curve.SetColor( theColor )
+ curve.SetMarker( theMarker )
+ curve.SetLine( theLineType, theLineWidth )
+ pass
+ return curve
+
+def CreateCurveWithZExt( theTable, theHRow, theVRow, theZRow, theIsV2, theTitle, theColor, theMarker, theLineType, theLineWidth ):
+ if theTitle is None: return
+ curve = myLocalVisu.CreateCurveWithZExt( theTable, theHRow, theVRow, theZRow, theIsV2 );
+ if curve:
+ curve.SetTitle( theTitle )
+ curve.SetColor( theColor )
+ curve.SetMarker( theMarker )
+ curve.SetLine( theLineType, theLineWidth )
+ pass
+ return curve
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : visu_apply_properties.py
# Module : VISU
import math
import VISU
import SALOMEDS
+import salome
from visu_gui import *
aDelay = 0
+myVisu.SetCurrentStudy(salome.myStudy)
+
myViewManager = myVisu.GetViewManager();
myView = myViewManager.Create3DView();
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : visu_apply_properties_consecutive.py
# Module : VISU
import math
import VISU
import SALOMEDS
+import salome
from visu_gui import *
aDelay = 0
+myVisu.SetCurrentStudy(salome.myStudy)
+
myViewManager = myVisu.GetViewManager();
myView = myViewManager.Create3DView();
aSObj = aSObj.FindSubObject(1)[1]
print "addField 1 : ", anAnim.addField(aSObj)
-medFile1 = "TimeStamps_import22.med"
+medFile1 = "TimeStamps.med"
myFieldName1 = "pression"
medFile1 = os.getenv('DATA_DIR') + '/MedFiles/' + medFile1
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : visu_big_table.py
# Author : Vadim SANDLER
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import os
import time
import VISU
PRS3D_TYPE_LIST.append(VISU.TISOSURFACES)
PRS3D_TYPE_LIST.append(VISU.TCUTPLANES)
PRS3D_TYPE_LIST.append(VISU.TCUTLINES)
+PRS3D_TYPE_LIST.append(VISU.TCUTSEGMENT)
PRS3D_TYPE_LIST.append(VISU.TPLOT3D)
PRS3D_TYPE_LIST.append(VISU.TDEFORMEDSHAPE)
PRS3D_TYPE_LIST.append(VISU.TVECTORS)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import VISU
import SALOMEDS
+import salome
from visu_gui import *
+myVisu.SetCurrentStudy(salome.myStudy)
myViewManager = myVisu.GetViewManager();
myView = myViewManager.Create3DView();
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# VISU VISU_SWIG : binding of C++ implementation and Python
+# File : visu_evolution.py
+# Module : VISU
+#
+import os
+import VISU
+from visu_gui import *
+
+myVisu.SetCurrentStudy(salome.myStudy)
+myViewManager = myVisu.GetViewManager();
+
+myView = myViewManager.CreateXYPlot();
+myView.SetTitle("The viewer for Evolution")
+print "myViewManager.CreateXYPlot()"
+
+medFile = "TimeStamps.med"
+medFile = os.getenv('DATA_DIR') + '/MedFiles/' + medFile
+myResult = myVisu.ImportFile(medFile)
+
+anEvolution = myVisu.CreateEvolution(myView);
+
+aSObj = myStudy.FindObjectIOR(myResult.GetID())
+aSObj = aSObj.FindSubObject(1)[1] # dom
+aSObj = aSObj.FindSubObject(3)[1] # Fields
+aSObj = aSObj.FindSubObject(2)[1] # vitesse
+print "setField : ", anEvolution.setField(aSObj)
+
+anEvolution.setComponentId(1) # x component
+
+anEvolution.setPointId(500)
+
+print "Show Evolution"
+anEvolution.showEvolution()
+
+myView.FitAll()
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : visu_gui.py
# Module : VISU
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : visu_med.py
# Module : VISU
#med_obj = getMedObjectFromStudy()
myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "VISU")
+myVisu.SetCurrentStudy(salome.myStudy)
print "Use importMed(medFile) or importMedFrom(medDir,medFile) functions !"
#myField = getFieldObjectFromStudy(2,1)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import os
import VISU
+import salome
from visu_gui import *
+myVisu.SetCurrentStudy(salome.myStudy)
+
aTableFile = os.getenv('DATA_DIR') + '/Tables/table_test.xls'
-aTableSObject = myVisu.ImportTables(aTableFile)
+aTableSObject = myVisu.ImportTables(aTableFile, False)
aTable = None
if aTableSObject:
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : visu_prs_exam.py
# Module : VISU
import visu_gui
myVisu = visu_gui.myVisu
+myVisu.SetCurrentStudy(salome.myStudy)
+
medFile = "pointe.med"
medFile = os.getenv('DATA_DIR') + '/MedFiles/' + medFile
print medFile
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import VISU
import SALOMEDS
+import salome
from visu_gui import *
+from time import sleep
+
+DELAY = 2
+
+myVisu.SetCurrentStudy(salome.myStudy)
myViewManager = myVisu.GetViewManager()
################################################
+medFile = "fra.med"
+myFieldName = "VITESSE";
+
+aMeshName ="LE VOLUME"
+anEntity = VISU.NODE
+aTimeStampId = 1
+
+medFile = os.path.join(os.getenv('DATA_DIR'), 'MedFiles', medFile)
+myResult = myVisu.ImportFile(medFile)
+
+################################################
+
myView1 = myViewManager.Create3DView()
-myView1.SetTitle("The window will be soon destroyed!")
print "myView1 = myViewManager.Create3DView()"
+myView1.SetTitle("The window will be soon destroyed!")
myView1.Maximize()
print "myView1.Maximize()"
myView1.Minimize()
print "myView1.Minimize()"
+sleep(DELAY)
+
myViewManager.Destroy(myView1)
print "myViewManager.Destroy(myView1)"
myView2 = myViewManager.Create3DView()
print "myView2 = myViewManager.Create3DView()"
-myView2.SetTitle("myView2")
+myView2.SetTitle("The window to display Scalar Map")
aColor = SALOMEDS.Color(0.0,0.3,1.0)
-myView2.SetBackground(aColor)
print "aColor = SALOMEDS.Color(0.0,0.3,1.0)"
+myView2.SetBackground(aColor)
print "myView2.SetBackground(aColor)"
+aScalarMap = myVisu.ScalarMapOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
+print "myVisu.ScalarMapOnField(...)"
+
+myView2.Display(aScalarMap);
+print "myView2.Display(aScalarMap)"
+
myView2.SetFocalPoint([0,0,0])
print "myView2.SetFocalPoint([0,0,0])"
myView2.SetParallelScale(2)
print "myView2.SetParallelScale(2)"
+myView2.FitAll()
+print "myView3.FitAll"
+
+sleep(DELAY)
+
################################################
myView3 = myViewManager.Create3DView()
print "myView3 = myViewManager.Create3DView()"
-myView3.SetTitle("myView3")
+myView3.SetTitle("The window to display Cut Planes")
myView3.SplitRight()
print "myView3.SplitRight()"
myView3.SetBackground(aColor)
print "myView3.SetBackground(aColor)"
+aCutPlanes = myVisu.CutPlanesOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
+print "myVisu.CutPlanesOnField(...)"
+aCutPlanes.SetOrientation(VISU.CutPlanes.XY,0,0)
+print "aCutPlanes.SetOrientation(...)"
+
+myView3.DisplayOnly(aCutPlanes);
+print "myView3.DisplayOnly(aCutPlanes)"
+
aPoint = myView3.GetPointOfView()
aPoint[0] = aPoint[0] + 10
myView3.SetPointOfView(aPoint)
myView3.FitAll()
print "myView3.FitAll()"
+sleep(DELAY)
+
################################################
myView4 = myViewManager.Create3DView()
print "myView4 = myViewManager.Create3DView()"
-myView4.SetTitle("myView4")
+myView4.SetTitle("The window to display Iso Surfaces")
aColor = SALOMEDS.Color(1.0,0.7,0.0)
print "aColor = SALOMEDS.Color(1.0,0.7,0.0)"
myView4.SetBackground(aColor)
print "myView4.SetBackground(aColor)"
+aIsoSurfaces = myVisu.IsoSurfacesOnField(myResult, aMeshName, anEntity, myFieldName, aTimeStampId)
+print "aIsoSurfaces = myVisu.IsoSurfacesOnField(...)"
+aIsoSurfaces.SetNbSurfaces(10)
+print "aIsoSurfaces.SetNbSurfaces(10)"
+
+myView4.DisplayOnly(aIsoSurfaces)
+print "myView4.DisplayOnly(aIsoSurfaces)"
+
+myView4.FitAll()
+print "myView4.FitAll()"
+
+sleep(DELAY)
+
################################################
myView5 = myViewManager.Create3DView()
print "myView5 = myViewManager.Create3DView()"
-myView5.SetTitle("myView5")
+myView5.SetTitle("The window to display Cut Lines")
-myView5.SplitTop()
-print "myView5.SplitTop()"
+myView5.SplitBottom()
+print "myView5.SplitBottom()"
aColor = SALOMEDS.Color(0.7,0.7,0.7)
print "aColor = SALOMEDS.Color(0.7,0.7,0.7)"
myView5.SetBackground(aColor)
print "myView5.SetBackground(aColor)"
+aCutLines = myVisu.CutLinesOnField(myResult, aMeshName, anEntity, myFieldName, aTimeStampId)
+print "aCutLines = myVisu.CutLinesOnField(...)"
+aCutLines.SetOrientation(VISU.CutPlanes.ZX,0,0)
+print "aCutLines.SetOrientation(VISU.CutPlanes.ZX,0,0)"
+aCutLines.SetOrientation2(VISU.CutPlanes.YZ,0,0)
+print "aCutLines.SetOrientation2(VISU.CutPlanes.YZ,0,0)"
+
+myView5.DisplayOnly(aCutLines)
+print "myView5.DisplayOnly(aCutLines)"
+myView5.FitAll()
+print "myView5.FitAll()"
+
+sleep(DELAY)
+
################################################
myView6 = myViewManager.CreateXYPlot()
print "myView6 = myViewManager.CreateXYPlot()"
-myView6.SetTitle("myView6")
+myView6.SetTitle("The window to display curves")
+
+aSObj = myStudy.FindObjectIOR(aCutLines.GetID())
+aTable = myVisu.CreateTable( aSObj.GetID() )
+print "aTable = myVisu.CreateTable(...)"
+
+aContainer = myVisu.CreateContainer()
+print "aContainer = myVisu.CreateContainer(...)"
+
+aNbCurve = aTable.GetNbRows() - 1
+for i in range(2,aNbCurve):
+ aCurve = myVisu.CreateCurve( aTable, 1, i )
+ print "myVisu.CreateCurve(aTable, 1, %d)" % i
+ aContainer.AddCurve(aCurve)
+ pass
+
+myView6.Display(aContainer)
+print "myView6.Display(aContainer)"
+
+sleep(DELAY)
################################################
myView7 = myViewManager.Create3DView()
print "myView7 = myViewManager.Create3DView()"
-myView7.SetTitle("myView7")
+myView7.SetTitle("The window to display Cut Segment")
-################################################
+aCutSegment = myVisu.CutSegmentOnField(myResult, aMeshName, anEntity, myFieldName, aTimeStampId)
+print "aCutSegment = myVisu.CutSegmentOnField(...)"
+aCutSegment.SetPoint1(0.0,0.0,0.0)
+print "aCutSegment.SetPoint1(0.0,0.0,0.0)"
+aCutSegment.SetPoint2(0.4,0.05,1.0)
+print "aCutSegment.SetPoint2(0.4,0.05,1.0)"
-myView6.OnTop()
-print "myView6.OnTop()"
+myView7.DisplayOnly(aCutSegment)
+print "myView7.DisplayOnly(aCutSegment)"
+
+myView7.FitAll();
+print "myView7.FitAll()"
+
+sleep(DELAY)
+
+################################################
myView4.Attract(myView2)
print "myView4.Attract(myView2)"
-myView4.SetRelativePositionInSplitter(0.7)
-print "myView4.SetRelativePositionInSplitter(0.7)"
+sleep(DELAY)
-myView4.SetRelativePositionX(0.2)
-print "myView4.SetRelativePositionX(0.7)"
+myView7.OnTop()
+print "myView6.OnTop()"
-#myView4.SetRelativePositionY(0.2)
-#print "myView4.SetRelativePositionY(0.2)"
+sleep(DELAY)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : visu_view3d.py
# Module : VISU
import math
import VISU
import SALOMEDS
+import salome
from visu_gui import *
aDelay = 0
+myVisu.SetCurrentStudy(salome.myStudy)
+
myViewManager = myVisu.GetViewManager();
myView = myViewManager.Create3DView();
aSObj = aSObj.FindSubObject(1)[1]
print "addField 1 : ", anAnim.addField(aSObj)
-medFile1 = "TimeStamps_import22.med"
+medFile1 = "TimeStamps.med"
myFieldName1 = "pression"
medFile1 = os.getenv('DATA_DIR') + '/MedFiles/' + medFile1
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-from libVISU_Swig import *
-medFile = os.getenv('DATA_DIR') + '/MedFiles/fra.med'
-myCon=Convertor(medFile)
-myPrs=ScalarMap(myCon,"LE VOLUME",0,"VITESSE",1)
-myView=View3D()
-myView.Display(myPrs)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : visu_table.py
# Author : Vadim SANDLER
k={}
l={}
-for j in range(0,20):
+for j in range(0,21):
k[j] = j*10+1
l[j] = "C"+str(j+1)
ARealTable.AddRow(k.values())
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : visu_view.py
# Author : Alexey Petrov
from visu_table import *
+myVisu.SetCurrentStudy(salome.myStudy)
+
myViewMan = myVisu.GetViewManager()
myTable = myViewMan.CreateTableView(myVisuTableReal)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# VISU VISU_SWIG : binding of C++ implementation and Python
# File : visu_view3d.py
# Module : VISU
import time
import math
import VISU
+import salome
import SALOMEDS
from visu_gui import *
#mySession = batchmode_visu.mySession
+myVisu.SetCurrentStudy(salome.myStudy)
+
myViewManager = myVisu.GetViewManager();
myView = myViewManager.Create3DView();
+myView = myViewManager.Create3DView();
+myView.SetTitle("The viewer for CutSegment")
+print "myViewManager.Create3DView()"
+time.sleep(aDelay)
+
+print "myView.SetBackground(...)"
+aColor = SALOMEDS.Color(0.0,0.7,0.3)
+myView.SetBackground(aColor);
+time.sleep(aDelay)
+
+aCutSegment = myVisu.CutSegmentOnField(myResult, aMeshName, anEntity, myFieldName, aTimeStampId)
+aCutSegment.SetPoint1(0.0,0.0,0.0)
+aCutSegment.SetPoint2(0.4,0.05,1.0)
+
+myView.DisplayOnly(aCutSegment);
+myView.FitAll();
+print "myView.DisplayOnly(aCutSegment)"
+time.sleep(aDelay)
+
+aSObj = myStudy.FindObjectIOR(aCutSegment.GetID())
+aTable = myVisu.CreateTable( aSObj.GetID() )
+print "myVisu.CreateTable(...)"
+
+aTableView = myViewManager.CreateTableView(aTable)
+aTableView.SetTitle('Changed Title')
+
+aContainer = myVisu.CreateContainer()
+print "myVisu.CreateContainer(...)"
+
+aCurve = myVisu.CreateCurve( aTable, 1, 2 )
+print aCurve
+aContainer.AddCurve(aCurve)
+
+
+myView = myViewManager.CreateXYPlot();
+myView.SetTitle("The viewer for Curve from CutSegment")
+print "myViewManager.CreateXYPlot()"
+time.sleep(aDelay)
+
+myView.Display(aContainer)
+
+
+
myView = myViewManager.Create3DView();
myView.SetTitle("The viewer for Animation")
print "myViewManager.Create3DView()"
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# VISU VISU_SWIG : binding of C++ implementation and Python
+# File : visu_view3d.py
+# Module : VISU
+#
+import salome
+import visu_gui
+import VISU
+import os
+import time
+
+medFile = os.getenv("DATA_DIR") + "/MedFiles/fra.med"
+
+#%====================Stage1: Creating a study====================%
+
+print "Creating a new study... "
+myVisu.SetCurrentStudy(salome.myStudy)
+
+myVisu = visu_gui.myVisu
+myVisu.SetCurrentStudy(salome.myStudy)
+myViewManager = myVisu.GetViewManager()
+if myViewManager is None : print "Error"
+else : print "OK"
+
+myView = myViewManager.Create3DView()
+
+#%====================Stage2: Import MED file====================%
+
+print "Importing Med file... "
+myResult = myVisu.ImportFile(medFile)
+if myResult is None : print "Error"
+else : print "OK"
+
+print "Creating mesh... "
+myMeshName = 'LE VOLUME'
+myCellEntity = VISU.CELL
+mesh = myVisu.MeshOnEntity(myResult,myMeshName,myCellEntity);
+if mesh is None : print "Error"
+else : print "OK"
+
+myView.Display(mesh)
+
+#%====================Stage3: Changing of view parameters====================%
+
+myView.FitAll()
+
+aDelay=0.02
+
+print "Rotating X..."
+for i in range(0,100) :
+ aPoint = (i,60,150)
+ myView.SetPointOfView(aPoint)
+ myView.Update();
+ time.sleep(aDelay)
+
+print "OK"
+
+print "Zooming out...",
+aScale = myView.GetParallelScale()
+print "Zooming 3D view..."
+for i in range(0,50) :
+ aScale = aScale + 0.05
+ myView.SetParallelScale(aScale)
+ myView.Update();
+ time.sleep(aDelay)
+print "OK"
+
+print "Change Focal Point..."
+aFocalPoint = myView.GetFocalPoint()
+for i in range(0,61) :
+ if i <= 30 :
+ aFocalPoint[0] = aFocalPoint[0] - 0.1;
+ else :
+ aFocalPoint[0] = aFocalPoint[0] + 0.1;
+ myView.SetFocalPoint(aFocalPoint)
+ myView.Update();
+ time.sleep(aDelay)
+for i in range(0,61) :
+ if i <= 30 :
+ aFocalPoint[1] = aFocalPoint[1] - 0.1;
+ else :
+ aFocalPoint[1] = aFocalPoint[1] + 0.1;
+ myView.SetFocalPoint(aFocalPoint)
+ myView.Update();
+ time.sleep(aDelay)
+print "OK"
+
+print "Change View Up..."
+aViewUp = myView.GetViewUp();
+for i in range(0,40) :
+ aViewUp[0] = aViewUp[0] + 0.1;
+ myView.SetViewUp(aViewUp)
+ myView.Update();
+ time.sleep(aDelay*2)
+print "OK"
+
+#create second viewer
+
+myView1 = myViewManager.Create3DView()
+myView1.SplitRight()
+myView1.Display(mesh)
+myView1.FitAll()
+time.sleep(1)
+
+# Get properties from the First viewer and apply it to the New viewer
+aP = myView.GetPointOfView()
+myView1.SetPointOfView(aP)
+
+aFP = myView.GetFocalPoint()
+myView1.SetFocalPoint(aFP)
+
+aVU = myView.GetViewUp()
+myView1.SetViewUp(aVU)
+
+aScale = myView.GetParallelScale()
+myView1.SetParallelScale( aScale )
+
+myView.Update();
+myView1.Update();
+time.sleep(1)
+
+# Change Parameters in both viewers
+
+print "Zooming...",
+aScale = myView.GetParallelScale()
+for i in range(0,70) :
+ aScale = aScale - 0.08
+ myView.SetParallelScale(aScale)
+ myView.Update();
+ myView1.SetParallelScale(aScale)
+ myView1.Update();
+ time.sleep(aDelay)
+print "OK"
+
+print "Rotating Y..."
+aPoint = myView1.GetPointOfView();
+for i in range(0,150) :
+ aPoint[1] = aPoint[1] + 1;
+ myView1.SetPointOfView(aPoint)
+ myView1.Update();
+ myView.SetPointOfView(aPoint)
+ myView.Update();
+print "OK"
+
+print "Zooming back...",
+for i in range(0,40) :
+ aScale = aScale + 0.08
+ myView.SetParallelScale(aScale)
+ myView.Update();
+ myView1.SetParallelScale(aScale)
+ myView1.Update();
+ time.sleep(aDelay)
+print "OK"
+++ /dev/null
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# File : Makefile.in
-# Author : Alexander Solovyov(OCN)
-# Module : VVTK
-# $Header:
-#
-include $(top_srcdir)/adm_local/unix/make_common_starter.am
-
-lib_LTLIBRARIES= libVVTK.la
-
-# header files
-salomeinclude_HEADERS= \
- VVTK.h \
- VVTK_PrimitiveBox.h \
- VVTK_SizeBox.h
-
-dist_libVVTK_la_SOURCES= \
- VVTK_PrimitiveBox.cxx \
- VVTK_SizeBox.cxx
-
-MOC_FILES= \
- VVTK_PrimitiveBox_moc.cxx \
- VVTK_SizeBox_moc.cxx
-
-nodist_libVVTK_la_SOURCES=$(MOC_FILES)
-
-libVVTK_la_CPPFLAGS= \
- $(QT_INCLUDES) \
- @CAS_CXXFLAGS@ @CAS_CPPFLAGS@ \
- $(VTK_INCLUDES) \
- $(BOOST_CPPFLAGS) \
- $(KERNEL_CXXFLAGS) \
- $(GUI_CXXFLAGS) \
- $(MED_CXXFLAGS) \
- -I$(srcdir)/../OBJECT -I$(srcdir)/../PIPELINE -I$(srcdir)/../CONVERTOR
-
-libVVTK_la_LDFLAGS= \
- ../OBJECT/libVisuObject.la \
- ../PIPELINE/libVisuPipeLine.la \
- ../CONVERTOR/libVisuConvertor.la \
- $(KERNEL_LDFLAGS) -lOpUtil \
- $(GUI_LDFLAGS) -lsuit -lCAM -lSalomeObject -lSVTK \
- $(QT_MT_LIBS) \
- $(OCC_LIBS) \
- $(VTK_LIBS)
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifdef WNT
-#ifdef VISU_VVTK_EXPORTS
-#define VVTK_EXPORT __declspec(dllexport)
-#else
-#define VVTK_EXPORT __declspec(dllimport)
-#endif
-#else
-#define VVTK_EXPORT
-#endif
-
-#if defined WNT
-#pragma warning ( disable: 4251 )
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME VTKViewer : build VTK viewer into Salome desktop
-// File :
-// Author :
-// Module :
-// $Header$
-//
-#include "VVTK_ImageWriter.h"
-
-#include <QSemaphore>
-
-#include "utilities.h"
-
-#include <vtkImageData.h>
-#include <vtkImageClip.h>
-#include <vtkJPEGWriter.h>
-#include <vtkSmartPointer.h>
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-
-//----------------------------------------------------------------------------
-VVTK_ImageWriter
-::VVTK_ImageWriter(QSemaphore* theSemaphore,
- vtkImageData* theImageData,
- const std::string& theName,
- int theProgressive,
- int theQuality):
- mySemaphore(theSemaphore),
- myImageData(theImageData),
- myName(theName),
- myProgressive(theProgressive),
- myQuality(theQuality),
- myConstraint16Flag(true)
-{}
-
-//----------------------------------------------------------------------------
-VVTK_ImageWriter
-::~VVTK_ImageWriter()
-{
- if(MYDEBUG) MESSAGE("VVTK_ImageWriter::~VVTK_ImageWriter - this = "<<this);
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_ImageWriter
-::run()
-{
- vtkJPEGWriter *aWriter = vtkJPEGWriter::New();
- vtkImageData *anImageData = myImageData;
- vtkSmartPointer<vtkImageClip> anImageClip;
- //
- if(myConstraint16Flag){
- int uExtent[6];
- myImageData->UpdateInformation();
- myImageData->GetUpdateExtent(uExtent);
- unsigned int width = uExtent[1] - uExtent[0] + 1;
- unsigned int height = uExtent[3] - uExtent[2] + 1;
- width = (width / 16) * 16;
- height= (height / 16) * 16;
- uExtent[1] = uExtent[0] + width - 1;
- uExtent[3] = uExtent[2] + height - 1;
- //
- anImageClip = vtkImageClip::New();
- anImageClip->Delete();
-
- anImageClip->SetInput(myImageData);
- anImageClip->SetOutputWholeExtent(uExtent);
- anImageClip->ClipDataOn();
- anImageData = anImageClip->GetOutput();
- }
- //
- aWriter->WriteToMemoryOff();
- aWriter->SetFileName(myName.c_str());
- aWriter->SetQuality(myQuality);
- aWriter->SetProgressive(myProgressive);
- aWriter->SetInput(anImageData);
- aWriter->Write();
-
- aWriter->Delete();
- myImageData->Delete();
-
- if(MYDEBUG) MESSAGE("VVTK_ImageWriter::run "<<
- "- this = "<<this<<
- //"; total = "<<mySemaphore->total()<<
- "; available = "<<mySemaphore->available() );
- mySemaphore->release();
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME VTKViewer : build VTK viewer into Salome desktop
-// File :
-// Author :
-// Module :
-// $Header$
-//
-#ifndef _VVTK_ImageWriter_Header_File_
-#define _VVTK_ImageWriter_Header_File_
-
-#include <QThread>
-#include <string>
-
-class vtkImageData;
-class QSemaphore;
-
-
-class VVTK_ImageWriter : public QThread
-{
-public:
- VVTK_ImageWriter(QSemaphore* theSemaphore,
- vtkImageData* theImageData,
- const std::string& theName,
- int theProgressive,
- int theQuality);
-
- ~VVTK_ImageWriter();
-
- protected:
- virtual
- void
- run();
-
- protected:
- QSemaphore* mySemaphore;
- vtkImageData *myImageData;
- std::string myName;
- int myProgressive;
- int myQuality;
- bool myConstraint16Flag;
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME VTKViewer : build VTK viewer into Salome desktop
-// File :
-// Author :
-// Module :
-// $Header$
-//
-#include "VVTK_ImageWriterMgr.h"
-#include "VVTK_ImageWriter.h"
-
-#include <vtkImageData.h>
-
-#include <QSemaphore>
-
-#include "utilities.h"
-
-#include <limits>
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-//----------------------------------------------------------------------------
-VVTK_ImageWriterMgr
-::VVTK_ImageWriterMgr()
-{
- int aMax = std::numeric_limits<int>::max() / 2;
- mySemaphore = new QSemaphore(aMax);
- mySemaphore->acquire( aMax );
- if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<<
- //"- total = "<<mySemaphore->total()<<
- "; available = "<<mySemaphore->available() );
-}
-
-
-//----------------------------------------------------------------------------
-VVTK_ImageWriterMgr
-::~VVTK_ImageWriterMgr()
-{
- Stop();
- delete mySemaphore;
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_ImageWriterMgr
-::StartImageWriter(vtkImageData *theImageData,
- const std::string& theName,
- const int theProgressive,
- const int theQuality)
-{
- VVTK_ImageWriter *anImageWriter =
- new VVTK_ImageWriter(mySemaphore,
- theImageData,
- theName,
- theProgressive,
- theQuality);
- myThreads.push_back(anImageWriter);
-
- anImageWriter->start();
-
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_ImageWriterMgr
-::Stop()
-{
- if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::Stop "<<
- //"- total = "<<mySemaphore->total()<<
- "; available = "<<mySemaphore->available() );
- if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::Stop - *mySemaphore += "<<myThreads.size() );
- mySemaphore->acquire( myThreads.size() );
-
- for(size_t anId = 0, anEnd = myThreads.size(); anId < anEnd; anId++){
- VVTK_ImageWriter* anImageWriter = myThreads[anId];
- anImageWriter->wait();
- delete anImageWriter;
- }
- myThreads.clear();
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME VTKViewer : build VTK viewer into Salome desktop
-// File :
-// Author :
-// Module :
-// $Header$
-//
-#ifndef _VVTK_ImageWriterMgr_Header_File_
-#define _VVTK_ImageWriterMgr_Header_File_
-
-#include <string>
-#include <vector>
-
-class QString;
-class vtkImageData;
-class VVTK_ImageWriter;
-class QSemaphore;
-
-class VVTK_ImageWriterMgr
-{
- public:
- VVTK_ImageWriterMgr();
- ~VVTK_ImageWriterMgr();
-
- void
- StartImageWriter(vtkImageData *theImageData,
- const std::string& theName,
- const int theProgressive,
- const int theQuality);
-
- void
- Stop();
-
- typedef std::vector<VVTK_ImageWriter*> TWriterThreads;
-
- protected:
- TWriterThreads myThreads;
-
- QSemaphore* mySemaphore;
-};
-
-
-#endif
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME VTKViewer : build VTK viewer into Salome desktop
-// File : VVTK_InteractorStyle.cxx
-// Author : Christophe ATTANASIO
-// Module : SALOME
-// $Header$
-//
-#include "VVTK_InteractorStyle.h"
-#include "VISU_GaussPtsSettings.h"
-#include "SVTK_Selector.h"
-#include "VISU_Event.h"
-
-#include <vtkObjectFactory.h>
-#include <vtkRenderWindowInteractor.h>
-#include <vtkCallbackCommand.h>
-#include <vtkCommand.h>
-#include <vtkRenderer.h>
-#include <vtkCamera.h>
-
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro(VVTK_InteractorStyle);
-//----------------------------------------------------------------------------
-
-VVTK_InteractorStyle
-::VVTK_InteractorStyle():
- myIsMidButtonDown( false ),
- myIsLeftButtonDown( false ),
- mySMDecreaseMagnificationBtn(10),
- mySMIncreaseMagnificationBtn(11)
-{
-}
-
-//----------------------------------------------------------------------------
-VVTK_InteractorStyle
-::~VVTK_InteractorStyle()
-{
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_InteractorStyle
-::OnLeftButtonDown(int ctrl, int shift,
- int x, int y)
-{
- myIsLeftButtonDown = true;
-
- if (this->HasObserver(vtkCommand::LeftButtonPressEvent)) {
- this->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
- return;
- }
- this->FindPokedRenderer(x, y);
- if (this->CurrentRenderer == NULL) {
- return;
- }
- myShiftState = shift;
- // finishing current viewer operation
- if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
- onFinishOperation();
- startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
- }
- myOtherPoint = myPoint = QPoint(x, y);
- if (ForcedState != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
- startOperation(ForcedState);
- }
- else {
- if (!(ctrl||shift)){
- if (myIsMidButtonDown){
- startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
- }
- else{
- startOperation(VTK_INTERACTOR_STYLE_CAMERA_ROTATE);
- }
- }
- }
- return;
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_InteractorStyle
-::OnMiddleButtonDown(int ctrl,
- int shift,
- int x, int y)
-{
- myIsMidButtonDown = true;
-
- if (this->HasObserver(vtkCommand::MiddleButtonPressEvent)) {
- this->InvokeEvent(vtkCommand::MiddleButtonPressEvent,NULL);
- return;
- }
- this->FindPokedRenderer(x, y);
- if (this->CurrentRenderer == NULL) {
- return;
- }
- myShiftState = shift;
- // finishing current viewer operation
- if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
- onFinishOperation();
- startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
- }
- myOtherPoint = myPoint = QPoint(x, y);
- if (ForcedState != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
- startOperation(ForcedState);
- }
- else {
- if (!(ctrl||shift)){
- if ( myIsLeftButtonDown ){
- startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
- }
- else{
- startOperation(VTK_INTERACTOR_STYLE_CAMERA_PAN);
- }
- }
- }
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_InteractorStyle
-::OnLeftButtonUp(int ctrl, int shift, int x, int y)
-{
- myIsLeftButtonDown = false;
- SVTK_InteractorStyle::OnLeftButtonUp( ctrl, shift, x, y );
-
- if ( myIsMidButtonDown )
- OnMiddleButtonDown( ctrl, shift, x, y );
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_InteractorStyle
-::OnMiddleButtonUp(int ctrl, int shift, int x, int y)
-{
- myIsMidButtonDown = false;
- SVTK_InteractorStyle::OnMiddleButtonUp( ctrl, shift, x, y );
-
- if ( myIsLeftButtonDown )
- OnLeftButtonDown( ctrl, shift, x, y );
-}
-//----------------------------------------------------------------------------
-void VVTK_InteractorStyle::onFinishOperation()
-{
- Superclass::onFinishOperation();
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_InteractorStyle
-::SetInteractor( vtkRenderWindowInteractor* theInteractor )
-{
- // register EventCallbackCommand as observer of standard events (keypress, mousemove, etc)
- Superclass::SetInteractor( theInteractor );
-
- if(theInteractor){
- theInteractor->AddObserver( VISU::SetSMDecreaseMagnificationEvent, EventCallbackCommand, Priority );
- theInteractor->AddObserver( VISU::SetSMIncreaseMagnificationEvent, EventCallbackCommand, Priority );
- }
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_InteractorStyle
-::ProcessEvents( vtkObject* object,
- unsigned long event,
- void* clientData,
- void* callData )
-{
- if ( clientData ) {
- vtkObject* anObject = reinterpret_cast<vtkObject*>( clientData );
- VVTK_InteractorStyle* self = dynamic_cast<VVTK_InteractorStyle*>( anObject );
- if( self ){
- switch ( event ) {
- case VISU::SetSMDecreaseMagnificationEvent:
- self->mySMDecreaseMagnificationBtn = *((int*)callData);
- return;
- case VISU::SetSMIncreaseMagnificationEvent:
- self->mySMIncreaseMagnificationBtn = *((int*)callData);
- return;
- }
- }
- }
-
- Superclass::ProcessEvents( object, event, clientData, callData );
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_InteractorStyle
-::onSpaceMouseButton( int button )
-{
- if( mySMDecreaseMagnificationBtn == button )
- DecreaseGaussPointMagnification();
- if( mySMIncreaseMagnificationBtn == button )
- IncreaseGaussPointMagnification();
-
- Superclass::onSpaceMouseButton( button );
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_InteractorStyle
-::DecreaseGaussPointMagnification()
-{
- Interactor->InvokeEvent(VISU::SetSMDecreaseMagnificationEvent,NULL);
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_InteractorStyle
-::IncreaseGaussPointMagnification()
-{
- Interactor->InvokeEvent(VISU::SetSMIncreaseMagnificationEvent,NULL);
-}
-//============================================================================
-//
-// Controllers
-//
-vtkStandardNewMacro(VVTK_ControllerIncrement);
-//----------------------------------------------------------------------------
-VVTK_ControllerIncrement::VVTK_ControllerIncrement()
-{
- myIncrement=10;
-}
-//----------------------------------------------------------------------------
-VVTK_ControllerIncrement::~VVTK_ControllerIncrement()
-{
-}
-//----------------------------------------------------------------------------
-int VVTK_ControllerIncrement::Increase()
-{
- myIncrement*=2;
- return myIncrement;
-}
-//----------------------------------------------------------------------------
-int VVTK_ControllerIncrement::Decrease()
-{
- myIncrement/=2;
- if (!myIncrement){
- myIncrement=1;
- }
- return myIncrement;
-}
-//
-vtkStandardNewMacro(VVTK_ControllerOnKeyDown);
-//----------------------------------------------------------------------------
-VVTK_ControllerOnKeyDown::VVTK_ControllerOnKeyDown()
-{
-}
-//----------------------------------------------------------------------------
-VVTK_ControllerOnKeyDown::~VVTK_ControllerOnKeyDown()
-{
-}
-//----------------------------------------------------------------------------
-bool VVTK_ControllerOnKeyDown::OnKeyDown(vtkInteractorStyle* theIS)
-{
- SVTK_InteractorStyle *pIS=dynamic_cast<SVTK_InteractorStyle *>(theIS);
- if (pIS){
- if(pIS->GetSelector()->SelectionMode()==GaussPointSelection){
- char key = pIS->GetInteractor()->GetKeyCode();
- //
- if (key == 'S') {
- pIS->ActionPicking();
- return false;
- }
- }
- }
- return Superclass::OnKeyDown(theIS);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME VTKViewer : build VTK viewer into Salome desktop
-// File : VVTK_InteractorStyle.h
-// Author : Christophe ATTANASIO
-// Module : SALOME
-// $Header$
-//
-#ifndef __VVTK_InteractorStyle_h
-#define __VVTK_InteractorStyle_h
-
-
-#include "VVTK.h"
-
-#include "SVTK_InteractorStyle.h"
-//
-//-------------------------------------------
-//! Control the value of increment in new style of interaction.
-/*!
- This class controls of value of increment,
- for pan/rotate/zoom operations in new style
- of interaction
-*/
-class VVTK_ControllerIncrement : public SVTK_ControllerIncrement {
- public:
- vtkTypeMacro(VVTK_ControllerIncrement,SVTK_ControllerIncrement);
- static VVTK_ControllerIncrement* New();
-
- //! Increace the increment value by multiplying on 2
- virtual int Increase();
-
- //! Decreace the increment value by division on 2
- virtual int Decrease();
-
- protected:
- VVTK_ControllerIncrement();
- virtual ~VVTK_ControllerIncrement();
- //
- private:
- VVTK_ControllerIncrement(const VVTK_ControllerIncrement&); //Not implemented
- void operator=(const VVTK_ControllerIncrement&); //Not implemented
-};
-//
-//-------------------------------------------
-//! Control the behaviour of KeyDown event in new style of interaction.
-/*!
- This class controls of behaviour of of KeyDown event
- in new style of interaction.
-*/
-class VVTK_ControllerOnKeyDown : public SVTK_ControllerOnKeyDown{
- public:
- vtkTypeMacro(VVTK_ControllerOnKeyDown, SVTK_ControllerOnKeyDown);
- static VVTK_ControllerOnKeyDown* New();
-
- //! Provides the action on event
- virtual bool OnKeyDown(vtkInteractorStyle* );
-
- protected:
- VVTK_ControllerOnKeyDown();
- virtual ~VVTK_ControllerOnKeyDown();
-
- private:
- VVTK_ControllerOnKeyDown(const VVTK_ControllerOnKeyDown&);//Not implemented
- void operator=(const VVTK_ControllerOnKeyDown&); //Not implemented
-};
-
-
-//! Introduce new style of interaction (keyboard free)
-class VVTK_EXPORT VVTK_InteractorStyle : public SVTK_InteractorStyle
-{
- public:
- static VVTK_InteractorStyle *New();
- vtkTypeMacro(VVTK_InteractorStyle,SVTK_InteractorStyle);
-
- //! Redefined from SVTK_InteractorStyle::SetInteractor in order to add an observer (callback) for custorm event (space mouse event)
- virtual
- void
- SetInteractor( vtkRenderWindowInteractor* );
-
- protected:
- VVTK_InteractorStyle();
- ~VVTK_InteractorStyle();
-
- VVTK_InteractorStyle(const VVTK_InteractorStyle&); // Not implemented
- void operator=(const VVTK_InteractorStyle&); // Not implemented
-
- // Generic event bindings must be overridden in subclasses
-
- //! Redefine SVTK_InteractorStyle::OnLeftButtonDown
- virtual void OnLeftButtonDown(int ctrl, int shift, int x, int y);
-
- //! Redefine SVTK_InteractorStyle::OnMiddleButtonDown
- virtual void OnMiddleButtonDown(int ctrl, int shift, int x, int y);
-
- //! Redefine SVTK_InteractorStyle::OnLeftButtonUp
- virtual void OnLeftButtonUp(int ctrl, int shift, int x, int y);
-
- //! Redefine SVTK_InteractorStyle::OnMiddleButtonUp
- virtual void OnMiddleButtonUp(int ctrl, int shift, int x, int y);
-
- //! Redefine SVTK_InteractorStyle::onFinishOperation
- virtual void onFinishOperation();
-
- //! Main process VTK event method
- static
- void
- ProcessEvents(vtkObject* object,
- unsigned long event,
- void* clientData,
- void* callData );
-
- //! Redefine SVTK_InteractorStyle::onSpaceMouseButton
- virtual void onSpaceMouseButton( int button );
-
- //! To decrease magnification of the Gauss Points
- void DecreaseGaussPointMagnification();
-
- //! To increase magnification of the Gauss Points
- void IncreaseGaussPointMagnification();
-
- //! SpaceMouse short cuts
- int mySMDecreaseMagnificationBtn;
- int mySMIncreaseMagnificationBtn;
-
- bool myIsMidButtonDown;
- bool myIsLeftButtonDown;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
-// File :
-// Author :
-// Module :
-// $Header$
-//
-#include "VVTK_MainWindow.h"
-#include "VVTK_InteractorStyle.h"
-#include "VVTK_Recorder.h"
-#include "VVTK_RecorderDlg.h"
-#include "VISU_WidgetCtrl.hxx"
-#include "VISU_GaussPtsAct.h"
-#include "VISU_Event.h"
-
-#include "SVTK_ViewWindow.h"
-#include "SVTK_RenderWindowInteractor.h"
-#include "VVTK_Renderer.h"
-#include "VVTK_PickingDlg.h"
-#include "VVTK_SegmentationCursorDlg.h"
-
-#include "SUIT_Application.h"
-#include "SUIT_Session.h"
-#include "SUIT_Tools.h"
-#include "SUIT_ViewWindow.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Accel.h"
-#include "SUIT_MessageBox.h"
-#include "QtxAction.h"
-#include "QtxMultiAction.h"
-#include "QtxActionToolMgr.h"
-
-#include <QImage>
-#include <QToolBar>
-#include <QSplitter>
-#include <QFileDialog>
-#include <QApplication>
-
-//----------------------------------------------------------------------------
-VVTK_MainWindow::VVTK_MainWindow(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow):
- SVTK_MainWindow(theParent,theName,theResourceMgr,theViewWindow),
- myControllerIncrement(VVTK_ControllerIncrement::New()),
- myControllerOnKeyDown(VVTK_ControllerOnKeyDown::New())
-{
- myToolMgr = new QtxActionToolMgr( this );
-
- myControllerIncrement->Delete();
- myControllerOnKeyDown->Delete();
-
- // Recording
- myRecordingToolBar = new QToolBar(tr("LBL_TOOLBAR_RECORD_LABEL"), this);
- addToolBar(Qt::LeftToolBarArea, myRecordingToolBar );
- myViewWindow->toolMgr()->remove( NonIsometric, myToolBar );
-
-
- myStartAction = new QtxAction(tr("MNU_VVTK_RECORDING_START"),
- theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_START" ) ),
- tr( "MNU_VVTK_RECORDING_START" ), 0, this);
- myStartAction->setStatusTip(tr("DSC_VVTK_RECORDING_START"));
- //myStartAction->addTo( myRecordingToolBar );
- myRecordingToolBar->addAction( myStartAction );
- connect( myStartAction, SIGNAL( triggered ( bool ) ), this, SLOT( OnStartRecording() ) );
-
- myPlayAction = new QtxAction(tr("MNU_VVTK_RECORDING_PLAY"),
- theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_PLAY" ) ),
- tr( "MNU_VVTK_RECORDING_PLAY" ), 0, this);
- myPlayAction->setStatusTip(tr("DSC_VVTK_RECORDING_PLAY"));
- myPlayAction->setEnabled( false );
- //myPlayAction->addTo( myRecordingToolBar );
- myRecordingToolBar->addAction( myPlayAction );
- connect( myPlayAction, SIGNAL( triggered ( bool ) ), this, SLOT( OnPlayRecording() ) );
-
- myPauseAction = new QtxAction(tr("MNU_VVTK_RECORDING_PAUSE"),
- theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_PAUSE" ) ),
- tr( "MNU_VVTK_RECORDING_PAUSE" ), 0, this);
- myPauseAction->setStatusTip(tr("DSC_VVTK_RECORDING_PAUSE"));
- myPauseAction->setEnabled( false );
- //myPauseAction->addTo( myRecordingToolBar );
- myRecordingToolBar->addAction( myPauseAction );
- connect( myPauseAction, SIGNAL( triggered ( bool ) ), this, SLOT( OnPauseRecording() ) );
-
- myStopAction = new QtxAction(tr("MNU_VVTK_RECORDING_STOP"),
- theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_STOP" ) ),
- tr( "MNU_VVTK_RECORDING_STOP" ), 0, this);
- myStopAction->setStatusTip(tr("DSC_VVTK_RECORDING_STOP"));
- myStopAction->setEnabled( false );
- //myStopAction->addTo( myRecordingToolBar );
- myRecordingToolBar->addAction( myStopAction );
- connect( myStopAction, SIGNAL( triggered ( bool ) ), this, SLOT( OnStopRecording() ) );
-
- myRecorder = VVTK_Recorder::New();
- //myRecorder->CheckExistAVIMaker();
- //if(myRecorder->ErrorStatus())
- // myRecordingToolBar->setEnabled(false);
-}
-
-//----------------------------------------------------------------------------
-
-QtxActionToolMgr* VVTK_MainWindow::toolMgr() const
-{
- return myToolMgr;
-}
-
-//----------------------------------------------------------------------------
-void VVTK_MainWindow::Initialize(SVTK_RenderWindowInteractor* theInteractor)
-{
- vtkInteractorStyle* aStyle = theInteractor->GetInteractorStyle();
- if(SVTK_InteractorStyle *anInteractorStyle = dynamic_cast<SVTK_InteractorStyle*>(aStyle)){
- anInteractorStyle->SetControllerIncrement(myControllerIncrement.GetPointer());
- anInteractorStyle->SetControllerOnKeyDown(myControllerOnKeyDown.GetPointer());
- }
-
- myRecorder->SetNbFPS(17.3);
- myRecorder->SetQuality(100);
- myRecorder->SetProgressiveMode(true);
- myRecorder->SetUseSkippedFrames(true);
- myRecorder->SetRenderWindow(theInteractor->getRenderWindow());
-
- disconnect( SVTK_MainWindow::action( DumpId ), SIGNAL( activated() ),
- myViewWindow, SLOT( onDumpView() ) );
-
- connect( SVTK_MainWindow::action( DumpId ), SIGNAL( activated() ),
- this, SLOT( onDumpView() ) );
-
- SVTK_MainWindow::Initialize(theInteractor);
- addToolBar( Qt::LeftToolBarArea, getToolBar() );
-}
-
-VVTK_MainWindow::~VVTK_MainWindow()
-{
- if(myRecorder)
- myRecorder->Delete();
-}
-
-//----------------------------------------------------------------------------
-void VVTK_MainWindow::onDumpView()
-{
- QImage img = dumpView();
- if( img.isNull() )
- return;
-
- SUIT_Application* app = SUIT_Session::session()->activeApplication();
- QString fileName = app->getFileName( false, QString::null,
- tr( "TLT_IMAGE_FILES" ),
- tr( "TLT_DUMP_VIEW" ), 0 );
- if( fileName.isEmpty() )
- return;
-
- QString fmt = SUIT_Tools::extension( fileName ).toUpper();
- if( fmt.isEmpty() )
- fmt = QString( "BMP" ); // default format
- else if( fmt == "JPG" )
- fmt = "JPEG";
-
- QApplication::setOverrideCursor( Qt::WaitCursor );
- img.save( fileName, fmt.toLatin1() );
- QApplication::restoreOverrideCursor();
-}
-
-//----------------------------------------------------------------------------
-void VVTK_MainWindow::OnStartRecording()
-{
- myRecorder->CheckExistAVIMaker();
- if (myRecorder->ErrorStatus()) {
- SUIT_MessageBox::warning(this, tr("ERROR"), tr("MSG_NO_AVI_MAKER") );
- }
- else {
- VVTK_RecorderDlg* aRecorderDlg = new VVTK_RecorderDlg( this, myRecorder );
-
- if( !aRecorderDlg->exec() )
- return;
-
- myStartAction->setEnabled( false );
- myPlayAction->setEnabled( false );
- myPauseAction->setEnabled( true );
- myStopAction->setEnabled( true );
-
- myRecorder->Record();
- }
-}
-
-//----------------------------------------------------------------------------
-void VVTK_MainWindow::OnPlayRecording()
-{
- myStartAction->setEnabled( false );
- myPlayAction->setEnabled( false );
- myPauseAction->setEnabled( true );
- myStopAction->setEnabled( true );
- //
- myRecorder->Pause();
-}
-
-//----------------------------------------------------------------------------
-void VVTK_MainWindow::OnPauseRecording()
-{
- myStartAction->setEnabled( false );
- myPlayAction->setEnabled( true );
- myPauseAction->setEnabled( false );
- myStopAction->setEnabled( true );
- //
- myRecorder->Pause();
-}
-
-//----------------------------------------------------------------------------
-void VVTK_MainWindow::OnStopRecording()
-{
- myStartAction->setEnabled( true );
- myPlayAction->setEnabled( false );
- myPauseAction->setEnabled( false );
- myStopAction->setEnabled( false );
- //
- myRecorder->Stop();
-}
-
-//----------------------------------------------------------------------------
-void VVTK_MainWindow::action( const int accelAction )
-{
- if ( accelAction == SUIT_Accel::ZoomFit )
- onFitAll();
- else {
- int anEvent = SVTK::convertAction( accelAction );
- InvokeEvent( anEvent, 0 );
- }
-}
-
-//----------------------------------------------------------------------------
-VVTK_MainWindow1::VVTK_MainWindow1(QSplitter* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow):
- VVTK_MainWindow(theParent,theName,theResourceMgr,theViewWindow),
- mySplitter(theParent),
- myPickingDlg(NULL)
-{
- myPtsToolBar = new QToolBar( tr("LBL_TOOLBAR_GAUSS_LABEL"), this );
- addToolBar( Qt::LeftToolBarArea, myPtsToolBar );
-
- QPixmap aPixmap;
- QtxAction* anAction;
-
- aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_SELECTION_MODE_SWITCH"));
- myPickingAction = new QtxAction(tr("MNU_VVTK_SELECTION_MODE_SWITCH"),
- aPixmap,
- tr( "MNU_VVTK_SELECTION_MODE_SWITCH" ),
- 0,
- this,
- //"VVTK/SVTK SelectionSwitch",
- true);
- myPickingAction->setCheckable(true);
- myPickingAction->setStatusTip(tr("DSC_VVTK_SELECTION_MODE_SWITCH"));
- myPtsToolBar->addAction( myPickingAction );
- connect(myPickingAction, SIGNAL(toggled(bool)), this, SLOT(OnSelectionModeSwitch(bool)));
-
- myPickingDlg = new VVTK_PickingDlg( myPickingAction, this, "PickingDlg" );
-
- // Plane/Sphere Segmentation
- aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_PLANE_SEGMENTATION_SWITCH"));
- myPlaneSegmentationAction = new QtxAction(tr("MNU_VVTK_PLANE_SEGMENTATION_SWITCH"),
- aPixmap,
- tr( "MNU_VVTK_PLANE_SEGMENTATION_SWITCH" ),
- 0,
- this,
- //"VVTK/SVTK PlaneSegmentationSwitch",
- true);
- myPlaneSegmentationAction->setCheckable(true);
- myPlaneSegmentationAction->setStatusTip(tr("DSC_VVTK_PLANE_SEGMENTATION_SWITCH"));
- //myPlaneSegmentationAction->addTo( myPtsToolBar );
- connect( myPlaneSegmentationAction, SIGNAL( triggered() ), this, SLOT( OnSegmentationSwitch() ) );
-
- aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_SPHERE_SEGMENTATION_SWITCH"));
- mySphereSegmentationAction = new QtxAction(tr("MNU_VVTK_SPHERE_SEGMENTATION_SWITCH"),
- aPixmap,
- tr( "MNU_VVTK_SPHERE_SEGMENTATION_SWITCH" ),
- 0,
- this,
- //"VVTK/SVTK SphereSegmentationSwitch",
- true);
- mySphereSegmentationAction->setCheckable(true);
- mySphereSegmentationAction->setStatusTip(tr("DSC_VVTK_SPHERE_SEGMENTATION_SWITCH"));
- //mySphereSegmentationAction->addTo( myPtsToolBar );
- connect( mySphereSegmentationAction, SIGNAL( activated() ), this, SLOT( OnSegmentationSwitch() ) );
-
- mySegmentationCursorDlg = new VVTK_SegmentationCursorDlg( this, "SegmentationCursorDlg" );
- mySegmentationCursorDlg->SetPlaneAction( myPlaneSegmentationAction );
- mySegmentationCursorDlg->SetSphereAction( mySphereSegmentationAction );
- connect( mySegmentationCursorDlg, SIGNAL( scgClose() ), this, SLOT( OnSegmentationSwitch() ) );
-
- //SUIT_ToolButton* aSegmentationButton = new SUIT_ToolButton( myPtsToolBar );
- QtxMultiAction* aSegmentationAction = new QtxMultiAction( this );
- aSegmentationAction->insertAction( myPlaneSegmentationAction );
- aSegmentationAction->insertAction( mySphereSegmentationAction );
- myPtsToolBar->addAction( aSegmentationAction );
-}
-
-void VVTK_MainWindow1::Initialize(SVTK_RenderWindowInteractor* theInteractor,
- VVTK_Renderer1* theRenderer)
-{
- myRenderer = theRenderer;
- VVTK_MainWindow::Initialize(theInteractor);
-
- mySegmentationCursorDlg->SetWidgetCtrl( theRenderer->GetWidgetCtrl() );
- mySegmentationCursorDlg->SetInteractor( theInteractor );
-
- connect( theInteractor, SIGNAL( selectionChanged() ), SLOT( OnSelectionChanged() ) );
- myPickingDlg->SetInteractor( theInteractor );
-}
-
-VVTK_MainWindow1::~VVTK_MainWindow1()
-{}
-
-//----------------------------------------------------------------------------
-VVTK_MainWindow2* VVTK_MainWindow1::CreateMainWindow2(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow)
-{
- myMainWindow2 = new VVTK_MainWindow2(theParent,
- theName,
- theResourceMgr,
- theViewWindow);
- return myMainWindow2;
-}
-
-
-//----------------------------------------------------------------------------
-void VVTK_MainWindow1::OnSelectionModeSwitch(bool theIsSelectionOn)
-{
- if ( theIsSelectionOn && !isVisible() )
- return;
-
- Selection_Mode aSelectionMode = SelectionMode();
- if(theIsSelectionOn && aSelectionMode != GaussPointSelection)
- SetSelectionMode(GaussPointSelection);
- else if(!theIsSelectionOn && aSelectionMode == GaussPointSelection)
- SetSelectionMode(ActorSelection);
-
- if( theIsSelectionOn )
- {
- myPickingDlg->Update();
- myPickingDlg->show();
- }
- else
- myPickingDlg->hide();
-}
-
-void VVTK_MainWindow1::OnSelectionChanged()
-{
- Selection_Mode aSelectionMode = SelectionMode();
- if(myPickingAction->isChecked() && aSelectionMode != GaussPointSelection)
- myPickingAction->setChecked(false);
- else if(!myPickingAction->isChecked() && aSelectionMode == GaussPointSelection)
- myPickingAction->setChecked(true);
-}
-
-
-//----------------------------------------------------------------------------
-VISU_WidgetCtrl* VVTK_MainWindow1::GetWidgetCtrl()
-{
- return myRenderer->GetWidgetCtrl();
-}
-
-VISU_InsideCursorSettings* VVTK_MainWindow1::GetInsideCursorSettings()
-{
- return mySegmentationCursorDlg->GetInsideCursorSettings();
-}
-
-VISU_OutsideCursorSettings* VVTK_MainWindow1::GetOutsideCursorSettings()
-{
- return mySegmentationCursorDlg->GetOutsideCursorSettings();
-}
-
-VISU_PickingSettings* VVTK_MainWindow1::GetPickingSettings()
-{
- return myPickingDlg->GetPickingSettings();
-}
-
-//----------------------------------------------------------------------------
-void VVTK_MainWindow1::SetPlanesSegementation(bool theIsOn)
-{
- myPlaneSegmentationAction->setChecked( theIsOn );
- OnSegmentationSwitch(myPlaneSegmentationAction);
-}
-
-void VVTK_MainWindow1::SetSphereSegementation(bool theIsOn)
-{
- mySphereSegmentationAction->setChecked( theIsOn );
- OnSegmentationSwitch(mySphereSegmentationAction);
-}
-
-void VVTK_MainWindow1::OnSegmentationSwitch(QtxAction* theAction)
-{
- bool anIsSegmentationOn = myPlaneSegmentationAction->isChecked() ||
- mySphereSegmentationAction->isChecked();
-
- if( !theAction )
- return;
-
- VISU_WidgetCtrl *aWidgetCtrl = myRenderer->GetWidgetCtrl();
-
- if (anIsSegmentationOn) {
- int anIndex = (theAction == myPlaneSegmentationAction) ? 0 : 1;
- aWidgetCtrl->SetActiveIndex(anIndex);
- }
- aWidgetCtrl->SetEnabled(anIsSegmentationOn);
-
- if( theAction == myPlaneSegmentationAction && anIsSegmentationOn )
- mySphereSegmentationAction->setChecked( false );
- else if( theAction == mySphereSegmentationAction && anIsSegmentationOn )
- myPlaneSegmentationAction->setChecked( false );
-
- if( anIsSegmentationOn )
- {
- myMainWindow2->show();
- mySegmentationCursorDlg->SetIsPlaneSegmentation( theAction == myPlaneSegmentationAction );
- mySegmentationCursorDlg->UpdateSegmentation();
- mySegmentationCursorDlg->UpdateInsideGaussPoints();
- mySegmentationCursorDlg->UpdateOutsideGaussPoints();
- mySegmentationCursorDlg->show();
- }
- else
- {
- myMainWindow2->hide();
- mySegmentationCursorDlg->hide();
- }
-}
-
-void VVTK_MainWindow1::OnSegmentationSwitch()
-{
- QtxAction* anAction = ( QtxAction* )sender();
- OnSegmentationSwitch(anAction);
-}
-
-
-//----------------------------------------------------------------------------
-VVTK_MainWindow2::VVTK_MainWindow2(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow):
- VVTK_MainWindow(theParent,theName,theResourceMgr,theViewWindow)
-{}
-
-VVTK_MainWindow2::~VVTK_MainWindow2()
-{}
-
-
-//----------------------------------------------------------------------------
-void VVTK_MainWindow2::Initialize(SVTK_RenderWindowInteractor* theInteractor)
-{
- VVTK_MainWindow::Initialize(theInteractor);
-}
-
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef VVTK_MAINWINDOW_H
-#define VVTK_MAINWINDOW_H
-
-#ifdef WIN32
-#pragma warning( disable:4251 )
-#endif
-
-#include "VVTK.h"
-#include "SVTK_MainWindow.h"
-
-class QSplitter;
-
-class VISU_WidgetCtrl;
-class VVTK_SegmentationCursorDlg;
-class VISU_InsideCursorSettings;
-class VISU_OutsideCursorSettings;
-class VISU_PickingSettings;
-class VVTK_InteractorStyle;
-class VVTK_ControllerIncrement;
-class VVTK_ControllerOnKeyDown;
-class VVTK_PickingDlg;
-class VVTK_MainWindow2;
-class VVTK_Renderer1;
-class VVTK_Renderer2;
-class VVTK_Recorder;
-
-//----------------------------------------------------------------------------
-//! Customize SVTK_MainWindow to provide VVTK functionality
-class VVTK_EXPORT VVTK_MainWindow: public SVTK_MainWindow
-{
- Q_OBJECT;
-
-public:
- //! Construct instance of the class
- VVTK_MainWindow(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow);
-
- //! Reimplement SVTK_MainWindow::Initialize
- virtual void Initialize(SVTK_RenderWindowInteractor* theInteractor);
-
- //! Destroy instance of the class
- virtual ~VVTK_MainWindow();
-
- public slots:
-
- virtual void onDumpView();
-
- virtual void action( const int );
-
- virtual void OnStartRecording();
-
- virtual void OnPlayRecording();
-
- virtual void OnPauseRecording();
-
- virtual void OnStopRecording();
-
- protected:
- virtual QtxActionToolMgr* toolMgr() const;
-
- vtkSmartPointer<VVTK_ControllerIncrement> myControllerIncrement;
- vtkSmartPointer<VVTK_ControllerOnKeyDown> myControllerOnKeyDown;
-
- QToolBar* myRecordingToolBar;
- QtxAction* myStartAction;
- QtxAction* myPlayAction;
- QtxAction* myPauseAction;
- QtxAction* myStopAction;
-
- VVTK_Recorder *myRecorder;
- QtxActionToolMgr* myToolMgr;
-};
-
-
-//----------------------------------------------------------------------------
-//! Extend VVTK_MainWindow to implement functionality for base view
-class VVTK_EXPORT VVTK_MainWindow1: public VVTK_MainWindow
-{
- Q_OBJECT;
-
-public:
- //! Construct instance of the class
- VVTK_MainWindow1(QSplitter* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow);
-
- //! Reimplement VVTK_MainWindow::Initialize
- virtual void Initialize(SVTK_RenderWindowInteractor* theInteractor,
- VVTK_Renderer1* theRenderer);
-
- //! Destroy instance of the class
- virtual ~VVTK_MainWindow1();
-
- //! Create instance of the segmented VVTK_MainWindow
- /*!
- The two views (VVTK_MainWindow1 and VVTK_MainWindow2) should change its behaviour in the same time.
- So, it is necessary to synhronize them through sharing some common pointers.
- */
- VVTK_MainWindow2* CreateMainWindow2(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow);
-
- VISU_WidgetCtrl* GetWidgetCtrl();
-
- void SetPlanesSegementation(bool theIsOn);
-
- void SetSphereSegementation(bool theIsOn);
-
- VISU_InsideCursorSettings* GetInsideCursorSettings();
-
- //! Get contained VISU_OutsideCursorSettings
- VISU_OutsideCursorSettings* GetOutsideCursorSettings();
-
- //! Get contained VISU_PickingSettings
- VISU_PickingSettings* GetPickingSettings();
-
- public slots:
- //! To activate/ deactivate the segementation cursor at run-time
- void OnSegmentationSwitch();//bool theIsSegmentationOn);
-
- void OnSegmentationSwitch(QtxAction* theAction);//bool theIsSegmentationOn);
-
- //! To change active selection mode at run-time
- virtual void OnSelectionModeSwitch(bool theIsSelectionOn);
-
- //! To adjust to the current selection mode
- virtual void OnSelectionChanged();
-
- protected:
- VVTK_Renderer1* myRenderer; //!< Keeps extended version of SVTK_Renderer
-
- VVTK_MainWindow2* myMainWindow2; //!< Refer to segmented view
-
- QToolBar* myPtsToolBar; //!< Additional tool bar
-
- //! To implement show/hide segmented view on acttivate/ deactivate segementation cursor
- QSplitter* mySplitter;
-
- QtxAction* myPickingAction; //!< Action for switch selection mode
- QtxAction* myPlaneSegmentationAction; //!< Action for switch segmentation mode to plane
- QtxAction* mySphereSegmentationAction; //!< Action for switch segmentation mode to sphere
-
- //! Keep reference to VVTK_SegmentationCursorDlg
- VVTK_SegmentationCursorDlg* mySegmentationCursorDlg;
- VVTK_PickingDlg* myPickingDlg; //!< Keep reference to VVTK_PickingDlg
-};
-
-
-//----------------------------------------------------------------------------
-//! Extend VVTK_MainWindow to implement functionality for segmented view
-class VVTK_EXPORT VVTK_MainWindow2: public VVTK_MainWindow
-{
- Q_OBJECT;
-
- friend class VVTK_MainWindow1;
-
- //! Construct instance of the class
- VVTK_MainWindow2(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow);
-public:
- //! Destroy instance of the class
- virtual ~VVTK_MainWindow2();
-
- //! Reimplement SVTK_MainWindow::Initialize
- virtual void Initialize(SVTK_RenderWindowInteractor* theInteractor);
-
-};
-
-
-#ifdef WIN32
-#pragma warning( default:4251 )
-#endif
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : VVTK_PickingDlg.cxx
-// Author : Oleg Uvarov
-// Module : VISU
-//
-#include "VVTK_PickingDlg.h"
-
-#include "VISU_GaussPtsAct.h"
-#include "VISU_PickingSettings.h"
-#include "VISU_GaussPointsPL.hxx"
-
-#include "SUIT_MessageBox.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-
-#include "CAM_Module.h"
-
-#include "SVTK_Selector.h"
-#include "SVTK_MainWindow.h"
-#include "SVTK_RenderWindowInteractor.h"
-
-#include "VTKViewer_Algorithm.h"
-#include "SVTK_Functor.h"
-
-#include <vtkActorCollection.h>
-#include <vtkCallbackCommand.h>
-#include <vtkObjectFactory.h>
-#include <vtkRenderer.h>
-#include <vtkGenericRenderWindowInteractor.h>
-#include <vtkSmartPointer.h>
-
-#include "utilities.h"
-
-#include <QCheckBox>
-#include <QColorDialog>
-#include <QComboBox>
-#include <QGroupBox>
-#include <QLabel>
-#include <QLayout>
-#include <QPushButton>
-#include <QVBoxLayout>
-#include <QKeyEvent>
-#include <QIntValidator>
-
-#include "QtxAction.h"
-#include "QtxDoubleSpinBox.h"
-#include "QtxIntSpinBox.h"
-#include "QtxColorButton.h"
-
-#include "LightApp_Application.h"
-
-namespace
-{
- struct SelectorHelper
- {
- public:
- SelectorHelper( SVTK_RenderWindowInteractor* theInteractor ):
- myInteractor( theInteractor )
- {}
-
- bool
- get()
- {
- bool aResult = false;
- myMapIndex.Clear();
- mySelector = NULL;
- myPipeLine = NULL;
- myActor = NULL;
-
- if ( !myInteractor )
- return aResult;
-
- mySelector = myInteractor->GetSelector();
- if ( !mySelector )
- return aResult;
-
- const SALOME_ListIO& aListIO = mySelector->StoredIObjects();
- if ( aListIO.Extent() != 1 )
- return aResult;
-
- myIO = aListIO.First();
- if ( mySelector->HasIndex( myIO ) )
- mySelector->GetIndex(myIO, myMapIndex);
-
- myActor = SVTK::Find<VISU_GaussPtsAct>(myInteractor->getRenderer()->GetActors(),
- SVTK::TIsSameIObject<VISU_GaussPtsAct>( myIO ));
- if ( !myActor )
- return aResult;
-
- myPipeLine = myActor->GetGaussPointsPL();
-
- return true;
- }
-
- SVTK_RenderWindowInteractor* myInteractor;
- TColStd_IndexedMapOfInteger myMapIndex;
- Handle(SALOME_InteractiveObject) myIO;
- SVTK_Selector* mySelector;
-
- VISU_GaussPointsPL* myPipeLine;
- VISU_GaussPtsAct* myActor;
- };
-
-
-
- class GaussPtsIDValidator: public QIntValidator
- {
- public:
- GaussPtsIDValidator( SVTK_RenderWindowInteractor* theInteractor,
- QObject * theParent ):
- QIntValidator( 0, VTK_LARGE_ID, theParent ),
- myHelper(theInteractor)
- {}
-
- virtual
- State
- validate ( QString & theInput, int & thePos ) const
- {
- if ( QIntValidator::validate( theInput, thePos ) == QValidator::Invalid)
- return QValidator::Invalid;
-
- if ( !myHelper.get() )
- return QValidator::Invalid;
-
- return QValidator::Acceptable;
- }
-
- protected:
- mutable SelectorHelper myHelper;
- };
-
-
- class GaussCellIDValidator: public GaussPtsIDValidator
- {
- public:
- GaussCellIDValidator( QLineEdit* theLocalPointLabel,
- SVTK_RenderWindowInteractor* theInteractor,
- QObject * theParent ):
- GaussPtsIDValidator( theInteractor, theParent ),
- myLocalPointLineEdit( theLocalPointLabel )
- {}
-
- virtual
- State
- validate ( QString & theInput, int & thePos ) const
- {
- if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid)
- return QValidator::Invalid;
-
- VISU::TCellID aCellID = theInput.toInt();
- VISU::TLocalPntID aLocalPntID = myLocalPointLineEdit->text().toInt();
- VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper();
- if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 )
- return QValidator::Intermediate;
-
- return QValidator::Acceptable;
- }
-
- private:
- QLineEdit* myLocalPointLineEdit;
- };
-
-
- class GaussLocalPointIDValidator: public GaussPtsIDValidator
- {
- public:
- GaussLocalPointIDValidator( QLineEdit* theParentElementLineEdit,
- SVTK_RenderWindowInteractor* theInteractor,
- QObject * theParent ):
- GaussPtsIDValidator( theInteractor, theParent ),
- myParentElementLineEdit( theParentElementLineEdit )
- {}
-
- virtual
- State
- validate ( QString & theInput, int & thePos ) const
- {
- if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid)
- return QValidator::Invalid;
-
- VISU::TLocalPntID aLocalPntID = theInput.toInt();
- VISU::TCellID aCellID = myParentElementLineEdit->text().toInt();
- VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper();
- if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 )
- return QValidator::Intermediate;
-
- return QValidator::Acceptable;
- }
-
- private:
- QLineEdit* myParentElementLineEdit;
- };
-}
-
-
-VVTK_ValidatedLineEdit::VVTK_ValidatedLineEdit( QWidget* parent ):
- QLineEdit( parent )
-{
- connect( this, SIGNAL( textChanged( const QString& ) ), this, SLOT( MarkValidated( const QString& ) ) );
-}
-
-void VVTK_ValidatedLineEdit::MarkValidated( const QString& theText )
-{
- if ( !validator() )
- return;
-
- int aPos;
- QString aText( theText );
- QPalette pal = palette();
- switch ( validator()->validate( aText, aPos ) ) {
- case QValidator::Invalid:
- case QValidator::Intermediate:
- pal.setColor( foregroundRole(), QColor( 255, 0, 0 ));
- setPalette( pal );
- break;
- case QValidator::Acceptable:
- pal.setColor( foregroundRole(), QColor( 0, 0, 0 ));
- setPalette( pal );
- break;
- }
-}
-
-//---------------------------------------------------------------------------------
-
-VVTK_PickingDlg::VVTK_PickingDlg(QtxAction* theAction,
- SVTK_MainWindow* theParent,
- const char* theName):
- SVTK_DialogBase(theAction,
- theParent,
- theName),
- myEventCallbackCommand( vtkCallbackCommand::New() ),
- myPickingSettings( VISU_PickingSettings::New() )
-{
- myPriority = 0.0;
- myEventCallbackCommand->Delete();
- myEventCallbackCommand->SetClientData(this);
- myEventCallbackCommand->SetCallback(VVTK_PickingDlg::ProcessEvents);
-
- setWindowTitle( tr( "PICKING_DLG_TITLE" ) );
- setSizeGripEnabled(TRUE);
-
- QVBoxLayout* TopLayout = new QVBoxLayout( this );
- TopLayout->setSpacing(6);
- TopLayout->setMargin(11);
-
- QWidget* aBox = new QWidget( this );
- QVBoxLayout* BoxLayout = new QVBoxLayout( aBox );
- BoxLayout->setMargin(0);
- BoxLayout->setSpacing(6);
-
- // Cursor
- QGroupBox* CursorGroup = new QGroupBox( tr( "CURSOR_TITLE" ), aBox );
- //CursorGroup->setColumnLayout(0, Qt::Vertical );
- //CursorGroup->layout()->setSpacing( 0 );
- //CursorGroup->layout()->setMargin( 0 );
-
- QGridLayout* CursorGroupLayout = new QGridLayout (CursorGroup);
- CursorGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- CursorGroupLayout->setSpacing(6);
- CursorGroupLayout->setMargin(11);
-
- QLabel* CursorSizeLabel = new QLabel( tr( "CURSOR_SIZE" ), CursorGroup );
- myCursorSizeSpinBox = new QtxDoubleSpinBox( 0, 1, 0.1, CursorGroup );
- myCursorSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- QLabel* PyramidHeightLabel = new QLabel( tr( "PYRAMID_HEIGHT" ), CursorGroup );
- double aHeightMin=1.e-7;
- double aHeightMax=10.;
- double aHeightStep=0.1;
- myPyramidHeightSpinBox = new QtxDoubleSpinBox(aHeightMin, aHeightMax, aHeightStep, CursorGroup );
- myPyramidHeightSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- QLabel* SelectionColorLabel = new QLabel( tr( "SELECTION_COLOR" ), CursorGroup );
- mySelectionColorButton = new QtxColorButton( CursorGroup );
- mySelectionColorButton->setColor( Qt::blue );
- //QPalette aPalette( mySelectionColorButton->palette() );
- //aPalette.setColor( mySelectionColorButton->backgroundRole(), Qt::blue );
- //mySelectionColorButton->setPalette( aPalette );
- //connect( mySelectionColorButton, SIGNAL( clicked() ), this, SLOT( onColorButtonPressed() ) );
-
- CursorGroupLayout->addWidget( CursorSizeLabel, 0, 0 );
- CursorGroupLayout->addWidget( myCursorSizeSpinBox, 0, 1 );
- CursorGroupLayout->addWidget( PyramidHeightLabel, 1, 0 );
- CursorGroupLayout->addWidget( myPyramidHeightSpinBox, 1, 1 );
- CursorGroupLayout->addWidget( SelectionColorLabel, 2, 0 );
- CursorGroupLayout->addWidget( mySelectionColorButton, 2, 1 );
-
- BoxLayout->addWidget( CursorGroup );
-
- // Tolerance
- QGroupBox* ToleranceGroup = new QGroupBox( tr( "TOLERANCE_TITLE" ), aBox );
- //ToleranceGroup->setColumnLayout(0, Qt::Vertical );
- //ToleranceGroup->layout()->setSpacing( 0 );
- //ToleranceGroup->layout()->setMargin( 0 );
-
- QGridLayout* ToleranceGroupLayout = new QGridLayout (ToleranceGroup);
- ToleranceGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- ToleranceGroupLayout->setSpacing(6);
- ToleranceGroupLayout->setMargin(11);
-
- QLabel* PointToleranceLabel = new QLabel( tr( "POINT_TOLERANCE" ), ToleranceGroup );
- myPointToleranceSpinBox = new QtxDoubleSpinBox( 0.001, 10.0, 0.01, ToleranceGroup );
- myPointToleranceSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- ToleranceGroupLayout->addWidget( PointToleranceLabel, 0, 0 );
- ToleranceGroupLayout->addWidget( myPointToleranceSpinBox, 0, 1 );
-
- BoxLayout->addWidget( ToleranceGroup );
-
- // Information window
- QGroupBox* InfoWindowGroup = new QGroupBox( tr( "INFO_WINDOW_TITLE" ), aBox );
- //InfoWindowGroup->setColumnLayout(0, Qt::Vertical );
- //InfoWindowGroup->layout()->setSpacing( 0 );
- //InfoWindowGroup->layout()->setMargin( 0 );
-
- QGridLayout* InfoWindowGroupLayout = new QGridLayout (InfoWindowGroup);
- InfoWindowGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- InfoWindowGroupLayout->setSpacing(6);
- InfoWindowGroupLayout->setMargin(11);
-
- QLabel* TransparencyLabel = new QLabel( tr( "TRANSPARENCY" ), InfoWindowGroup );
- myTransparencySpinBox = new QtxIntSpinBox( 0, 100, 10, InfoWindowGroup );
- myTransparencySpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- InfoWindowGroupLayout->addWidget( TransparencyLabel, 0, 0 );
- InfoWindowGroupLayout->addWidget( myTransparencySpinBox, 0, 1 );
-
- QLabel* PositionLabel = new QLabel( tr( "POSITION" ), InfoWindowGroup );
- myPositionComboBox = new QComboBox( InfoWindowGroup );
- myPositionComboBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- myPositionComboBox->addItem( tr( "BELOW_POINT" ) );
- myPositionComboBox->addItem( tr( "TOP_LEFT_CORNER" ) );
-
- InfoWindowGroupLayout->addWidget( TransparencyLabel, 0, 0 );
- InfoWindowGroupLayout->addWidget( myTransparencySpinBox, 0, 1 );
- InfoWindowGroupLayout->addWidget( PositionLabel, 1, 0 );
- InfoWindowGroupLayout->addWidget( myPositionComboBox, 1, 1 );
-
- BoxLayout->addWidget( InfoWindowGroup );
-
- // Movement of the camera
- QGroupBox* CameraGroup = new QGroupBox( tr( "CAMERA_TITLE" ), aBox );
- //CameraGroup->setColumnLayout(0, Qt::Vertical );
- //CameraGroup->layout()->setSpacing( 0 );
- //CameraGroup->layout()->setMargin( 0 );
-
- QGridLayout* CameraGroupLayout = new QGridLayout (CameraGroup);
- CameraGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- CameraGroupLayout->setSpacing(6);
- CameraGroupLayout->setMargin(11);
-
- QLabel* ZoomFactorLabel = new QLabel( tr( "ZOOM_FACTOR" ), CameraGroup );
- myZoomFactorSpinBox = new QtxDoubleSpinBox( 0.1, 10.0, 0.1, CameraGroup );
- myZoomFactorSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- QLabel* StepNumberLabel = new QLabel( tr( "STEP_NUMBER" ), CameraGroup );
- myStepNumberSpinBox = new QtxIntSpinBox( 1, 100, 1, CameraGroup );
- myStepNumberSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- CameraGroupLayout->addWidget( ZoomFactorLabel, 0, 0 );
- CameraGroupLayout->addWidget( myZoomFactorSpinBox, 0, 1 );
- CameraGroupLayout->addWidget( StepNumberLabel, 1, 0 );
- CameraGroupLayout->addWidget( myStepNumberSpinBox, 1, 1 );
-
- BoxLayout->addWidget( CameraGroup );
-
- // Display parent mesh element
- QGroupBox* PositionGroup = new QGroupBox( tr( "DATA_POSITION" ), aBox );
- //PositionGroup->setColumnLayout(0, Qt::Vertical );
- //PositionGroup->layout()->setSpacing( 0 );
- //PositionGroup->layout()->setMargin( 0 );
-
- QGridLayout* PositionGroupLayout = new QGridLayout (PositionGroup);
- PositionGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
- PositionGroupLayout->setSpacing(6);
- PositionGroupLayout->setMargin(11);
-
- QLabel* ParentElementLabel = new QLabel( tr( "PARENT_ELEMENT" ), PositionGroup );
-
- myParentElementLineEdit = new VVTK_ValidatedLineEdit( PositionGroup );
-
- QLabel* LocalPointLabel = new QLabel( tr( "LOCAL_POINT" ), PositionGroup );
-
- myLocalPointLineEdit = new VVTK_ValidatedLineEdit( PositionGroup );
-
- myDisplayParentMeshCheckBox = new QCheckBox( tr( "DISPLAY_PARENT_MESH" ), PositionGroup );
-
- PositionGroupLayout->addWidget( ParentElementLabel, 0, 0, 1, 3 );
- PositionGroupLayout->addWidget( myParentElementLineEdit, 0, 3 );
- PositionGroupLayout->addWidget( LocalPointLabel, 1, 0, 1, 3 );
- PositionGroupLayout->addWidget( myLocalPointLineEdit, 1, 3 );
- PositionGroupLayout->addWidget( myDisplayParentMeshCheckBox, 2, 0, 1, 4 );
-
- BoxLayout->addWidget( PositionGroup );
-
- // Common buttons ===========================================================
- QGroupBox* GroupButtons = new QGroupBox( this );
- //GroupButtons->setColumnLayout(0, Qt::Vertical );
- //GroupButtons->layout()->setSpacing( 0 );
- //GroupButtons->layout()->setMargin( 0 );
- QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons );
- GroupButtonsLayout->setAlignment( Qt::AlignTop );
- GroupButtonsLayout->setSpacing( 6 );
- GroupButtonsLayout->setMargin( 11 );
-
- QPushButton* buttonApply = new QPushButton( tr( "&Apply" ), GroupButtons );
- buttonApply->setAutoDefault( TRUE );
- buttonApply->setDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonApply, 0, 0 );
- GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
-
- QPushButton* buttonClose = new QPushButton( tr( "&Close" ) , GroupButtons );
- buttonClose->setAutoDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonClose, 0, 2 );
-
- QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons );
- buttonHelp->setAutoDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
-
- TopLayout->addWidget( aBox );
- TopLayout->addWidget( GroupButtons );
-
- connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onClickApply() ) );
- connect( buttonClose, SIGNAL( clicked() ), this, SLOT( onClickClose() ) );
- connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onClickHelp() ) );
-
- connect( myParentElementLineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( onSelectionValidate() ) );
- connect( myLocalPointLineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( onSelectionValidate() ) );
-
-}
-
-VVTK_PickingDlg::~VVTK_PickingDlg()
-{
-}
-
-void VVTK_PickingDlg::AddActor( VISU_GaussPtsAct* theActor )
-{
- //theActor->SetPickingSettings( myPickingSettings.GetPointer() );
-}
-
-void VVTK_PickingDlg::RemoveActor( VISU_GaussPtsAct* theActor )
-{
- //theActor->SetPickingSettings( NULL );
-}
-
-void VVTK_PickingDlg::Update()
-{
- float aCursorSize = 0.5;
- float aPyramidHeight = 10.0;
- float aPointTolerance = 0.1;
- QColor aColor = Qt::yellow;
- int anInfoWindowTransparency = 50;
- int anInfoWindowPosition = VISU_PickingSettings::BelowPoint;
- float aZoomFactor = 1.5;
- int aStepNumber = 10;
- bool aDisplayParentMesh = false;
-
- //if( !myPickingSettings->GetInitial() )
- {
- myCursorSizeSpinBox->setValue( myPickingSettings->GetCursorSize() );
- myPyramidHeightSpinBox->setValue( myPickingSettings->GetPyramidHeight() );
- myPointToleranceSpinBox->setValue( myPickingSettings->GetPointTolerance() );
- myTransparencySpinBox->setValue( int(myPickingSettings->GetInfoWindowTransparency() * 100.0) );
- myPositionComboBox->setCurrentIndex( myPickingSettings->GetInfoWindowPosition() );
- myZoomFactorSpinBox->setValue( myPickingSettings->GetZoomFactor() );
- myStepNumberSpinBox->setValue( myPickingSettings->GetStepNumber() );
- myDisplayParentMeshCheckBox->setChecked( myPickingSettings->GetDisplayParentMesh() );
-
- vtkFloatingPointType* aColor = myPickingSettings->GetColor();
-
- //QPalette aPalette( mySelectionColorButton->palette() );
- /*aPalette.setColor( mySelectionColorButton->backgroundRole(),
- QColor( ( int )( aColor[0] * 255.0 ),
- ( int )( aColor[1] * 255.0 ),
- ( int )( aColor[2] * 255.0 ) ) );
- mySelectionColorButton->setPalette( aPalette );*/
- mySelectionColorButton->setColor(
- QColor( ( int )( aColor[0] * 255.0 ),
- ( int )( aColor[1] * 255.0 ),
- ( int )( aColor[2] * 255.0 ) ) );
-
- return;
- }
-
- SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
- aCursorSize = aResourceMgr->doubleValue( "VISU", "picking_cursor_size", aCursorSize );
- myCursorSizeSpinBox->setValue( aCursorSize );
-
- aPyramidHeight = aResourceMgr->doubleValue( "VISU", "picking_pyramid_height", aPyramidHeight );
- myPyramidHeightSpinBox->setValue( aPyramidHeight );
-
- aPointTolerance = aResourceMgr->doubleValue( "VISU", "picking_point_tolerance", aPointTolerance );
- myPointToleranceSpinBox->setValue( aPointTolerance );
-
- aColor = aResourceMgr->colorValue( "VISU", "picking_selection_color", aColor );
- //QPalette aPalette( mySelectionColorButton->palette() );
- //aPalette.setColor( mySelectionColorButton->backgroundRole(), aColor );
- mySelectionColorButton->setColor( aColor );
-
- anInfoWindowTransparency = aResourceMgr->integerValue( "VISU", "picking_transparency", anInfoWindowTransparency );
- myTransparencySpinBox->setValue( anInfoWindowTransparency );
-
- anInfoWindowPosition = aResourceMgr->integerValue( "VISU", "picking_position", anInfoWindowPosition );
- myPositionComboBox->setCurrentIndex( anInfoWindowPosition );
-
- aZoomFactor = aResourceMgr->doubleValue( "VISU", "picking_zoom_factor", aZoomFactor );
- myZoomFactorSpinBox->setValue( aZoomFactor );
-
- aStepNumber = aResourceMgr->integerValue( "VISU", "picking_step_number", aStepNumber );
- myStepNumberSpinBox->setValue( aStepNumber );
-
- aDisplayParentMesh = aResourceMgr->booleanValue( "VISU", "picking_display_parent_mesh", aDisplayParentMesh );
- myDisplayParentMeshCheckBox->setChecked( aDisplayParentMesh );
-
- onClickApply();
-}
-
-void VVTK_PickingDlg::onSelectionValidate()
-{
- myParentElementLineEdit->MarkValidated( myParentElementLineEdit->text() );
- myLocalPointLineEdit->MarkValidated( myLocalPointLineEdit->text() );
-}
-
-void VVTK_PickingDlg::onSelectionEvent()
-{
- SelectorHelper aHelper( myInteractor );
- if ( !aHelper.get() )
- return;
-
- const TColStd_IndexedMapOfInteger& aMapIndex = aHelper.myMapIndex;
- if ( aMapIndex.Extent() != 1 )
- return;
-
- int anObjId = aHelper.myMapIndex(1);
-
- VISU::TGaussPointID aGaussPointID = aHelper.myPipeLine->GetObjID( anObjId );
-
- VISU::TCellID aCellID = aGaussPointID.first;
- myParentElementLineEdit->setText( QString::number( aCellID ) );
-
- VISU::TLocalPntID aLocalPntID = aGaussPointID.second;
- myLocalPointLineEdit->setText( QString::number( aLocalPntID ) );
-}
-
-VISU_PickingSettings*
-VVTK_PickingDlg
-::GetPickingSettings()
-{
- return myPickingSettings.GetPointer();
-}
-
-void VVTK_PickingDlg::SetInteractor( SVTK_RenderWindowInteractor* theInteractor )
-{
- myInteractor = theInteractor;
-
- theInteractor->GetDevice()->AddObserver(vtkCommand::KeyPressEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
- theInteractor->GetDevice()->AddObserver(vtkCommand::EndPickEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
- {
- QValidator* aValidator = new GaussCellIDValidator( myLocalPointLineEdit, theInteractor, myParentElementLineEdit );
- myParentElementLineEdit->setValidator( aValidator );
- }
- {
- QValidator* aValidator = new GaussLocalPointIDValidator( myParentElementLineEdit, theInteractor, myLocalPointLineEdit );
- myLocalPointLineEdit->setValidator( aValidator );
- }
-}
-
-void VVTK_PickingDlg::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
-{
- VVTK_PickingDlg* self = reinterpret_cast<VVTK_PickingDlg*>(theClientData);
-
- switch(theEvent){
- case vtkCommand::KeyPressEvent:
- self->KeyPressed();
- break;
- case vtkCommand::EndPickEvent:
- self->onSelectionEvent();
- break;
- }
-}
-
-void VVTK_PickingDlg::KeyPressed()
-{
- if( myInteractor->GetDevice()->GetKeyCode() == 'P' )
- {
- bool aDisplayParentMesh = !myPickingSettings->GetDisplayParentMesh();
- myPickingSettings->SetDisplayParentMesh( aDisplayParentMesh );
-
- myDisplayParentMeshCheckBox->setChecked( aDisplayParentMesh );
-
- myPickingSettings->InvokeEvent(VISU::UpdatePickingSettingsEvent,NULL);
- }
-}
-
-void VVTK_PickingDlg::onClickApply()
-{
- //myPickingSettings->SetInitial( false );
-
- myPickingSettings->SetCursorSize( myCursorSizeSpinBox->value() );
- myPickingSettings->SetPyramidHeight( myPyramidHeightSpinBox->value() );
- myPickingSettings->SetPointTolerance( myPointToleranceSpinBox->value() );
- myPickingSettings->SetInfoWindowTransparency( myTransparencySpinBox->value() / 100.0 );
- myPickingSettings->SetInfoWindowPosition( myPositionComboBox->currentIndex() );
- myPickingSettings->SetZoomFactor( myZoomFactorSpinBox->value() );
- myPickingSettings->SetStepNumber( myStepNumberSpinBox->value() );
- myPickingSettings->SetDisplayParentMesh( myDisplayParentMeshCheckBox->isChecked() );
-
- //QPalette aPalette( mySelectionColorButton->palette() );
- QColor aButtonColor = mySelectionColorButton->color();//aPalette.color(mySelectionColorButton->backgroundRole() );
- vtkFloatingPointType aColor[3];
- aColor[0] = aButtonColor.red() / 255.0;
- aColor[1] = aButtonColor.green() / 255.0;
- aColor[2] = aButtonColor.blue() / 255.0;
- myPickingSettings->SetColor( aColor );
-
- myPickingSettings->InvokeEvent( VISU::UpdatePickingSettingsEvent,NULL );
-
- SelectorHelper aHelper( myInteractor );
- if ( !aHelper.get() )
- return;
-
- VISU::TCellID aCellID = myParentElementLineEdit->text().toInt();
- VISU::TLocalPntID aLocalPntID = myLocalPointLineEdit->text().toInt();
- VISU::PGaussPtsIDMapper anIDMapper = aHelper.myPipeLine->GetGaussPtsIDMapper();
- vtkIdType anObjId = anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) );
- if ( anObjId < 0 )
- return;
-
- aHelper.myMapIndex.Clear();
- aHelper.myMapIndex.Add( anObjId );
- aHelper.mySelector->AddOrRemoveIndex( aHelper.myIO, aHelper.myMapIndex, false );
- aHelper.myActor->Highlight( aHelper.myIO );
- myInteractor->GetDevice()->CreateTimer( VTKI_TIMER_FIRST );
-}
-
-void VVTK_PickingDlg::onClickClose()
-{
- reject();
-}
-
-void VVTK_PickingDlg::onClickHelp()
-{
- QString aHelpFileName = "picking.htm";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
- app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
- else {
- QString platform;
-#ifdef WIN32
- platform = "winapplication";
-#else
- platform = "application";
-#endif
- SUIT_MessageBox::warning( 0,
- QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
- QObject::tr("BUT_OK"));
- }
-}
-
-/*void VVTK_PickingDlg::onColorButtonPressed()
-{
- QPalette aPalette( mySelectionColorButton->palette() );
- QColor aColor = QColorDialog::
- getColor( aPalette.color(mySelectionColorButton->backgroundRole() ), this );
-
- if( aColor.isValid() )
- {
- aPalette.setColor( mySelectionColorButton->backgroundRole(),
- aColor );
- mySelectionColorButton->setPalette( aPalette );
- }
-}*/
-
-void VVTK_PickingDlg::keyPressEvent( QKeyEvent* e )
-{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
-
- if ( e->key() == Qt::Key_F1 )
- {
- e->accept();
- onClickHelp();
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : VVTK_PickingDlg.h
-// Author : Oleg Uvarov
-// Module : VISU
-//
-#ifndef VVTK_PICKINGDLG_H
-#define VVTK_PICKINGDLG_H
-
-#include "SVTK_DialogBase.h"
-
-#include <vtkObject.h>
-#include <vtkSmartPointer.h>
-
-#include <QLineEdit>
-
-class vtkActorCollection;
-class vtkCallbackCommand;
-class vtkImageData;
-
-class QLabel;
-class QComboBox;
-class QCheckBox;
-class QPushButton;
-
-class QtxAction;
-class QtxDoubleSpinBox;
-class QtxIntSpinBox;
-class QtxColorButton;
-
-class VISU_GaussPtsAct;
-class VISU_PickingSettings;
-
-class SVTK_MainWindow;
-class SVTK_RenderWindowInteractor;
-class VVTK_ValidatedLineEdit;
-
-//! Picking Dialog.
-/*!
- * Uses for set up picking preferenses and apply
- * them to all actors in the current renderer.
- */
-class VVTK_PickingDlg : public SVTK_DialogBase
-{
- Q_OBJECT
-
-public:
- VVTK_PickingDlg(QtxAction* theAction,
- SVTK_MainWindow* theParent,
- const char* theName);
-
- ~VVTK_PickingDlg();
-
- //! Make an actor to listen the event of Update Picking Settings event.
- void AddActor( VISU_GaussPtsAct* );
- void RemoveActor( VISU_GaussPtsAct* );
-
- //! Update dialog contents.
- void Update();
-
- VISU_PickingSettings* GetPickingSettings();
-
- void SetInteractor( SVTK_RenderWindowInteractor* );
-
-protected slots:
- void onSelectionEvent();
- void onClickApply();
- void onClickClose();
- void onClickHelp();
-
- //void onColorButtonPressed();
- void onSelectionValidate();
-
-private:
- static void ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
-
- void KeyPressed();
- void keyPressEvent( QKeyEvent* e );
-
-private:
- QtxDoubleSpinBox* myCursorSizeSpinBox;
- QtxDoubleSpinBox* myPyramidHeightSpinBox;
- QtxColorButton* mySelectionColorButton;
- QtxDoubleSpinBox* myPointToleranceSpinBox;
- QtxIntSpinBox* myTransparencySpinBox;
- QComboBox* myPositionComboBox;
- QtxDoubleSpinBox* myZoomFactorSpinBox;
- QtxIntSpinBox* myStepNumberSpinBox;
- QCheckBox* myDisplayParentMeshCheckBox;
-
- QtxAction* myAction;
- vtkSmartPointer<VISU_PickingSettings>
- myPickingSettings;
-
- VVTK_ValidatedLineEdit*
- myParentElementLineEdit;
- VVTK_ValidatedLineEdit*
- myLocalPointLineEdit;
-
- SVTK_RenderWindowInteractor*
- myInteractor;
-
- float myPriority;
- vtkSmartPointer<vtkCallbackCommand>
- myEventCallbackCommand;
-};
-
-class VVTK_ValidatedLineEdit : public QLineEdit
-{
- Q_OBJECT;
-public:
- VVTK_ValidatedLineEdit( QWidget* parent );
-
-public slots:
- void MarkValidated( const QString& theText );
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// VISU VISUGUI : GUI of VISU component
-// File : VVTK_PrimitiveBox.cxx
-// Author : Oleg UVAROV
-// Module : VISU
-//
-#include "VVTK_PrimitiveBox.h"
-
-#include "VISU_OpenGLPointSpriteMapper.hxx"
-
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-
-#include "QtxDoubleSpinBox.h"
-#include "QtxIntSpinBox.h"
-
-#include <QLayout>
-#include <QLabel>
-#include <QLineEdit>
-#include <QButtonGroup>
-#include <QRadioButton>
-#include <QPushButton>
-#include <QFileDialog>
-
-#include <iostream>
-
-using namespace std;
-
-VVTK_PrimitiveBox::VVTK_PrimitiveBox( QWidget* parent ) :
- QGroupBox( parent )
-{
- SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
- setTitle( tr( "PRIMITIVE_TITLE" ) );
- //setColumnLayout(0, Qt::Vertical );
- //layout()->setSpacing( 0 );
- //layout()->setMargin( 0 );
-
- QGridLayout* aLayout = new QGridLayout( this );
- aLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- aLayout->setSpacing(6);
- aLayout->setMargin(11);
-
- myPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
-
- QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/";
- myMainTexture = aRootDir + "sprite_texture.bmp";
- myAlphaTexture = aRootDir + "sprite_alpha.bmp";
-
- // Primitive Type
- QGroupBox* aPrimitiveTypeGroup = new QGroupBox( this );
- aPrimitiveTypeGroup->setMinimumWidth( 450 );
- QHBoxLayout* aPrimLayout = new QHBoxLayout( aPrimitiveTypeGroup );
- aPrimLayout->setMargin( 0 );
-
- //QButtonGroup* aPrimitiveTypeGroup = new QButtonGroup( 3, Qt::Horizontal, this, "PrimitiveTypeGroup" );
- //aPrimitiveTypeGroup->setMinimumWidth( 450 );
- //aPrimitiveTypeGroup->setRadioButtonExclusive( true );
- //aPrimitiveTypeGroup->setFrameStyle( QFrame::NoFrame );
- //aPrimitiveTypeGroup->layout()->setMargin( 0 );
-
- myPointSpriteButton = new QRadioButton( tr( "POINT_SPRITE" ), aPrimitiveTypeGroup );
- myOpenGLPointButton = new QRadioButton( tr( "OPENGL_POINT" ), aPrimitiveTypeGroup );
- myGeomSphereButton = new QRadioButton( tr( "GEOMETRICAL_SPHERE" ), aPrimitiveTypeGroup );
-
- aPrimLayout->addWidget( myPointSpriteButton );
- aPrimLayout->addWidget( myOpenGLPointButton );
- aPrimLayout->addWidget( myGeomSphereButton );
-
- aLayout->addWidget( aPrimitiveTypeGroup, 0, 0, 1, 2 );
-
- // Clamp ( Point Sprite & OpenGL Point )
- myClampLabel = new QLabel( tr( "CLAMP" ), this );
- myClampSpinBox = new QtxDoubleSpinBox( 1.0, 512.0, 1.0, this );
- myClampSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- aLayout->addWidget( myClampLabel, 1, 0 );
- aLayout->addWidget( myClampSpinBox, 1, 1, 1, 2 );
-
- // Main Texture ( Point Sprite )
- myMainTextureLabel = new QLabel( tr( "MAIN_TEXTURE" ), this );
- myMainTextureLineEdit = new QLineEdit( this );
- myMainTextureButton = new QPushButton( this );
- myMainTextureButton->setAutoDefault( false );
- myMainTextureButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) );
- connect( myMainTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseMainTexture() ) );
-
- aLayout->addWidget( myMainTextureLabel, 2, 0 );
- aLayout->addWidget( myMainTextureLineEdit, 2, 1 );
- aLayout->addWidget( myMainTextureButton, 2, 2 );
-
- // Alpha Texture ( Point Sprite )
- myAlphaTextureLabel = new QLabel( tr( "ALPHA_TEXTURE" ), this );
- myAlphaTextureLineEdit = new QLineEdit( this );
- myAlphaTextureButton = new QPushButton( this );
- myAlphaTextureButton->setAutoDefault( false );
- myAlphaTextureButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) );
- connect( myAlphaTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseAlphaTexture() ) );
-
- aLayout->addWidget( myAlphaTextureLabel, 3, 0 );
- aLayout->addWidget( myAlphaTextureLineEdit, 3, 1 );
- aLayout->addWidget( myAlphaTextureButton, 3, 2 );
-
- // Alpha Threshold ( Point Sprite )
- myAlphaThresholdLabel = new QLabel( tr( "ALPHA_THRESHOLD" ), this );
- myAlphaThresholdSpinBox = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, this );
- myAlphaThresholdSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- aLayout->addWidget( myAlphaThresholdLabel, 4, 0 );
- aLayout->addWidget( myAlphaThresholdSpinBox, 4, 1, 1, 2 );
-
- // Resolution ( Geometrical Sphere )
- myResolutionLabel = new QLabel( tr( "RESOLUTION" ), this );
- myResolutionSpinBox = new QtxIntSpinBox( 3, 100, 1, this );
- myResolutionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- connect( myResolutionSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( onResolutionChanged( int ) ) );
-
- aLayout->addWidget( myResolutionLabel, 5, 0 );
- aLayout->addWidget( myResolutionSpinBox, 5, 1, 1, 2 );
-
- // Number of faces ( Geometrical Sphere )
- myFaceNumberLabel = new QLabel( tr( "FACE_NUMBER" ), this );
- myFaceNumberLineEdit = new QLineEdit( this );
- myFaceNumberLineEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myFaceNumberLineEdit->setEnabled( false );
- //myFaceNumberLineEdit->setReadOnly( true );
-
- aLayout->addWidget( myFaceNumberLabel, 6, 0 );
- aLayout->addWidget( myFaceNumberLineEdit, 6, 1, 1, 2 );
-
- // Notification ( Geometrical Sphere )
- myFaceLimitLabel = new QLabel( tr( "FACE_LIMIT" ), this );
- myFaceLimitSpinBox = new QtxIntSpinBox( 10, 1000000, 10, this );
- myFaceLimitSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- aLayout->addWidget( myFaceLimitLabel, 7, 0 );
- aLayout->addWidget( myFaceLimitSpinBox, 7, 1, 1, 2 );
-
- connect( myPointSpriteButton, SIGNAL( clicked() ), this, SLOT( onTogglePointSprite() ) );
- connect( myOpenGLPointButton, SIGNAL( clicked() ), this, SLOT( onToggleOpenGLPoint() ) );
- connect( myGeomSphereButton, SIGNAL( clicked() ), this, SLOT( onToggleGeomSphere() ) );
-}
-
-void VVTK_PrimitiveBox::onTogglePointSprite()
-{
- myPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
-
- myClampLabel->show();
- myClampSpinBox->show();
-
- myMainTextureLabel->show();
- myMainTextureLineEdit->show();
- myMainTextureButton->show();
-
- myAlphaTextureLabel->show();
- myAlphaTextureLineEdit->show();
- myAlphaTextureButton->show();
-
- myAlphaThresholdLabel->show();
- myAlphaThresholdSpinBox->show();
-
- myResolutionLabel->hide();
- myResolutionSpinBox->hide();
-
- myFaceNumberLabel->hide();
- myFaceNumberLineEdit->hide();
-
- myFaceLimitLabel->hide();
- myFaceLimitSpinBox->hide();
-}
-
-void VVTK_PrimitiveBox::onToggleOpenGLPoint()
-{
- myPrimitiveType = VISU_OpenGLPointSpriteMapper::OpenGLPoint;
-
- myClampLabel->show();
- myClampSpinBox->show();
-
- myMainTextureLabel->hide();
- myMainTextureLineEdit->hide();
- myMainTextureButton->hide();
-
- myAlphaTextureLabel->hide();
- myAlphaTextureLineEdit->hide();
- myAlphaTextureButton->hide();
-
- myAlphaThresholdLabel->hide();
- myAlphaThresholdSpinBox->hide();
-
- myResolutionLabel->hide();
- myResolutionSpinBox->hide();
-
- myFaceNumberLabel->hide();
- myFaceNumberLineEdit->hide();
-
- myFaceLimitLabel->hide();
- myFaceLimitSpinBox->hide();
-}
-
-void VVTK_PrimitiveBox::onToggleGeomSphere()
-{
- myPrimitiveType = VISU_OpenGLPointSpriteMapper::GeomSphere;
-
- myClampLabel->hide();
- myClampSpinBox->hide();
-
- myMainTextureLabel->hide();
- myMainTextureLineEdit->hide();
- myMainTextureButton->hide();
-
- myAlphaTextureLabel->hide();
- myAlphaTextureLineEdit->hide();
- myAlphaTextureButton->hide();
-
- myAlphaThresholdLabel->hide();
- myAlphaThresholdSpinBox->hide();
-
- myResolutionLabel->show();
- myResolutionSpinBox->show();
-
- myFaceNumberLabel->show();
- myFaceNumberLineEdit->show();
-
- myFaceLimitLabel->show();
- myFaceLimitSpinBox->show();
-}
-
-void VVTK_PrimitiveBox::onResolutionChanged( int theResolution )
-{
- setFaceNumber( 2 * theResolution * ( theResolution - 2 ) );
-}
-
-void VVTK_PrimitiveBox::setPrimitiveType( int theType )
-{
- myPrimitiveType = theType;
-
- switch( myPrimitiveType )
- {
- case VISU_OpenGLPointSpriteMapper::PointSprite :
- myPointSpriteButton->setChecked( true );
- onTogglePointSprite();
- break;
- case VISU_OpenGLPointSpriteMapper::OpenGLPoint :
- myOpenGLPointButton->setChecked( true );
- onToggleOpenGLPoint();
- break;
- case VISU_OpenGLPointSpriteMapper::GeomSphere :
- myGeomSphereButton->setChecked( true );
- onToggleGeomSphere();
- break;
- default : break;
- }
-}
-
-float VVTK_PrimitiveBox::getClamp() const
-{
- return myClampSpinBox->value();
-}
-
-void VVTK_PrimitiveBox::setClamp( float theClamp )
-{
- myClampSpinBox->setValue( theClamp );
-}
-
-void VVTK_PrimitiveBox::setClampMaximum( float theClampMaximum )
-{
- myClampSpinBox->setMaximum( theClampMaximum );
-}
-
-void VVTK_PrimitiveBox::setMainTexture( const QString& theMainTexture )
-{
- myMainTexture = theMainTexture;
- myMainTextureLineEdit->setText( theMainTexture.section( '/', -1 ) );
-}
-
-void VVTK_PrimitiveBox::setAlphaTexture( const QString& theAlphaTexture )
-{
- myAlphaTexture = theAlphaTexture;
- myAlphaTextureLineEdit->setText( theAlphaTexture.section( '/', -1 ) );
-}
-
-float VVTK_PrimitiveBox::getAlphaThreshold() const
-{
- return myAlphaThresholdSpinBox->value();
-}
-
-void VVTK_PrimitiveBox::setAlphaThreshold( float theAlphaThreshold )
-{
- myAlphaThresholdSpinBox->setValue( theAlphaThreshold );
-}
-
-int VVTK_PrimitiveBox::getResolution() const
-{
- return myResolutionSpinBox->value();
-}
-
-void VVTK_PrimitiveBox::setResolution( int theResolution )
-{
- myResolutionSpinBox->setValue( theResolution );
-}
-
-int VVTK_PrimitiveBox::getFaceNumber() const
-{
- int aResolution = getResolution();
- return 2 * aResolution * ( aResolution - 2 );
- //return myFaceNumberLineEdit->text().toInt();
-}
-
-void VVTK_PrimitiveBox::setFaceNumber( int theFaceNumber )
-{
- myFaceNumberLineEdit->setText( QString::number( theFaceNumber ) );
-}
-
-int VVTK_PrimitiveBox::getFaceLimit() const
-{
- return myFaceLimitSpinBox->value();
-}
-
-void VVTK_PrimitiveBox::setFaceLimit( int theFaceLimit )
-{
- myFaceLimitSpinBox->setValue( theFaceLimit );
-}
-
-void VVTK_PrimitiveBox::onBrowseMainTexture()
-{
- QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/";
- QString aFileName = QFileDialog::getOpenFileName( this,
- 0,
- aRootDir,
- "Bitmap (*.bmp *.jpg *.png)" );
-
- if( aFileName.isNull() )
- return;
-
- myMainTexture = aFileName;
- myMainTextureLineEdit->setText( aFileName.section( '/', -1 ) );
-}
-
-void VVTK_PrimitiveBox::onBrowseAlphaTexture()
-{
- QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/";
- QString aFileName = QFileDialog::getOpenFileName( this,
- 0,
- aRootDir,
- "Bitmap (*.bmp *.jpg *.png)" );
-
- if( aFileName.isNull() )
- return;
-
- myAlphaTexture = aFileName;
- myAlphaTextureLineEdit->setText( aFileName.section( '/', -1 ) );
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// VISU VISUGUI : GUI of VISU component
-// File : VVTK_PrimitiveBox.h
-// Author : Oleg UVAROV
-// Module : VISU
-//
-#ifndef VVTK_PRIMITIVEBOX_H
-#define VVTK_PRIMITIVEBOX_H
-
-#include "VVTK.h"
-
-#include <QGroupBox>
-
-class QLabel;
-class QLineEdit;
-class QPushButton;
-class QRadioButton;
-
-class QtxDoubleSpinBox;
-class QtxIntSpinBox;
-
-class VVTK_EXPORT VVTK_PrimitiveBox : public QGroupBox
-{
- Q_OBJECT
-
-public:
- VVTK_PrimitiveBox( QWidget* );
- ~VVTK_PrimitiveBox() {}
-
-public:
- int getPrimitiveType() const { return myPrimitiveType; }
- void setPrimitiveType( int );
-
- float getClamp() const;
- void setClamp( float );
- void setClampMaximum( float );
-
- QString getMainTexture() const { return myMainTexture; }
- void setMainTexture( const QString& );
-
- QString getAlphaTexture() const { return myAlphaTexture; }
- void setAlphaTexture( const QString& );
-
- float getAlphaThreshold() const;
- void setAlphaThreshold( float );
-
- int getResolution() const;
- void setResolution( int );
-
- int getFaceNumber() const;
- void setFaceNumber( int );
-
- int getFaceLimit() const;
- void setFaceLimit( int );
-
-protected slots:
- void onTogglePointSprite();
- void onToggleOpenGLPoint();
- void onToggleGeomSphere();
-
- void onBrowseMainTexture();
- void onBrowseAlphaTexture();
-
- void onResolutionChanged( int );
-
-private:
- int myPrimitiveType;
-
- QRadioButton* myPointSpriteButton;
- QRadioButton* myOpenGLPointButton;
- QRadioButton* myGeomSphereButton;
-
- QString myMainTexture;
- QString myAlphaTexture;
-
- QLabel* myClampLabel;
- QtxDoubleSpinBox* myClampSpinBox;
-
- QLabel* myMainTextureLabel;
- QLineEdit* myMainTextureLineEdit;
- QPushButton* myMainTextureButton;
-
- QLabel* myAlphaTextureLabel;
- QLineEdit* myAlphaTextureLineEdit;
- QPushButton* myAlphaTextureButton;
-
- QLabel* myAlphaThresholdLabel;
- QtxDoubleSpinBox* myAlphaThresholdSpinBox;
-
- QLabel* myResolutionLabel;
- QtxIntSpinBox* myResolutionSpinBox;
-
- QLabel* myFaceNumberLabel;
- QLineEdit* myFaceNumberLineEdit;
-
- QLabel* myFaceLimitLabel;
- QtxIntSpinBox* myFaceLimitSpinBox;
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME VTKViewer : build VTK viewer into Salome desktop
-// File :
-// Author :
-// Module :
-// $Header$
-//
-#include "VVTK_Recorder.h"
-
-#include "VVTK_ImageWriter.h"
-#include "VVTK_ImageWriterMgr.h"
-
-#include <vtkObjectFactory.h>
-#include <vtkObject.h>
-#include <vtkCallbackCommand.h>
-#include <vtkRenderWindow.h>
-#include <vtkTimerLog.h>
-#include <vtkWindowToImageFilter.h>
-#include <vtkJPEGWriter.h>
-#include <vtkImageData.h>
-
-#include <sstream>
-#include <iomanip>
-#include <iostream>
-
-#ifndef WIN32
-#include <unistd.h>
-#endif
-
-#include <QApplication>
-#include <QFileInfo>
-#include <QDir>
-
-#include "utilities.h"
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-
-namespace
-{
- //----------------------------------------------------------------------------
- inline
- void
- GetNameJPEG(const std::string& thePreffix,
- const int theIndex,
- std::string& theName)
- {
- using namespace std;
- ostringstream aStream;
- aStream<<thePreffix<<"_"<<setw(6)<<setfill('0')<<theIndex<<".jpeg";
- theName = aStream.str();
- }
-}
-
-//----------------------------------------------------------------------------
-vtkCxxRevisionMacro(VVTK_Recorder,"$Revision$");
-vtkStandardNewMacro(VVTK_Recorder);
-
-
-//----------------------------------------------------------------------------
-VVTK_Recorder
-::VVTK_Recorder():
- myRenderWindow(NULL),
- myState(VVTK_Recorder_Stop),
- myNbFPS(5.5),
- myQuality(100),
- myProgressiveMode(true),
- myUseSkippedFrames(true),
- myErrorStatus(0),
- myCommand(vtkCallbackCommand::New()),
- myPriority(0.0),
- myTimeStart(0.0),
- myFrameIndex(0),
- myPaused(0),
- myFilter(vtkWindowToImageFilter::New()),
- myWriterMgr(new VVTK_ImageWriterMgr),
- myNbWrittenFrames(0),
- myNameAVIMaker("jpeg2yuv")
-{
- myCommand->SetClientData(this);
- myCommand->SetCallback(VVTK_Recorder::ProcessEvents);
-}
-
-
-//----------------------------------------------------------------------------
-VVTK_Recorder
-::~VVTK_Recorder()
-{
- myCommand->Delete();
- myFilter->Delete();
- delete myWriterMgr;
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Recorder
-::CheckExistAVIMaker()
-{
- myErrorStatus = 0;
- using namespace std;
- ostringstream aStream;
- aStream<<"which "<<myNameAVIMaker<<" >& /dev/null";
- std::string anAVIMakeCheck = aStream.str();
- int iErr = system(anAVIMakeCheck.c_str());
- if(iErr != 0)
- myErrorStatus = 127;
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Recorder
-::SetName(const char* theName)
-{
- myName = theName;
-}
-
-const char*
-VVTK_Recorder::Name() const
-{
- return myName.c_str();
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Recorder
-::SetNbFPS(const double theNbFPS)
-{
- myNbFPS = theNbFPS;
-}
-
-double
-VVTK_Recorder
-::NbFPS() const
-{
- return myNbFPS;
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Recorder
-::SetQuality(int theQuality)
-{
- myQuality = theQuality;
-}
-
-int
-VVTK_Recorder
-::GetQuality() const
-{
- return myQuality;
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Recorder
-::SetRenderWindow(vtkRenderWindow* theRenderWindow)
-{
- myRenderWindow = theRenderWindow;
-}
-
-vtkRenderWindow*
-VVTK_Recorder
-::RenderWindow()
-{
- return myRenderWindow;
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Recorder
-::SetProgressiveMode(bool theProgressiveMode)
-{
- myProgressiveMode = theProgressiveMode;
-}
-
-bool
-VVTK_Recorder
-::GetProgressiveMode() const
-{
- return myProgressiveMode;
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Recorder
-::SetUseSkippedFrames(bool theUseSkippedFrames)
-{
- myUseSkippedFrames = theUseSkippedFrames;
-}
-
-bool
-VVTK_Recorder
-::UseSkippedFrames() const
-{
- return myUseSkippedFrames;
-}
-
-
-//----------------------------------------------------------------------------
-int
-VVTK_Recorder
-::ErrorStatus() const
-{
- return myErrorStatus;
-}
-
-int
-VVTK_Recorder
-::State() const
-{
- return myState;
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Recorder
-::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
-{
- if(vtkObject* anObj = reinterpret_cast<vtkObject*>(theClientData)){
- if(VVTK_Recorder* aSelf = dynamic_cast<VVTK_Recorder*>(anObj)){
- if(theEvent==vtkCommand::EndEvent){
- if(aSelf->State() == VVTK_Recorder::VVTK_Recorder_Record){
- aSelf->DoRecord();
- }
- }
- }
- }
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Recorder
-::Record()
-{
- if(myState == VVTK_Recorder_Stop){
- if(myRenderWindow){
- myState = VVTK_Recorder_Record;
- myFilter->SetInput(myRenderWindow);
- myFrameIndex = -1;
- myNbWrittenFrames = 0;
- myRenderWindow->RemoveObserver(myCommand);
- myRenderWindow->AddObserver(vtkCommand::EndEvent,
- myCommand,
- myPriority);
- myRenderWindow->Render();
- }
- }
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Recorder
-::Stop()
-{
- QApplication::setOverrideCursor( Qt::WaitCursor );
-
- if(myState == VVTK_Recorder_Record){
- if(!myPaused)
- DoRecord();
-
- myWriterMgr->Stop();
-
- if(myUseSkippedFrames)
- AddSkippedFrames();
-
- myFrameIndexes.clear();
-
- MakeFileAVI();
- }
- myState = VVTK_Recorder_Stop;
- myPaused = 0;
-
- QApplication::restoreOverrideCursor();
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Recorder
-::Pause()
-{
- myPaused = myPaused ? 0 : 1;
- if(myPaused && !myFrameIndexes.empty()){
- myFrameIndexes.back() *= -1;
- if(MYDEBUG) MESSAGE("VVTK_Recorder::Pause - myFrameIndexes.back() = "<<myFrameIndexes.back());
- }
-}
-
-
-//----------------------------------------------------------------------------
-inline
-int
-GetFrameIndex(double theStartTime,
- double theFPS)
-{
- double aTimeNow = vtkTimerLog::GetCurrentTime();
- double aDelta = aTimeNow - theStartTime;
- return int(aDelta*theFPS);
-}
-
-void
-VVTK_Recorder
-::DoRecord()
-{
- if(myPaused)
- return;
-
- if(myFrameIndex < 0){
- myFrameIndex = 0;
- myTimeStart = vtkTimerLog::GetCurrentTime();
- }else{
- int aFrameIndex = GetFrameIndex(myTimeStart,myNbFPS);
- if(aFrameIndex <= myFrameIndex)
- return;
-
- // If there was a "pause" we correct the myTimeStart
- int aLastFrameIndex = myFrameIndexes.back();
- if(aLastFrameIndex < 0){
- myFrameIndexes.back() = abs(myFrameIndexes.back());
- double aPauseTime = fabs((double)(aFrameIndex - myFrameIndex - 1)) / myNbFPS;
- if(MYDEBUG)
- MESSAGE("VVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
- "; aPauseTime = "<<aPauseTime);
- myTimeStart += aPauseTime;
- }
-
- aFrameIndex = GetFrameIndex(myTimeStart,myNbFPS);
- if(aFrameIndex <= myFrameIndex)
- return;
-
- myFrameIndex = aFrameIndex;
- }
-
- myFrameIndexes.push_back(myFrameIndex);
- if(MYDEBUG) MESSAGE("VVTK_Recorder::DoRecord - myFrameIndex = "<<myFrameIndex);
-
- myRenderWindow->RemoveObserver(myCommand);
- myFilter->Modified();
-
- std::string aName;
- GetNameJPEG(myName,myFrameIndex,aName);
-
- PreWrite();
-
- vtkImageData *anImageData = vtkImageData::New();
- anImageData->DeepCopy(myFilter->GetOutput());
-
- myWriterMgr->StartImageWriter(anImageData,aName,myProgressiveMode,myQuality);
- myNbWrittenFrames++;
-
- myRenderWindow->AddObserver(vtkCommand::EndEvent,
- myCommand,
- myPriority);
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Recorder
-::PreWrite()
-{
- vtkImageData *anImageData = myFilter->GetOutput();
- //
- if(!anImageData){
- myErrorStatus = 20;
- return;
- }
- anImageData->UpdateInformation();
- int *anExtent = anImageData->GetWholeExtent();
- anImageData->SetUpdateExtent(anExtent[0], anExtent[1],
- anExtent[2], anExtent[3],
- 0,0);
- anImageData->UpdateData();
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Recorder
-::AddSkippedFrames()
-{
- myErrorStatus = 0;
-
- if(myFrameIndexes.size() < 2)
- return;
-
- size_t anId = 0, anEnd = myFrameIndexes.size() - 1;
- for(; anId < anEnd; anId++){
- int aStartIndex = myFrameIndexes[anId];
- if(aStartIndex < 0)
- continue;
-
- int aFinishIndex = abs(myFrameIndexes[anId + 1]);
- if(aStartIndex + 1 == aFinishIndex)
- continue;
-
- std::string anInitialName;
- std::ostringstream aStream;
- GetNameJPEG(myName,aStartIndex,anInitialName);
- for(int anIndex = aStartIndex + 1; anIndex < aFinishIndex; anIndex++){
- myNbWrittenFrames++;
- std::string anCurrentName;
- GetNameJPEG(myName,anIndex,anCurrentName);
- aStream<<"ln -s "<< anInitialName<<" "<<anCurrentName<<";";
- if(anIndex + 1 < aFinishIndex)
- aStream<<" \\";
- aStream<<endl;
- }
- std::string aString(aStream.str());
- system(aString.c_str());
- if(MYDEBUG) MESSAGE("VVTK_Recorder::AddSkippedFrames - "<<aString);
- }
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Recorder
-::MakeFileAVI()
-{
- myErrorStatus = 0;
- std::ostringstream aStream;
- aStream<<myNameAVIMaker<<
- " -I p"<<
- " -v 0"<<
- //" -f "<<int(myNbFPS)<<" "<<
- " -f "<<myNbFPS<<" "<<
- " -n "<<myNbWrittenFrames<<" "<<
- " -j "<<myName<<"_\%06d.jpeg "<<
- "| yuv2lav"<<
- " -o "<<myName;
-
- std::string aString(aStream.str());
- myErrorStatus = system(aString.c_str());
-
- if(MYDEBUG) MESSAGE("VVTK_Recorder::MakeFileAVI - "<<aString);
-
- QFileInfo aFileInfo(myName.c_str());
- QString aDirPath = aFileInfo.absoluteDir().path();
- QString aBaseName = aFileInfo.fileName();
- QString aCommand =
- QString("(cd ") + aDirPath +
- "; ls " +
- " | egrep '" + aBaseName + "_[0-9]*.jpeg'" +
- " | xargs rm " +
- ")";
-
- aCommand =
- QString("rm ") + aDirPath + "/" + aBaseName + "*.jpeg";
-
- if(MYDEBUG) MESSAGE("VVTK_Recorder::MakeFileAVI - "<<aCommand.toLatin1().data() );
- system((const char*)aCommand.toLatin1());
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME VTKViewer : build VTK viewer into Salome desktop
-// File :
-// Author :
-// Module : SALOME
-// $Header$
-//
-#ifndef _VVTK_Recorder_Header_File_
-#define _VVTK_Recorder_Header_File_
-
-#include <list>
-#include <string>
-#include <vector>
-
-#include <vtkObject.h>
-
-class vtkRenderWindow;
-class vtkCallbackCommand;
-class vtkWindowToImageFilter;
-class VVTK_ImageWriterMgr;
-//
-class VVTK_Recorder : public vtkObject
-{
- protected:
- enum State {
- VVTK_Recorder_Unknown=0,
- VVTK_Recorder_Record,
- VVTK_Recorder_Stop
- };
-
- public:
- static VVTK_Recorder *New();
- vtkTypeRevisionMacro(VVTK_Recorder,vtkObject);
-
- void
- SetRenderWindow(vtkRenderWindow* theRenderWindow);
-
- vtkRenderWindow*
- RenderWindow();
-
- void
- SetName(const char *theName);
-
- const char*
- Name() const;
-
- void
- SetNbFPS(const double theNbFPS);
-
- double
- NbFPS() const;
-
- void
- SetQuality(int theQuality);
-
- int
- GetQuality() const;
-
- void
- SetProgressiveMode(bool theProgressiveMode);
-
- bool
- GetProgressiveMode() const;
-
- void
- SetUseSkippedFrames(bool theUseSkippedFrames);
-
- bool
- UseSkippedFrames() const;
-
- void
- Record();
-
- void
- Pause();
-
- void
- Stop();
-
- int
- State() const;
-
- int
- ErrorStatus() const;
-
- void
- CheckExistAVIMaker();
-
-protected :
- VVTK_Recorder();
-
- ~VVTK_Recorder();
-
- void
- DoRecord();
-
- void
- MakeFileAVI();
-
- void
- AddSkippedFrames();
-
- void
- PreWrite();
-
- static
- void
- ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
-
-protected :
- int myState;
- int myPaused;
- int myErrorStatus;
-
- float myPriority;
- double myTimeStart;
-
- int myFrameIndex;
- int myNbWrittenFrames;
-
- double myNbFPS;
- int myQuality;
- bool myProgressiveMode;
-
- typedef std::vector<int> TFrameIndexes;
- TFrameIndexes myFrameIndexes;
- bool myUseSkippedFrames;
-
- std::string myName;
- std::string myNameAVIMaker;
-
- vtkCallbackCommand *myCommand;
- vtkRenderWindow *myRenderWindow;
- vtkWindowToImageFilter *myFilter;
- VVTK_ImageWriterMgr *myWriterMgr;
-
-
-private:
- VVTK_Recorder(const VVTK_Recorder&); //Not implemented
- void operator=(const VVTK_Recorder&); //Not implemented
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// VISU VISUGUI : GUI of VISU component
-// File : VVTK_RecorderDlg.cxx
-// Author : Oleg UVAROV
-// Module : VISU
-//
-#include "VVTK_RecorderDlg.h"
-#include "VVTK_Recorder.h"
-
-#include "SUIT_FileDlg.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-
-#include "QtxDoubleSpinBox.h"
-#include "QtxIntSpinBox.h"
-
-#include "LightApp_Application.h"
-
-#include "CAM_Module.h"
-
-#include <QCheckBox>
-#include <QComboBox>
-#include <QGroupBox>
-#include <QKeyEvent>
-#include <QLabel>
-#include <QLayout>
-#include <QLineEdit>
-#include <QPushButton>
-
-/*!
- * Constructor
- */
-VVTK_RecorderDlg::VVTK_RecorderDlg( QWidget* theParent, VVTK_Recorder* theRecorder ):
- QDialog( theParent ),
- myRecorder( theRecorder )
-{
- setWindowTitle( tr( "DLG_RECORDER_TITLE" ) );
-
- SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
- QVBoxLayout* aTopLayout = new QVBoxLayout( this );
- aTopLayout->setSpacing( 6 );
- aTopLayout->setMargin( 6 );
- //aTopLayout->setAutoAdd( true );
-
- // Settings
- QGroupBox* mySettingsBox = new QGroupBox( tr( "SETTINGS" ), this );
- //mySettingsBox->setColumnLayout( 0, Qt::Vertical );
- //mySettingsBox->layout()->setSpacing( 0 );
- //mySettingsBox->layout()->setMargin( 0 );
-
- QGridLayout* aSettingsLayout = new QGridLayout( mySettingsBox );
- aSettingsLayout->setSpacing( 6 );
- aSettingsLayout->setMargin( 11 );
-
- QLabel* aFileNameLabel = new QLabel( tr( "FILE_NAME" ), mySettingsBox );
- myFileNameLineEdit = new QLineEdit( mySettingsBox );
- myFileNameLineEdit->setMinimumWidth( 250 );
- myFileNameLineEdit->setReadOnly( true );
-
- QLabel* aRecordingModeLabel = new QLabel( tr( "RECORDING_MODE" ), mySettingsBox );
- myRecordingModeComboBox = new QComboBox( mySettingsBox );
- myRecordingModeComboBox->addItem( tr( "SKIPPED_FRAMES" ) );
- myRecordingModeComboBox->addItem( tr( "ALL_DISLPAYED_FRAMES" ) );
- myRecordingModeComboBox->setCurrentIndex( aResourceMgr->integerValue( "VISU", "recorder_mode", 1 ) );
-
- QLabel* aFPSLabel = new QLabel( tr( "FPS" ), mySettingsBox );
- myFPSSpinBox = new QtxDoubleSpinBox( 0.1, 100.0, 1.0, mySettingsBox );
- myFPSSpinBox->setValue( aResourceMgr->doubleValue( "VISU", "recorder_fps", 10.0 ) );
-
- QLabel* aQualityLabel = new QLabel( tr( "QUALITY" ), mySettingsBox );
- myQualitySpinBox = new QtxIntSpinBox( 1, 100, 1, mySettingsBox );
- myQualitySpinBox->setValue( aResourceMgr->integerValue( "VISU", "recorder_quality", 80 ) );
-
- myProgressiveCheckBox = new QCheckBox( tr( "PROGRESSIVE" ), mySettingsBox );
- myProgressiveCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "recorder_progressive", false ) );
-
- aSettingsLayout->addWidget( aFileNameLabel, 0, 0 );
- aSettingsLayout->addWidget( myFileNameLineEdit, 1, 0, 1, 2 );
- //aSettingsLayout->addWidget( aFileNameButton, 1, 2 );
- aSettingsLayout->addWidget( aRecordingModeLabel, 2, 0 );
- aSettingsLayout->addWidget( myRecordingModeComboBox, 2, 1 );
- aSettingsLayout->addWidget( aFPSLabel, 3, 0 );
- aSettingsLayout->addWidget( myFPSSpinBox, 3, 1 );
- aSettingsLayout->addWidget( aQualityLabel, 4, 0 );
- aSettingsLayout->addWidget( myQualitySpinBox, 4, 1 );
- aSettingsLayout->addWidget( myProgressiveCheckBox, 5, 0 );
-
- aTopLayout->addWidget( mySettingsBox );
-
- // Start / Close
- QGroupBox* CommonGroup = new QGroupBox( this );
- //CommonGroup->setColumnLayout(0, Qt::Vertical );
- //CommonGroup->layout()->setSpacing( 0 );
- //CommonGroup->layout()->setMargin( 0 );
- QGridLayout* CommonGroupLayout = new QGridLayout( CommonGroup );
- CommonGroupLayout->setAlignment( Qt::AlignTop );
- CommonGroupLayout->setSpacing( 6 );
- CommonGroupLayout->setMargin( 11 );
-
- QPushButton* aStartButton = new QPushButton( tr( "START" ), CommonGroup );
- aStartButton->setAutoDefault( true );
- aStartButton->setDefault( true );
- CommonGroupLayout->addWidget( aStartButton, 0, 0 );
- CommonGroupLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
-
- QPushButton* aCloseButton = new QPushButton( tr( "CLOSE" ), CommonGroup );
- aCloseButton->setAutoDefault( true );
- CommonGroupLayout->addWidget( aCloseButton, 0, 2 );
-
- QPushButton* aHelpButton = new QPushButton( tr( "HELP" ), CommonGroup );
- aHelpButton->setAutoDefault( true );
- CommonGroupLayout->addWidget( aHelpButton, 0, 3 );
-
- aTopLayout->addWidget( CommonGroup );
-
- connect( aStartButton, SIGNAL( clicked() ), this, SLOT( onStart() ) );
- connect( aCloseButton, SIGNAL( clicked() ), this, SLOT( onClose() ) );
- connect( aHelpButton, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
-}
-
-VVTK_RecorderDlg::~VVTK_RecorderDlg()
-{
-}
-
-void VVTK_RecorderDlg::onStart()
-{
- if( myFileName.isNull() )
- return;
-
- myRecorder->SetName( (const char*)myFileName.toLatin1() );
-
- myRecorder->SetUseSkippedFrames( myRecordingModeComboBox->currentIndex() == 0 );
- myRecorder->SetNbFPS( myFPSSpinBox->value() );
- myRecorder->SetQuality( myQualitySpinBox->value() );
- myRecorder->SetProgressiveMode( myProgressiveCheckBox->isChecked() );
-
- accept();
-
-}
-
-void VVTK_RecorderDlg::onClose()
-{
- reject();
-}
-
-void VVTK_RecorderDlg::onHelp()
-{
- QString aHelpFileName = "animation_in_gauss_viewer.htm";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
- app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
- else {
- QString platform;
-#ifdef WIN32
- platform = "winapplication";
-#else
- platform = "application";
-#endif
- SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
- }
-}
-
-bool VVTK_RecorderDlg::onBrowseFile()
-{
- QString aRootDir = QString( getenv( "VISU_ROOT_DIR") );
-
- QStringList aFilter;
- aFilter.append( tr( "FLT_AVI_FILES" ) );
- aFilter.append( tr( "FLT_ALL_FILES" ) );
-
- QString aFileName = SUIT_FileDlg::getFileName( this, getenv( "HOME" ), aFilter,
- tr( "FILE_NAME" ), false );
-
- if( aFileName.isNull() )
- return false;
-
- myFileName = aFileName;
- myFileNameLineEdit->setText( aFileName.section( '/', -1 ) );
-
- return true;
-}
-
-int VVTK_RecorderDlg::exec()
-{
- if( !onBrowseFile() )
- {
- reject();
- return 0;
- }
- return QDialog::exec();
-}
-
-void VVTK_RecorderDlg::keyPressEvent( QKeyEvent* e )
-{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
-
- if ( e->key() == Qt::Key_F1 )
- {
- e->accept();
- onHelp();
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// VISU VISUGUI : GUI of VISU component
-// File : VVTK_RecorderDlg.h
-// Author : Oleg UVAROV
-// Module : VISU
-// $Header$
-//
-#ifndef VVTK_RECORDERDLG_H
-#define VVTK_RECORDERDLG_H
-
-#include <QDateTime>
-#include <QDialog>
-
-class QCheckBox;
-class QComboBox;
-class QGroupBox;
-class QLCDNumber;
-class QLineEdit;
-class QPushButton;
-class QTimer;
-
-class QtxDoubleSpinBox;
-class QtxIntSpinBox;
-
-class VVTK_Recorder;
-
-//! Recorder Dialog.
-class VVTK_RecorderDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- VVTK_RecorderDlg( QWidget*, VVTK_Recorder* );
- ~VVTK_RecorderDlg();
-
- int exec();
-
- QString fileName() const { return myFileName; }
-
-private:
- virtual void keyPressEvent( QKeyEvent* );
-
-protected slots:
- void onStart();
- void onClose();
- void onHelp();
-
- bool onBrowseFile();
-
-private:
- VVTK_Recorder* myRecorder;
- QString myFileName;
-
- QLineEdit* myFileNameLineEdit;
-
- QComboBox* myRecordingModeComboBox;
- QtxDoubleSpinBox* myFPSSpinBox;
- QtxIntSpinBox* myQualitySpinBox;
- QCheckBox* myProgressiveCheckBox;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME VTKViewer : build VTK viewer into Salome desktop
-// File :
-// Author :
-// Module :
-// $Header$
-//
-#include "VVTK_Renderer.h"
-
-#include "VISU_GaussPtsAct.h"
-#include "VISU_GaussPointsPL.hxx"
-#include "VISU_WidgetCtrl.hxx"
-#include "VISU_PlanesWidget.hxx"
-#include "VISU_SphereWidget.hxx"
-
-#include <vtkObjectFactory.h>
-#include <vtkProperty.h>
-#include <vtkPointPicker.h>
-
-#include <vtkRenderWindowInteractor.h>
-#include <vtkCallbackCommand.h>
-#include <vtkCommand.h>
-#include <vtkPlane.h>
-
-#include <vtkPropCollection.h>
-#include <vtkProp.h>
-#include <vtkActor.h>
-#include <vtkMapper.h>
-#include <vtkPolyDataMapper.h>
-#include <vtkPolyData.h>
-#include <vtkTextMapper.h>
-#include <vtkTextActor.h>
-#include <vtkTextProperty.h>
-#include <vtkRenderer.h>
-
-#include <vtkPropCollection.h>
-#include <vtkProp.h>
-#include <vtkActor.h>
-#include <vtkMapper.h>
-#include <vtkPolyDataMapper.h>
-#include <vtkPolyData.h>
-#include <vtkTextMapper.h>
-#include <vtkTextActor.h>
-#include <vtkTextProperty.h>
-#include <vtkRenderer.h>
-
-#include "utilities.h"
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-//======================================================================
-class VISU_FPSActor : public vtkTextActor
-{
-public:
- vtkTypeMacro( VISU_FPSActor, vtkTextActor);
- static
- VISU_FPSActor*
- New();
-
- virtual
- int
- RenderOpaqueGeometry(vtkViewport *theViewport);
-};
-
-//======================================================================
-vtkStandardNewMacro(VISU_FPSActor);
-
-//======================================================================
-// function: RenderOpaqueGeometry
-// purpose :
-//======================================================================
-int
-VISU_FPSActor
-::RenderOpaqueGeometry(vtkViewport *theViewport)
-{
- // It's impossible to render opaque geometry of text actor
- // if the size of the viewport is less than 1.0
- int *size = theViewport->GetSize();
- if( size[0] <= 1.0 || size[1] <= 1.0 )
- return 1;
-
- if(vtkRenderer *aRenderer = dynamic_cast<vtkRenderer*>(theViewport)){
- static float aTol = 1.e-6;
- float aLastRenderTimeInSeconds = aRenderer->GetLastRenderTimeInSeconds();
- if(aLastRenderTimeInSeconds > aTol){
- size_t aNumberOfCells = 0;
- if(vtkActorCollection *anActorCollection = aRenderer->GetActors()){
- anActorCollection->InitTraversal();
- while(vtkActor *anActor = anActorCollection->GetNextActor()){
- if(anActor->GetVisibility()){
- if(SALOME_Actor *aSActor = dynamic_cast<SALOME_Actor*>(anActor)){
- if(vtkMapper *aMapper = aSActor->GetMapper()){
- if(vtkDataSet *aDataSet = aMapper->GetInput()){
- aNumberOfCells += aDataSet->GetNumberOfCells();
- }
- }
- }
- }
- }
- }
- std::ostringstream aStr;
- float aFPS = 1.0 / aLastRenderTimeInSeconds;
- aStr<<"FPS: "<<aFPS<<"\n NumberOfCells: "<<aNumberOfCells;
- std::string anInput = aStr.str();
- SetInput(anInput.c_str());
- return Superclass::RenderOpaqueGeometry(theViewport);
- }
- }
- return 1;
-}
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro(VVTK_Renderer);
-
-//----------------------------------------------------------------------------
-VVTK_Renderer
-::VVTK_Renderer():
- myFPSActor(VISU_FPSActor::New()),
- myInsideCursorSettings(NULL),
- myPickingSettings(NULL),
- myGaussPointPicker(vtkPointPicker::New()),
- myGaussPreHighlightProperty(vtkProperty::New()),
- myGaussHighlightProperty(vtkProperty::New())
-{
- if(MYDEBUG) INFOS("VVTK_Renderer() - "<<this);
-
- myFPSActor->Delete();
-
- vtkTextMapper* aTextMapper = vtkTextMapper::New();
- vtkTextProperty *aTextProperty = aTextMapper->GetTextProperty();
- aTextProperty->SetJustificationToRight();
- aTextProperty->SetVerticalJustificationToTop();
- aTextProperty->SetFontSize(10);
-
- myFPSActor->SetPickable(false);
- myFPSActor->ScaledTextOff();
- myFPSActor->SetAlignmentPoint(8);
- myFPSActor->SetPosition2 (1., 1.);
- myFPSActor->SetMapper(aTextMapper);
- aTextMapper->Delete();
-
- //GetDevice()->AddActor2D(myFPSActor.GetPointer());
-
- myGaussPointPicker->Delete();
-
- myGaussPreHighlightProperty->Delete();
- myGaussPreHighlightProperty->SetColor(0,1,1);
-
- myGaussHighlightProperty->Delete();
- myGaussHighlightProperty->SetColor(1,1,0);
-
-}
-
-VVTK_Renderer
-::~VVTK_Renderer()
-{
- if(MYDEBUG) INFOS("~VVTK_Renderer() - "<<this);
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_Renderer
-::AddActor(VTKViewer_Actor* theActor)
-{
- Superclass::AddActor(theActor);
- if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
- anActor->SetPointPicker(myGaussPointPicker.GetPointer());
- anActor->SetPreHighlightProperty(myGaussPreHighlightProperty.GetPointer());
- anActor->SetHighlightProperty(myGaussHighlightProperty.GetPointer());
-
- anActor->SetInsideCursorSettings(myInsideCursorSettings);
- //anActor->SetPickingSettings(myPickingSettings);
- }
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_Renderer
-::RemoveActor(VTKViewer_Actor* theActor)
-{
- Superclass::RemoveActor(theActor);
- if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
- anActor->SetPointPicker(NULL);
- anActor->SetPreHighlightProperty(NULL);
- anActor->SetHighlightProperty(NULL);
-
- anActor->SetInsideCursorSettings(NULL);
- //anActor->SetPickingSettings(NULL);
- }
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_Renderer
-::SetInsideCursorSettings(VISU_InsideCursorSettings* theInsideCursorSettings)
-{
- myInsideCursorSettings = theInsideCursorSettings;
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_Renderer
-::SetPickingSettings(VISU_PickingSettings* thePickingSettings)
-{
- myPickingSettings = thePickingSettings;
-}
-
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro(VVTK_Renderer1);
-
-//----------------------------------------------------------------------------
-VVTK_Renderer1::VVTK_Renderer1():
- myWidgetCtrl(VISU_WidgetCtrl::New()),
- myOutsideCursorSettings(NULL)
-{
- if(MYDEBUG) INFOS("VVTK_Renderer1() - "<<this);
-
- myWidgetCtrl->SetPlaceFactor(1.1);
- //
- VISU_PlanesWidget *aPlanesWidget = myWidgetCtrl->GetPlanesWidget();
- aPlanesWidget->SetOutlineTranslation(false);
- vtkProperty* aSelectedPlaneProperty = aPlanesWidget->GetSelectedPlaneProperty();
- vtkProperty* aPlaneProperty = aPlanesWidget->GetPlaneProperty();
- aPlaneProperty->SetOpacity(aSelectedPlaneProperty->GetOpacity()*1.5);
- //
- //myWidgetCtrl->Delete();
-}
-
-VVTK_Renderer1
-::~VVTK_Renderer1()
-{
- if(MYDEBUG) INFOS("~VVTK_Renderer1() - "<<this);
- myWidgetCtrl->SetInteractor(NULL);
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_Renderer1
-::AddActor(VTKViewer_Actor* theActor)
-{
- Superclass::AddActor(theActor);
- if(VISU_GaussPtsAct1* anActor = dynamic_cast<VISU_GaussPtsAct1*>(theActor)){
- anActor->SetWidgetCtrl(GetWidgetCtrl());
- anActor->SetOutsideCursorSettings(myOutsideCursorSettings);
- AdjustWidgetCtrl();
- }
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Renderer1
-::RemoveActor(VTKViewer_Actor* theActor)
-{
- Superclass::RemoveActor(theActor);
- if(VISU_GaussPtsAct1* anActor = dynamic_cast<VISU_GaussPtsAct1*>(theActor)){
- anActor->SetWidgetCtrl(NULL);
- anActor->SetOutsideCursorSettings(NULL);
- AdjustWidgetCtrl();
- }
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_Renderer1
-::AdjustWidgetCtrl()
-{
- 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
-::Initialize(vtkRenderWindowInteractor* theInteractor,
- SVTK_Selector* theSelector)
-{
- SVTK_Renderer::Initialize(theInteractor,theSelector);
- myWidgetCtrl->SetInteractor(theInteractor);
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_Renderer1
-::SetOutsideCursorSettings(VISU_OutsideCursorSettings* theOutsideCursorSettings)
-{
- myOutsideCursorSettings = theOutsideCursorSettings;
-}
-
-//----------------------------------------------------------------------------
-VISU_WidgetCtrl*
-VVTK_Renderer1
-::GetWidgetCtrl()
-{
- return myWidgetCtrl;//.GetPointer();
-}
-
-//----------------------------------------------------------------------------
-bool
-VVTK_Renderer1
-::OnAdjustActors()
-{
- return SVTK_Renderer::OnAdjustActors();
-}
-
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro(VVTK_Renderer2);
-
-//----------------------------------------------------------------------------
-VVTK_Renderer2
-::VVTK_Renderer2():
- myEventCallbackCommand(vtkCallbackCommand::New())
-{
- if(MYDEBUG) INFOS("VVTK_Renderer2() - "<<this);
- myEventCallbackCommand->Delete();
-
- myPriority = 0.0;
- myEventCallbackCommand->SetClientData(this);
- myEventCallbackCommand->SetCallback(VVTK_Renderer2::ProcessEvents);
-}
-
-VVTK_Renderer2
-::~VVTK_Renderer2()
-{
- if(MYDEBUG) INFOS("~VVTK_Renderer2() - "<<this);
-}
-
-//----------------------------------------------------------------------------
-void VVTK_Renderer2::SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl)
-{
- theWidgetCtrl->AddObserver(vtkCommand::EndInteractionEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
- theWidgetCtrl->AddObserver(vtkCommand::EnableEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
- theWidgetCtrl->AddObserver(vtkCommand::DisableEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
- myWidgetCtrl = theWidgetCtrl;
-}
-
-void
-VVTK_Renderer2
-::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
-{
- VVTK_Renderer2* self = reinterpret_cast<VVTK_Renderer2*>(theClientData);
-
- switch(theEvent){
- case vtkCommand::EnableEvent:
- case vtkCommand::EndInteractionEvent:
- self->OnEndInteractionEvent();
- break;
- }
-}
-
-void
-VVTK_Renderer2
-::OnEndInteractionEvent()
-{
- AdjustActors();
- myInteractor->Render();
-}
-
-
-//----------------------------------------------------------------------------
-void VVTK_Renderer2::AddActor(VTKViewer_Actor* theActor)
-{
- if(VISU_GaussPtsAct1* anActor = dynamic_cast<VISU_GaussPtsAct1*>(theActor)){
- if(VISU::TGaussPtsActorFactory* aFactory = anActor->GetGaussPtsFactory()){
- if(VISU_GaussPtsAct2* anActor2 = aFactory->CloneActor(anActor)){
- anActor2->SetWidgetCtrl(myWidgetCtrl);
- Superclass::AddActor(anActor2);
- }
- }
- }
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_Renderer2
-::RemoveActor(VTKViewer_Actor* theActor)
-{
- using namespace VISU;
- if(VISU_GaussPtsAct2* anActor = dynamic_cast<VISU_GaussPtsAct2*>(theActor)){
- anActor->SetWidgetCtrl(NULL);
- Superclass::RemoveActor(theActor);
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME VTKViewer : build VTK viewer into Salome desktop
-// File :
-// Author :
-// Module : SALOME
-// $Header$
-//
-#ifndef VVTK_Renderer_h
-#define VVTK_Renderer_h
-
-#include "VVTK.h"
-
-#include "SVTK_Renderer.h"
-
-class VISU_WidgetCtrl;
-class VISU_InsideCursorSettings;
-class VISU_OutsideCursorSettings;
-class VISU_PickingSettings;
-class VISU_FPSActor;
-
-class vtkPointPicker;
-class vtkImplicitFunction;
-
-//----------------------------------------------------------------------------
-//! To customize SVTK_Renderer according to VVTK functionality
-class VVTK_EXPORT VVTK_Renderer : public SVTK_Renderer
-{
- public:
- vtkTypeMacro(VVTK_Renderer,SVTK_Renderer);
- static VVTK_Renderer* New();
-
- //! Reimplement SVTK_Renderer::AddActor
- /*!
- Perform an additional action - apply picking settings on the published VISU_GaussPtsAct actors
- */
- virtual
- void
- AddActor(VTKViewer_Actor* theActor);
-
- //! Reimplement SVTK_Renderer::RemoveActor (remove additional settings)
- virtual
- void
- RemoveActor(VTKViewer_Actor* theActor);
-
- //! To set VISU_PickingSettings to share them among all VISU_GaussPtsAct actors published into the view
- void
- SetInsideCursorSettings(VISU_InsideCursorSettings* theInsideCursorSettings);
-
- void
- SetPickingSettings(VISU_PickingSettings* thePickingSettings);
-
- protected:
- VVTK_Renderer();
- ~VVTK_Renderer();
-
- VISU_PickingSettings* myPickingSettings; //! Keeps reference of the VISU_PickingSettings
- VISU_InsideCursorSettings* myInsideCursorSettings; //! Keeps reference of the VISU_InsideCursorSettings
- vtkSmartPointer<VISU_FPSActor> myFPSActor; //!< To show FPS of the rendering at run-time
-
- vtkSmartPointer<vtkPointPicker> myGaussPointPicker;
- vtkSmartPointer<vtkProperty> myGaussPreHighlightProperty;
- vtkSmartPointer<vtkProperty> myGaussHighlightProperty;
-};
-
-
-//----------------------------------------------------------------------------
-//! To extend VVTK_Renderer to implement base view functionality
-class VVTK_EXPORT VVTK_Renderer1 : public VVTK_Renderer
-{
- public:
- vtkTypeMacro(VVTK_Renderer1,VVTK_Renderer);
- static VVTK_Renderer1* New();
-
- //! Reimplement SVTK_Renderer::Initialize
- virtual
- void
- Initialize(vtkRenderWindowInteractor* theInteractor,
- SVTK_Selector* theSelector);
-
- //! Reimplement VVTK_Renderer::AddActor to apply to the actor additional settings
- virtual
- void
- AddActor(VTKViewer_Actor* theActor);
-
- //! Reimplement VVTK_Renderer::RemoveActor
- virtual
- void
- RemoveActor(VTKViewer_Actor* theActor);
-
- //! To set VISU_PickingSettings to share them among all VISU_GaussPtsAct1 actors published into the view
- void
- SetOutsideCursorSettings(VISU_OutsideCursorSettings* theOutsideCursorSettings);
-
- VISU_WidgetCtrl* GetWidgetCtrl();
-
- protected:
- VVTK_Renderer1();
- ~VVTK_Renderer1();
-
- //! Reimplement VVTK_Renderer::OnAdjustActors
- virtual
- bool
- OnAdjustActors();
-
- void AdjustWidgetCtrl();
-
- VISU_WidgetCtrl* myWidgetCtrl;
- //vtkSmartPointer<VISU_WidgetCtrl> myWidgetCtrl;
- VISU_OutsideCursorSettings* myOutsideCursorSettings;
- vtkSmartPointer<VISU_FPSActor> myTextActor;
-};
-
-
-//----------------------------------------------------------------------------
-class VVTK_EXPORT VVTK_Renderer2 : public VVTK_Renderer
-{
- public:
- vtkTypeMacro(VVTK_Renderer2,VVTK_Renderer);
- static VVTK_Renderer2* New();
-
- //! Reimplement VVTK_Renderer::AddActor to apply to the actor additional settings
- virtual
- void
- AddActor(VTKViewer_Actor* theActor);
-
- //! Reimplement VVTK_Renderer::RemoveActor
- virtual
- void
- RemoveActor(VTKViewer_Actor* theActor);
-
- void SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
-
- //! To handle vtkCommand::EndInteractionEvent to redraw the view
- void
- OnEndInteractionEvent();
-
- protected:
- VVTK_Renderer2();
- ~VVTK_Renderer2();
-
- //! Main process VTK event method
- static
- void
- ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
-
- //! Used to process VTK events
- vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
-
- //! Priority at which events are processed
- float myPriority;
-
- VISU_WidgetCtrl* myWidgetCtrl;
-};
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : VVTK_SegmentationCursorDlg.cxx
-// Author : Oleg Uvarov
-// Module : VISU
-//
-#include "VVTK_SegmentationCursorDlg.h"
-#include "VVTK_PrimitiveBox.h"
-#include "VVTK_SizeBox.h"
-
-#include "VISU_GaussPtsAct.h"
-#include "VISU_GaussPtsSettings.h"
-
-#include "VISU_WidgetCtrl.hxx"
-#include "VISU_PlanesWidget.hxx"
-#include "VISU_SphereWidget.hxx"
-
-#include "VISU_GaussPointsPL.hxx"
-#include "VISU_OpenGLPointSpriteMapper.hxx"
-
-#include <LightApp_Application.h>
-#include <SUIT_MessageBox.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Session.h>
-
-#include <SVTK_RenderWindowInteractor.h>
-
-#include <vtkActorCollection.h>
-#include <vtkCallbackCommand.h>
-#include <vtkObjectFactory.h>
-#include <vtkRenderer.h>
-#include <vtkRenderWindowInteractor.h>
-#include <vtkSmartPointer.h>
-#include <vtkImageData.h>
-
-#include "utilities.h"
-
-#include <QButtonGroup>
-#include <QColorDialog>
-#include <QFileDialog>
-#include <QGroupBox>
-#include <QKeyEvent>
-#include <QLabel>
-#include <QLayout>
-#include <QLineEdit>
-#include <QPushButton>
-#include <QRadioButton>
-#include <QTabWidget>
-
-#include <QtxAction.h>
-#include <QtxDoubleSpinBox.h>
-#include <QtxIntSpinBox.h>
-#include <CAM_Module.h>
-
-//----------------------------------------------------------------
-VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const char* name )
- :QDialog( parent,
- Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
- myEventCallbackCommand( vtkCallbackCommand::New() ),
- myInsideCursorSettings( VISU_InsideCursorSettings::New() ),
- myOutsideCursorSettings( VISU_OutsideCursorSettings::New() ),
- myIsPlaneSegmentation( true ),
- myWidgetCtrl(NULL),
- myInteractor(NULL)
-{
- setAccessibleName( name );
-
- myPriority = 0.0;
- myEventCallbackCommand->Delete();
- myEventCallbackCommand->SetClientData(this);
- myEventCallbackCommand->SetCallback(VVTK_SegmentationCursorDlg::ProcessEvents);
-
- myInsideCursorSettings->AddObserver(VISU::UpdateFromSettingsEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
-
- setWindowTitle( tr( "SEGMENTATION_CURSOR_DLG_TITLE" ) );
- setSizeGripEnabled(TRUE);
-
- QVBoxLayout* TopLayout = new QVBoxLayout( this );
- TopLayout->setSpacing(6);
- TopLayout->setMargin(11);
-
- myTabBox = new QTabWidget( this );
-
- // Segmentation cursor pane
- mySegmentationCursorBox = new QWidget( this );
- QVBoxLayout* SCBoxLayout = new QVBoxLayout( mySegmentationCursorBox );
- SCBoxLayout->setMargin(11);
- SCBoxLayout->setSpacing(6);
- SCBoxLayout->setAlignment(Qt::AlignTop);
-
- // Origin
- myOriginGroup = new QGroupBox( tr( "ORIGIN_TITLE" ), mySegmentationCursorBox );
- //myOriginGroup->setColumnLayout( 0, Qt::Vertical );
- //myOriginGroup->layout()->setSpacing( 0 );
- //myOriginGroup->layout()->setMargin( 0 );
-
- QGridLayout* OriginGroupLayout = new QGridLayout( myOriginGroup );
- OriginGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- OriginGroupLayout->setSpacing(6);
- OriginGroupLayout->setMargin(11);
-
- QLabel* XOriginLabel = new QLabel( tr( "ORIGIN_X" ), myOriginGroup );
- myXOriginSpinBox = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, myOriginGroup );
- myXOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myXOriginSpinBox->setMinimumWidth( 100 );
- myXOriginSpinBox->setValue( 0.0 );
-
- QLabel* YOriginLabel = new QLabel( tr( "ORIGIN_Y" ), myOriginGroup );
- myYOriginSpinBox = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, myOriginGroup );
- myYOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myYOriginSpinBox->setMinimumWidth( 100 );
- myYOriginSpinBox->setValue( 0.0 );
-
- QLabel* ZOriginLabel = new QLabel( tr( "ORIGIN_Z" ), myOriginGroup );
- myZOriginSpinBox = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, myOriginGroup );
- //myZOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myZOriginSpinBox->setMinimumWidth( 100 );
- myZOriginSpinBox->setValue( 1.0 );
-
- OriginGroupLayout->addWidget( XOriginLabel, 0, 0 );
- OriginGroupLayout->addWidget( myXOriginSpinBox, 0, 1 );
- OriginGroupLayout->addWidget( YOriginLabel, 0, 2 );
- OriginGroupLayout->addWidget( myYOriginSpinBox, 0, 3 );
- OriginGroupLayout->addWidget( ZOriginLabel, 0, 4 );
- OriginGroupLayout->addWidget( myZOriginSpinBox, 0, 5 );
-
- SCBoxLayout->addWidget( myOriginGroup );
-
- // Direction ( Plane Segmentation )
- myDirectionGroup = new QGroupBox( tr( "DIRECTION_TITLE" ), mySegmentationCursorBox );
- //myDirectionGroup->setColumnLayout( 0, Qt::Vertical );
- //myDirectionGroup->layout()->setSpacing( 0 );
- //myDirectionGroup->layout()->setMargin( 0 );
-
- QGridLayout* DirectionGroupLayout = new QGridLayout( myDirectionGroup );
- DirectionGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- DirectionGroupLayout->setSpacing(6);
- DirectionGroupLayout->setMargin(11);
-
- QLabel* DXDirectionLabel = new QLabel( tr( "DIRECTION_DX" ), myDirectionGroup );
- myDXDirectionSpinBox = new QtxDoubleSpinBox( -1.0, 1.0, 0.1, myDirectionGroup );
- myDXDirectionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myDXDirectionSpinBox->setMinimumWidth( 100 );
- myDXDirectionSpinBox->setValue( 0.0 );
-
- QLabel* DYDirectionLabel = new QLabel( tr( "DIRECTION_DY" ), myDirectionGroup );
- myDYDirectionSpinBox = new QtxDoubleSpinBox( -1.0, 1.0, 0.1, myDirectionGroup );
- myDYDirectionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myDYDirectionSpinBox->setMinimumWidth( 100 );
- myDYDirectionSpinBox->setValue( 0.0 );
-
- QLabel* DZDirectionLabel = new QLabel( tr( "DIRECTION_DZ" ), myDirectionGroup );
- myDZDirectionSpinBox = new QtxDoubleSpinBox( -1.0, 1.0, 0.1, myDirectionGroup );
- myDZDirectionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myDZDirectionSpinBox->setMinimumWidth( 100 );
- myDZDirectionSpinBox->setValue( 1.0 );
-
- DirectionGroupLayout->addWidget( DXDirectionLabel, 0, 0 );
- DirectionGroupLayout->addWidget( myDXDirectionSpinBox, 0, 1 );
- DirectionGroupLayout->addWidget( DYDirectionLabel, 0, 2 );
- DirectionGroupLayout->addWidget( myDYDirectionSpinBox, 0, 3 );
- DirectionGroupLayout->addWidget( DZDirectionLabel, 0, 4 );
- DirectionGroupLayout->addWidget( myDZDirectionSpinBox, 0, 5 );
-
- SCBoxLayout->addWidget( myDirectionGroup );
-
- // Depth ( Plane Segmentation )
- myDepthGroup = new QGroupBox( tr( "DEPTH_TITLE" ), mySegmentationCursorBox );
- //myDepthGroup->setColumnLayout( 0, Qt::Vertical );
- //myDepthGroup->layout()->setSpacing( 0 );
- //myDepthGroup->layout()->setMargin( 0 );
-
- QGridLayout* DepthGroupLayout = new QGridLayout( myDepthGroup );
- DepthGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- DepthGroupLayout->setSpacing(6);
- DepthGroupLayout->setMargin(11);
-
- QLabel* DepthLabel = new QLabel( tr( "DEPTH" ), myDepthGroup );
- myDepthSpinBox = new QtxDoubleSpinBox( 0.0, VTK_LARGE_FLOAT, 0.1, myDepthGroup );
- myDepthSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myDepthSpinBox->setMinimumWidth( 100 );
- myDepthSpinBox->setValue( 1.0 );
-
- DepthGroupLayout->addWidget( DepthLabel, 0, 0 );
- DepthGroupLayout->addWidget( myDepthSpinBox, 0, 1 );
-
- SCBoxLayout->addWidget( myDepthGroup );
-
- // Radius ( Sphere Segmentation )
- myRadiusGroup = new QGroupBox( tr( "RADIUS_TITLE" ), mySegmentationCursorBox );
- //myRadiusGroup->setColumnLayout( 0, Qt::Vertical );
- //myRadiusGroup->layout()->setSpacing( 0 );
- //myRadiusGroup->layout()->setMargin( 0 );
-
- QGridLayout* RadiusGroupLayout = new QGridLayout( myRadiusGroup );
- RadiusGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- RadiusGroupLayout->setSpacing(6);
- RadiusGroupLayout->setMargin(11);
-
- QLabel* RadiusLabel = new QLabel( tr( "RADIUS" ),myRadiusGroup );
- myRadiusSpinBox = new QtxDoubleSpinBox( 0.0, 1000.0, 1.0,myRadiusGroup );
- myRadiusSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myRadiusSpinBox->setMinimumWidth( 100 );
- myRadiusSpinBox->setValue( 100.0 );
-
- QLabel* RatioLabel = new QLabel( tr( "RATIO" ), myRadiusGroup );
- myRatioSpinBox = new QtxDoubleSpinBox( 0.1, 10.0, 0.1,myRadiusGroup );
- myRatioSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myRatioSpinBox->setMinimumWidth( 100 );
- myRatioSpinBox->setValue( 2.0 );
-
- RadiusGroupLayout->addWidget( RadiusLabel, 0, 0 );
- RadiusGroupLayout->addWidget( myRadiusSpinBox, 0, 1 );
- RadiusGroupLayout->addWidget( RatioLabel, 0, 2 );
- RadiusGroupLayout->addWidget( myRatioSpinBox, 0, 3 );
-
- SCBoxLayout->addWidget( myRadiusGroup );
-
- myTabBox->addTab( mySegmentationCursorBox, tr( "SEGMENTATION_CURSOR_TAB" ) );
-
- // Gauss points pane
- myGaussPointsBox = new QWidget( this );
- QVBoxLayout* GPBoxLayout = new QVBoxLayout( myGaussPointsBox );
- GPBoxLayout->setMargin(11);
- GPBoxLayout->setSpacing(6);
-
- // Inside Gauss points
- QGroupBox* anInsideGroup = new QGroupBox( tr( "INSIDE_GAUSS_POINTS" ), myGaussPointsBox );
- //anInsideGroup->setColumnLayout( 0, Qt::Vertical );
- //anInsideGroup->layout()->setSpacing( 0 );
- //anInsideGroup->layout()->setMargin( 0 );
-
- QGridLayout* anInsideGroupLayout = new QGridLayout( anInsideGroup );
- anInsideGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- anInsideGroupLayout->setSpacing(6);
- anInsideGroupLayout->setMargin(11);
-
- // Primitive
- myInsidePrimitiveBox = new VVTK_PrimitiveBox( anInsideGroup );
-
- // Size
- myInsideSizeBox = new VVTK_SizeBox( anInsideGroup );
- myInsideSizeBox->setType( VVTK_SizeBox::Inside );
-
- anInsideGroupLayout->addWidget( myInsidePrimitiveBox, 0, 0 );
- anInsideGroupLayout->addWidget( myInsideSizeBox, 1, 0 );
-
- GPBoxLayout->addWidget( anInsideGroup );
-
- // Outside Gauss points
- QGroupBox* anOutsideGroup = new QGroupBox( tr( "OUTSIDE_GAUSS_POINTS" ), myGaussPointsBox );
- //anOutsideGroup->setColumnLayout( 0, Qt::Vertical );
- //anOutsideGroup->layout()->setSpacing( 0 );
- //anOutsideGroup->layout()->setMargin( 0 );
-
- QGridLayout* anOutsideGroupLayout = new QGridLayout( anOutsideGroup );
- anOutsideGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- anOutsideGroupLayout->setSpacing(6);
- anOutsideGroupLayout->setMargin(11);
-
- // Primitive
- myOutsidePrimitiveBox = new VVTK_PrimitiveBox( anOutsideGroup );
-
- // Size
- myOutsideSizeBox = new VVTK_SizeBox( anOutsideGroup );
- myOutsideSizeBox->setType( VVTK_SizeBox::Outside );
-
- anOutsideGroupLayout->addWidget( myOutsidePrimitiveBox, 0, 0 );
- anOutsideGroupLayout->addWidget( myOutsideSizeBox, 1, 0 );
-
- GPBoxLayout->addWidget( anOutsideGroup );
-
- // Magnification
- QGroupBox* MagnificationGroup = new QGroupBox ( tr( "MAGNIFICATION_TITLE" ), myGaussPointsBox );
- //MagnificationGroup->setColumnLayout(0, Qt::Vertical );
- //MagnificationGroup->layout()->setSpacing( 0 );
- //MagnificationGroup->layout()->setMargin( 0 );
-
- QGridLayout* MagnificationGroupLayout = new QGridLayout ( MagnificationGroup );
- MagnificationGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- MagnificationGroupLayout->setSpacing(6);
- MagnificationGroupLayout->setMargin(11);
-
- myMagnificationLabel = new QLabel( tr( "MAGNIFICATION" ), MagnificationGroup );
- myMagnificationSpinBox = new QtxIntSpinBox( 1, 10000, 10, MagnificationGroup );
- myMagnificationSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- MagnificationGroupLayout->addWidget( myMagnificationLabel, 0, 0 );
- MagnificationGroupLayout->addWidget( myMagnificationSpinBox, 0, 1 );
-
- // Increment
- myIncrementLabel = new QLabel( tr( "INCREMENT" ), MagnificationGroup );
- myIncrementSpinBox = new QtxDoubleSpinBox( 0.01, 10, 0.1, MagnificationGroup );
- myIncrementSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- MagnificationGroupLayout->addWidget( myIncrementLabel, 0, 2 );
- MagnificationGroupLayout->addWidget( myIncrementSpinBox, 0, 3 );
-
-
- myTabBox->addTab( myGaussPointsBox, tr( "GAUSS_POINTS_TAB" ) );
- //myTabBox->showPage( myGaussPointsBox );
- myTabBox->setCurrentWidget( myGaussPointsBox );
-
- GPBoxLayout->addWidget( MagnificationGroup );
-
-
- // Common buttons ===========================================================
- QGroupBox* GroupButtons = new QGroupBox( this );
- //GroupButtons->setColumnLayout(0, Qt::Vertical );
- //GroupButtons->layout()->setSpacing( 0 );
- //GroupButtons->layout()->setMargin( 0 );
- QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons );
- GroupButtonsLayout->setAlignment( Qt::AlignTop );
- GroupButtonsLayout->setSpacing( 6 );
- GroupButtonsLayout->setMargin( 11 );
-
- QPushButton* buttonApply = new QPushButton( tr( "&Apply" ), GroupButtons );
- buttonApply->setAutoDefault( TRUE );
- buttonApply->setDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonApply, 0, 0 );
- GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
-
- QPushButton* buttonClose = new QPushButton( tr( "&Close" ) , GroupButtons );
- buttonClose->setAutoDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonClose, 0, 2 );
-
- QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons );
- buttonHelp->setAutoDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
-
- TopLayout->addWidget( myTabBox );
- TopLayout->addWidget( GroupButtons );
-
- connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onClickApply() ) );
- connect( buttonClose, SIGNAL( clicked() ), this, SLOT( onClickClose() ) );
- connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onClickHelp() ) );
-
- connect(parent, SIGNAL(Show( QShowEvent * )), this, SLOT(onParentShow()));
- connect(parent, SIGNAL(Hide( QHideEvent * )), this, SLOT(onParentHide()));
-}
-
-VVTK_SegmentationCursorDlg::~VVTK_SegmentationCursorDlg()
-{
- SetWidgetCtrl(NULL);
-}
-
-float VVTK_SegmentationCursorDlg::getMagnification() const
-{
- return myMagnificationSpinBox->value() / 100.0;
-}
-
-void VVTK_SegmentationCursorDlg::setMagnification( float theMagnification )
-{
- myMagnificationSpinBox->setValue( ( int )( theMagnification * 100 ) );
-}
-
-float VVTK_SegmentationCursorDlg::getIncrement() const
-{
- return myIncrementSpinBox->value();
-}
-
-void VVTK_SegmentationCursorDlg::setIncrement( float theIncrement )
-{
- myIncrementSpinBox->setValue( theIncrement );
-}
-
-
-void VVTK_SegmentationCursorDlg::SetWidgetCtrl( VISU_WidgetCtrl* theWidgetCtrl )
-{
- if(myWidgetCtrl == theWidgetCtrl)
- return;
-
- if(myWidgetCtrl)
- myWidgetCtrl->RemoveObserver(myEventCallbackCommand.GetPointer());
-
- myWidgetCtrl = theWidgetCtrl;
-
- if(theWidgetCtrl)
- theWidgetCtrl->AddObserver(vtkCommand::EndInteractionEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
-}
-
-void VVTK_SegmentationCursorDlg::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
-{
- VVTK_SegmentationCursorDlg* self = reinterpret_cast<VVTK_SegmentationCursorDlg*>(theClientData);
-
- switch(theEvent){
- case vtkCommand::EndInteractionEvent:
- self->UpdateSegmentation();
- break;
- case VISU::UpdateFromSettingsEvent:
- self->GetOutsideCursorSettings()->SetMagnification( self->GetInsideCursorSettings()->GetMagnification() );
- self->GetOutsideCursorSettings()->SetIncrement( self->GetInsideCursorSettings()->GetIncrement() );
-
- self->UpdateInsideGaussPoints();
- self->UpdateOutsideGaussPoints();
-
- self->GetInsideCursorSettings()->InvokeEvent(VISU::UpdateInsideSettingsEvent,NULL);
- self->GetOutsideCursorSettings()->InvokeEvent(VISU::UpdateOutsideSettingsEvent,NULL);
- break;
- }
-}
-
-void VVTK_SegmentationCursorDlg::UpdateSegmentation()
-{
- if( myIsPlaneSegmentation )
- {
- myDirectionGroup->show();
- myDepthGroup->show();
- myRadiusGroup->hide();
-
- VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget();
- vtkFloatingPointType origin[3];
- pPlanesWidget->GetOrigin( origin );
- myXOriginSpinBox->setValue( origin[0] );
- myYOriginSpinBox->setValue( origin[1] );
- myZOriginSpinBox->setValue( origin[2] );
-
- vtkFloatingPointType normal[3];
- pPlanesWidget->GetNormal( normal );
- myDXDirectionSpinBox->setValue( normal[0] );
- myDYDirectionSpinBox->setValue( normal[1] );
- myDZDirectionSpinBox->setValue( normal[2] );
-
- myDepthSpinBox->setValue( pPlanesWidget->Distance() );
- }
- else
- {
- myDirectionGroup->hide();
- myDepthGroup->hide();
- myRadiusGroup->show();
-
- VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget();
- vtkFloatingPointType origin[3], aRadius;
- pSphereWidget->GetCenter(origin);
- myXOriginSpinBox->setValue( origin[0] );
- myYOriginSpinBox->setValue( origin[1] );
- myZOriginSpinBox->setValue( origin[2] );
- aRadius=pSphereWidget->GetRadius();
- myRadiusSpinBox->setValue(aRadius);
- myRatioSpinBox->setValue(pSphereWidget->GetRatio());
- }
-}
-
-void VVTK_SegmentationCursorDlg::UpdateInsideGaussPoints()
-{
- int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
- vtkFloatingPointType aClamp = 200.0;
- QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_texture.bmp";
- QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_alpha.bmp";
- vtkFloatingPointType anAlphaThreshold = 0.1;
- int aResolution = 8;
- int aMinSize = 3;
- int aMaxSize = 33;
- int aMagnification = 100;
- vtkFloatingPointType anIncrement = 2.0;
-
- if( !myInsideCursorSettings->GetInitial() )
- {
- myInsidePrimitiveBox->setPrimitiveType( myInsideCursorSettings->GetPrimitiveType() );
- myInsidePrimitiveBox->setClamp( myInsideCursorSettings->GetClamp() );
- myInsidePrimitiveBox->setMainTexture( myInsideMainTexture );
- myInsidePrimitiveBox->setAlphaTexture( myInsideAlphaTexture );
- myInsidePrimitiveBox->setAlphaThreshold( myInsideCursorSettings->GetAlphaThreshold() );
- myInsidePrimitiveBox->setResolution( myInsideCursorSettings->GetResolution() );
-
- myInsideSizeBox->setMinSize( myInsideCursorSettings->GetMinSize() );
- myInsideSizeBox->setMaxSize( myInsideCursorSettings->GetMaxSize() );
-
- this->setMagnification( myInsideCursorSettings->GetMagnification() );
- this->setIncrement( myInsideCursorSettings->GetIncrement() );
-
- return;
- }
-
- SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
- aPrimitiveType = aResourceMgr->integerValue( "VISU", "inside_point_sprite_primitive_type", aPrimitiveType );
- myInsidePrimitiveBox->setPrimitiveType( aPrimitiveType );
-
- aClamp = aResourceMgr->doubleValue( "VISU", "inside_point_sprite_clamp", aClamp );
- myInsidePrimitiveBox->setClamp( aClamp );
-
- aMainTexture = aResourceMgr->stringValue( "VISU", "inside_point_sprite_main_texture", aMainTexture );
- myInsidePrimitiveBox->setMainTexture( aMainTexture );
-
- anAlphaTexture = aResourceMgr->stringValue( "VISU", "inside_point_sprite_alpha_texture", anAlphaTexture );
- myInsidePrimitiveBox->setAlphaTexture( anAlphaTexture );
-
- anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "inside_point_sprite_alpha_threshold", anAlphaThreshold );
- myInsidePrimitiveBox->setAlphaThreshold( anAlphaThreshold );
-
- aResolution = aResourceMgr->integerValue( "VISU", "inside_geom_sphere_resolution", aResolution );
- myInsidePrimitiveBox->setResolution( aResolution );
-
- aMinSize = aResourceMgr->integerValue( "VISU", "inside_point_sprite_min_size", aMinSize );
- myInsideSizeBox->setMinSize( aMinSize / 100.0 );
-
- aMaxSize = aResourceMgr->integerValue( "VISU", "inside_point_sprite_max_size", aMaxSize );
- myInsideSizeBox->setMaxSize( aMaxSize / 100.0 );
-
- aMagnification = aResourceMgr->integerValue( "VISU", "inside_point_sprite_magnification", aMagnification );
- this->setMagnification( aMagnification / 100.0 );
-
- anIncrement = aResourceMgr->doubleValue( "VISU", "inside_point_sprite_increment", anIncrement );
- this->setIncrement( anIncrement );
-
- myInsidePrimitiveBox->setFaceLimit( 50000 );
-
- ApplyInsideGaussPoints();
-}
-
-void VVTK_SegmentationCursorDlg::UpdateOutsideGaussPoints()
-{
- vtkFloatingPointType aClamp = 256.0;
- int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
- QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_texture.bmp";
- QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_alpha.bmp";
- vtkFloatingPointType anAlphaThreshold = 0.1;
- int aResolution = 8;
- int aSize = 25;
- bool aUniform = false;
- QColor aColor = Qt::blue;
-
- if( !myOutsideCursorSettings->GetInitial() )
- {
- myOutsidePrimitiveBox->setPrimitiveType( myOutsideCursorSettings->GetPrimitiveType() );
- myOutsidePrimitiveBox->setClamp( myOutsideCursorSettings->GetClamp() );
- myOutsidePrimitiveBox->setMainTexture( myOutsideMainTexture );
- myOutsidePrimitiveBox->setAlphaTexture( myOutsideAlphaTexture );
- myOutsidePrimitiveBox->setAlphaThreshold( myOutsideCursorSettings->GetAlphaThreshold() );
- myOutsidePrimitiveBox->setResolution( myOutsideCursorSettings->GetResolution() );
-
- myOutsideSizeBox->setOutsideSize( myOutsideCursorSettings->GetSize() );
- myOutsideSizeBox->setUniform( myOutsideCursorSettings->GetUniform() );
-
- vtkFloatingPointType* aColor = myOutsideCursorSettings->GetColor();
- myOutsideSizeBox->setColor( QColor( ( int )( aColor[0] * 255.0 ),
- ( int )( aColor[1] * 255.0 ),
- ( int )( aColor[2] * 255.0 ) ) );
-
- return;
- }
-
- SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
- aPrimitiveType = aResourceMgr->integerValue( "VISU", "outside_point_sprite_primitive_type", aPrimitiveType );
- myOutsidePrimitiveBox->setPrimitiveType( aPrimitiveType );
-
- aClamp = aResourceMgr->doubleValue( "VISU", "outside_point_sprite_clamp", aClamp );
- myOutsidePrimitiveBox->setClamp( aClamp );
-
- aMainTexture = aResourceMgr->stringValue( "VISU", "outside_point_sprite_main_texture", aMainTexture );
- myOutsidePrimitiveBox->setMainTexture( aMainTexture );
-
- anAlphaTexture = aResourceMgr->stringValue( "VISU", "outside_point_sprite_alpha_texture", anAlphaTexture );
- myOutsidePrimitiveBox->setAlphaTexture( anAlphaTexture );
-
- anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "outside_point_sprite_alpha_threshold", anAlphaThreshold );
- myOutsidePrimitiveBox->setAlphaThreshold( anAlphaThreshold );
-
- aResolution = aResourceMgr->integerValue( "VISU", "outside_geom_sphere_resolution", aResolution );
- myOutsidePrimitiveBox->setResolution( aResolution );
-
- aSize = aResourceMgr->integerValue( "VISU", "outside_point_sprite_size", aSize );
- myOutsideSizeBox->setOutsideSize( aSize / 100.0 );
-
- aUniform = aResourceMgr->booleanValue( "VISU", "outside_point_sprite_uniform", aUniform );
- myOutsideSizeBox->setUniform( aUniform );
-
- aColor = aResourceMgr->colorValue( "VISU", "outside_point_sprite_color", aColor );
- myOutsideSizeBox->setColor( aColor );
-
- myOutsidePrimitiveBox->setFaceLimit( 50000 );
-
- ApplyOutsideGaussPoints();
-}
-
-VISU_InsideCursorSettings* VVTK_SegmentationCursorDlg::GetInsideCursorSettings()
-{
- return myInsideCursorSettings.GetPointer();
-}
-
-VISU_OutsideCursorSettings* VVTK_SegmentationCursorDlg::GetOutsideCursorSettings()
-{
- return myOutsideCursorSettings.GetPointer();
-}
-
-VISU::TTextureValue
-VVTK_SegmentationCursorDlg
-::MakeImageData( bool theInside,
- const QString& theMainTexture,
- const QString& theAlphaTexture )
-{
- if( theInside )
- {
- bool updateMainTexture = myInsideMainTexture != theMainTexture;
- bool updateAlphaTexture = myInsideAlphaTexture != theAlphaTexture;
- if( !updateMainTexture && !updateAlphaTexture )
- return 0;
-
- myInsideMainTexture = theMainTexture;
- myInsideAlphaTexture = theAlphaTexture;
- }
- else
- {
- bool updateMainTexture = myOutsideMainTexture != theMainTexture;
- bool updateAlphaTexture = myOutsideAlphaTexture != theAlphaTexture;
- if( !updateMainTexture && !updateAlphaTexture )
- return 0;
-
- myOutsideMainTexture = theMainTexture;
- myOutsideAlphaTexture = theAlphaTexture;
- }
-
- return VISU::GetTexture( (const char*)theMainTexture.toLatin1(),
- (const char*)theAlphaTexture.toLatin1());
-}
-
-void VVTK_SegmentationCursorDlg::onClickApply()
-{
- if( myTabBox->currentWidget() == mySegmentationCursorBox )
- ApplySegmentationCursor();
- else
- {
- QString aWarning = "The number of faces needed to perform the 'Geometrical Sphere' primitive\n";
- aWarning.append( "presentation might be too important to ensure an acceptable frame rate.\n\n" );
- aWarning.append( "Can you please confirm that you want to continue anyway?" );
- bool toApply = CheckNumberOfFaces() ||
- SUIT_MessageBox::warning( this, tr( "Warning" ), aWarning,
- tr( "&OK" ), tr( "&Cancel" ), 0, 1, 1 ) == 0;
-
- if( toApply )
- {
- ApplyInsideGaussPoints();
- ApplyOutsideGaussPoints();
- }
- }
-}
-
-void VVTK_SegmentationCursorDlg::ApplySegmentationCursor()
-{
- if( myIsPlaneSegmentation )
- {
- VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget();
- vtkFloatingPointType origin[3];
- origin[0] = myXOriginSpinBox->value();
- origin[1] = myYOriginSpinBox->value();
- origin[2] = myZOriginSpinBox->value();
- pPlanesWidget->SetOrigin( origin );
-
- vtkFloatingPointType normal[3];
- normal[0] = myDXDirectionSpinBox->value();
- normal[1] = myDYDirectionSpinBox->value();
- normal[2] = myDZDirectionSpinBox->value();
-
- if( normal[0] == 0.0 && normal[1] == 0.0 && normal[2] == 0.0 )
- {
- normal[2] = 1.0;
- myDZDirectionSpinBox->setValue( 1.0 );
- }
- pPlanesWidget->SetNormal( normal );
-
- pPlanesWidget->SetDistance( myDepthSpinBox->value() );
-
- myWidgetCtrl->InvokeEvent(vtkCommand::EndInteractionEvent,NULL);
- myWidgetCtrl->GetInteractor()->Render();
- }
- else
- {
- VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget();
- vtkFloatingPointType origin[3], aRadius;
- origin[0] = myXOriginSpinBox->value();
- origin[1] = myYOriginSpinBox->value();
- origin[2] = myZOriginSpinBox->value();
- pSphereWidget->SetCenter(origin);
-
- aRadius=myRadiusSpinBox->value();
- pSphereWidget->SetRadius(aRadius);
-
- pSphereWidget->SetRatio(myRatioSpinBox->value());
-
- myWidgetCtrl->InvokeEvent(vtkCommand::EndInteractionEvent,NULL);
- myWidgetCtrl->GetInteractor()->Render();
- }
-}
-
-void VVTK_SegmentationCursorDlg::ApplyInsideGaussPoints()
-{
- QString anInsideMainTexture = myInsidePrimitiveBox->getMainTexture();
- QString anInsideAlphaTexture = myInsidePrimitiveBox->getAlphaTexture();
- VISU::TTextureValue aTexture = MakeImageData( true, anInsideMainTexture, anInsideAlphaTexture );
-
- if( aTexture.GetPointer() )
- myInsideCursorSettings->SetTexture( aTexture.GetPointer() );
-
- myInsideCursorSettings->SetInitial( false );
- myInsideCursorSettings->SetPrimitiveType( myInsidePrimitiveBox->getPrimitiveType() );
- myInsideCursorSettings->SetClamp( myInsidePrimitiveBox->getClamp() );
- myInsideCursorSettings->SetAlphaThreshold( myInsidePrimitiveBox->getAlphaThreshold() );
- myInsideCursorSettings->SetResolution( myInsidePrimitiveBox->getResolution() );
-
- myInsideCursorSettings->SetMinSize( myInsideSizeBox->getMinSize() );
- myInsideCursorSettings->SetMaxSize( myInsideSizeBox->getMaxSize() );
-
- myInsideCursorSettings->SetMagnification( this->getMagnification() );
- myInsideCursorSettings->SetIncrement( this->getIncrement() );
-
- myInsideCursorSettings->InvokeEvent(VISU::UpdateInsideSettingsEvent,NULL);
-}
-
-void VVTK_SegmentationCursorDlg::ApplyOutsideGaussPoints()
-{
- QString anOutsideMainTexture = myOutsidePrimitiveBox->getMainTexture();
- QString anOutsideAlphaTexture = myOutsidePrimitiveBox->getAlphaTexture();
- VISU::TTextureValue aTexture = MakeImageData( false, anOutsideMainTexture, anOutsideAlphaTexture );
-
- if( aTexture.GetPointer() )
- myOutsideCursorSettings->SetTexture( aTexture.GetPointer() );
-
- myOutsideCursorSettings->SetInitial( false );
- myOutsideCursorSettings->SetPrimitiveType( myOutsidePrimitiveBox->getPrimitiveType() );
- myOutsideCursorSettings->SetClamp( myOutsidePrimitiveBox->getClamp() );
- myOutsideCursorSettings->SetAlphaThreshold( myOutsidePrimitiveBox->getAlphaThreshold() );
- myOutsideCursorSettings->SetResolution( myOutsidePrimitiveBox->getResolution() );
-
- myOutsideCursorSettings->SetSize( myOutsideSizeBox->getOutsideSize() );
- myOutsideCursorSettings->SetUniform( myOutsideSizeBox->getUniform() );
-
- QColor aButtonColor = myOutsideSizeBox->getColor();
- vtkFloatingPointType aColor[3];
- aColor[0] = aButtonColor.red() / 255.0;
- aColor[1] = aButtonColor.green() / 255.0;
- aColor[2] = aButtonColor.blue() / 255.0;
- myOutsideCursorSettings->SetColor( aColor );
-
- myOutsideCursorSettings->SetMagnification( this->getMagnification() );
- myOutsideCursorSettings->SetIncrement( this->getIncrement() );
-
- myOutsideCursorSettings->InvokeEvent(VISU::UpdateOutsideSettingsEvent,NULL);
-}
-
-void VVTK_SegmentationCursorDlg::onClickClose()
-{
- myPlaneAction->setChecked( false );
- mySphereAction->setChecked( false );
-
- emit scgClose();
-
- reject();
-}
-
-void VVTK_SegmentationCursorDlg::onClickHelp()
-{
- QString aHelpFileName = "segmentation.htm";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
- app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
- else {
- QString platform;
-#ifdef WIN32
- platform = "winapplication";
-#else
- platform = "application";
-#endif
- SUIT_MessageBox::warning( 0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
- QObject::tr("BUT_OK"));
- }
-}
-
-void VVTK_SegmentationCursorDlg::done( int r )
-{
- myPlaneAction->setChecked( false );
- mySphereAction->setChecked( false );
-
- emit scgClose();
-
- QDialog::done( r );
-}
-
-void VVTK_SegmentationCursorDlg::onParentShow()
-{
- if(myPlaneAction->isChecked() || mySphereAction->isChecked())
- show();
- else
- hide();
-}
-
-void VVTK_SegmentationCursorDlg::onParentHide()
-{
- hide();
-}
-
-bool VVTK_SegmentationCursorDlg::CheckNumberOfFaces()
-{
- if( !myInteractor )
- return false;
-
- vtkRenderer* aRenderer = myInteractor->getRenderer();
-
- if( !aRenderer )
- return false;
-
- int aNumberOfPoints = 0;
-
- vtkActor* anActor;
- vtkActorCollection* anActColl = aRenderer->GetActors();
- for( anActColl->InitTraversal(); ( anActor = anActColl->GetNextActor() ) != NULL; )
- {
- if( VISU_GaussPtsAct1* aGaussActor = VISU_GaussPtsAct1::SafeDownCast( anActor ) )
- aNumberOfPoints += aGaussActor->GetInput()->GetNumberOfCells();
- }
- return !( myInsidePrimitiveBox->getPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere &&
- aNumberOfPoints * myInsidePrimitiveBox->getFaceNumber() * 2 > myInsidePrimitiveBox->getFaceLimit() ||
- myOutsidePrimitiveBox->getPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere &&
- aNumberOfPoints * myOutsidePrimitiveBox->getFaceNumber() > myOutsidePrimitiveBox->getFaceLimit() );
-}
-
-void VVTK_SegmentationCursorDlg::keyPressEvent( QKeyEvent* e )
-{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
-
- if ( e->key() == Qt::Key_F1 )
- {
- e->accept();
- onClickHelp();
- }
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : VVTK_SegmentationCursorDlg.h
-// Author : Oleg Uvarov
-// Module : VISU
-//
-#ifndef VVTK_SEGMENTATIONCURSORDLG_H
-#define VVTK_SEGMENTATIONCURSORDLG_H
-
-#include "VVTK.h"
-
-#include "VISU_GaussPtsDeviceActor.h"
-
-#include <QDialog>
-
-#include <vtkObject.h>
-#include <vtkSmartPointer.h>
-
-class vtkActorCollection;
-class vtkCallbackCommand;
-class vtkImageData;
-
-class QLabel;
-class QLineEdit;
-class QPushButton;
-class QRadioButton;
-class QTabWidget;
-class QGroupBox;
-class QWidget;
-//class QVBox;
-
-class QtxAction;
-class QtxDoubleSpinBox;
-class QtxIntSpinBox;
-
-class VISU_GaussPtsAct1;
-class VISU_InsideCursorSettings;
-class VISU_OutsideCursorSettings;
-class VISU_WidgetCtrl;
-
-class VVTK_PrimitiveBox;
-class VVTK_SizeBox;
-
-class SVTK_RenderWindowInteractor;
-
-
-//! Segmentation Cursor Dialog.
-/*!
- * Uses for set up Segmentation and Outside Cursor Gauss Points preferenses
- * and apply them to all actors in the current renderer.
- */
-class VVTK_SegmentationCursorDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- VVTK_SegmentationCursorDlg( QWidget* parent = 0, const char* name = 0 );
- ~VVTK_SegmentationCursorDlg();
-
- void SetWidgetCtrl( VISU_WidgetCtrl* );
- void SetPlaneAction( QtxAction* theAction ) { myPlaneAction = theAction; }
- void SetSphereAction( QtxAction* theAction ) { mySphereAction = theAction; }
-
- bool GetIsPlaneSegmentation() const { return myIsPlaneSegmentation; }
- void SetIsPlaneSegmentation( bool on ) { myIsPlaneSegmentation = on; }
-
- //! Update contents of the Segmentation tab.
- void UpdateSegmentation();
- void UpdateInsideGaussPoints();
- void UpdateOutsideGaussPoints();
-
- //! Update contents of the Outside Cursor tab.
- void UpdateOutsideCursor();
-
- VISU_InsideCursorSettings* GetInsideCursorSettings();
- VISU_OutsideCursorSettings* GetOutsideCursorSettings();
-
- vtkSmartPointer<vtkCallbackCommand> GetEventCallbackCommand() { return myEventCallbackCommand; }
-
- void SetInteractor( SVTK_RenderWindowInteractor* theInteractor ) { myInteractor = theInteractor; }
-
-public:
- float getMagnification() const;
- void setMagnification( float );
-
- float getIncrement() const;
- void setIncrement( float );
-
-protected:
- void ApplySegmentationCursor();
- void ApplyInsideGaussPoints();
- void ApplyOutsideGaussPoints();
-
- bool CheckNumberOfFaces();
-
- VISU::TTextureValue
- MakeImageData( bool theInside,
- const QString& theMainTexture,
- const QString& theAlphaTexture );
-
-private:
- static void ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
-
- void keyPressEvent( QKeyEvent* e );
-
-protected slots:
- virtual void done( int );
- void onParentShow();
- void onParentHide();
-
- void onClickApply();
- void onClickClose();
- void onClickHelp();
-
-signals:
- void scgClose();
-
-private:
- SVTK_RenderWindowInteractor* myInteractor;
-
- QTabWidget* myTabBox;
-
- // Segmentation cursor
- QWidget* mySegmentationCursorBox;
-
- QGroupBox* myOriginGroup;
- QtxDoubleSpinBox* myXOriginSpinBox;
- QtxDoubleSpinBox* myYOriginSpinBox;
- QtxDoubleSpinBox* myZOriginSpinBox;
-
- QGroupBox* myDirectionGroup;
- QtxDoubleSpinBox* myDXDirectionSpinBox;
- QtxDoubleSpinBox* myDYDirectionSpinBox;
- QtxDoubleSpinBox* myDZDirectionSpinBox;
-
- QGroupBox* myDepthGroup;
- QtxDoubleSpinBox* myDepthSpinBox;
-
- QGroupBox* myRadiusGroup;
- QtxDoubleSpinBox* myRadiusSpinBox;
- QtxDoubleSpinBox* myRatioSpinBox;
-
- bool myIsPlaneSegmentation;
-
- float myPriority;
- vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
-
- VISU_WidgetCtrl* myWidgetCtrl;
- QtxAction* myPlaneAction;
- QtxAction* mySphereAction;
-
- // Gauss Points
- QWidget* myGaussPointsBox;
-
- VVTK_PrimitiveBox* myInsidePrimitiveBox;
- VVTK_SizeBox* myInsideSizeBox;
-
- QString myInsideMainTexture;
- QString myInsideAlphaTexture;
-
- vtkSmartPointer<VISU_InsideCursorSettings> myInsideCursorSettings;
-
- VVTK_PrimitiveBox* myOutsidePrimitiveBox;
- VVTK_SizeBox* myOutsideSizeBox;
-
- QString myOutsideMainTexture;
- QString myOutsideAlphaTexture;
-
- vtkSmartPointer<VISU_OutsideCursorSettings> myOutsideCursorSettings;
-
- QLabel* myMagnificationLabel;
- QtxIntSpinBox* myMagnificationSpinBox;
- QLabel* myIncrementLabel;
- QtxDoubleSpinBox* myIncrementSpinBox;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// VISU VISUGUI : GUI of VISU component
-// File : VVTK_SizeBox.cxx
-// Author : Oleg UVAROV
-// Module : VISU
-//
-#include "VVTK_SizeBox.h"
-
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-
-#include <QtxDoubleSpinBox.h>
-#include <QtxIntSpinBox.h>
-#include <QtxColorButton.h>
-
-#include <QLayout>
-#include <QLabel>
-#include <QLineEdit>
-#include <QCheckBox>
-#include <QGroupBox>
-#include <QButtonGroup>
-#include <QRadioButton>
-#include <QPushButton>
-#include <QColorDialog>
-
-using namespace std;
-
-VVTK_SizeBox::VVTK_SizeBox( QWidget* parent ) :
- QWidget( parent )
-{
- QVBoxLayout* aMainLayout = new QVBoxLayout( this );
- aMainLayout->setSpacing( 0 );
- aMainLayout->setMargin( 0 );
-
- // Size
- QGroupBox* SizeGroup = new QGroupBox ( tr( "SIZE_TITLE" ), this );
- //SizeGroup->setColumnLayout(0, Qt::Vertical );
- //SizeGroup->layout()->setSpacing( 0 );
- //SizeGroup->layout()->setMargin( 0 );
-
- QGridLayout* SizeGroupLayout = new QGridLayout (SizeGroup);
- SizeGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- SizeGroupLayout->setSpacing(6);
- SizeGroupLayout->setMargin(11);
-
- // Outside Size
- myOutsideSizeLabel = new QLabel( tr( "OUTSIDE_SIZE" ), SizeGroup );
- myOutsideSizeSpinBox = new QtxIntSpinBox( 0, 100, 1, SizeGroup );
- myOutsideSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- SizeGroupLayout->addWidget( myOutsideSizeLabel, 0, 0 );
- SizeGroupLayout->addWidget( myOutsideSizeSpinBox, 0, 1 );
-
- // Geometry Size
- myGeomSizeLabel = new QLabel( tr( "GEOM_SIZE" ), SizeGroup );
- myGeomSizeSpinBox = new QtxIntSpinBox( 0, 100, 1, SizeGroup );
- myGeomSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- SizeGroupLayout->addWidget( myGeomSizeLabel, 0, 0 );
- SizeGroupLayout->addWidget( myGeomSizeSpinBox, 0, 1 );
-
- // Min Size
- myMinSizeLabel = new QLabel( tr( "MIN_SIZE" ), SizeGroup );
- myMinSizeSpinBox = new QtxIntSpinBox( 0, 100, 1, SizeGroup );
- myMinSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- SizeGroupLayout->addWidget( myMinSizeLabel, 1, 0 );
- SizeGroupLayout->addWidget( myMinSizeSpinBox, 1, 1 );
-
- // Max Size
- myMaxSizeLabel = new QLabel( tr( "MAX_SIZE" ), SizeGroup );
- myMaxSizeSpinBox = new QtxIntSpinBox( 0, 100, 1, SizeGroup );
- myMaxSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- SizeGroupLayout->addWidget( myMaxSizeLabel, 1, 2 );
- SizeGroupLayout->addWidget( myMaxSizeSpinBox, 1, 3 );
-
- // Magnification
- myMagnificationLabel = new QLabel( tr( "MAGNIFICATION" ), SizeGroup );
- myMagnificationSpinBox = new QtxIntSpinBox( 1, 10000, 10, SizeGroup );
- myMagnificationSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- SizeGroupLayout->addWidget( myMagnificationLabel, 2, 0 );
- SizeGroupLayout->addWidget( myMagnificationSpinBox, 2, 1 );
-
- // Increment
- myIncrementLabel = new QLabel( tr( "INCREMENT" ), SizeGroup );
- myIncrementSpinBox = new QtxDoubleSpinBox( 0.01, 10, 0.1, SizeGroup );
- myIncrementSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- SizeGroupLayout->addWidget( myIncrementLabel, 2, 2 );
- SizeGroupLayout->addWidget( myIncrementSpinBox, 2, 3 );
-
- aMainLayout->addWidget( SizeGroup );
-
- // Color
- myColorGroup = new QGroupBox ( tr( "COLOR_TITLE" ), this );
- //myColorGroup->setColumnLayout(0, Qt::Vertical );
- //myColorGroup->layout()->setSpacing( 0 );
- //myColorGroup->layout()->setMargin( 0 );
-
- QGridLayout* ColorGroupLayout = new QGridLayout ( myColorGroup );
- ColorGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
- ColorGroupLayout->setSpacing(6);
- ColorGroupLayout->setMargin(11);
-
- myUniformCheckBox = new QCheckBox( tr( "UNIFORM_COLOR" ), myColorGroup );
-
- myColorLabel = new QLabel( tr( "COLOR" ), myColorGroup );
- myColorButton = new QtxColorButton( myColorGroup );
-
- ColorGroupLayout->addWidget( myUniformCheckBox, 0, 0 );
- ColorGroupLayout->addWidget( myColorLabel, 0, 1 );
- ColorGroupLayout->addWidget( myColorButton, 0, 2 );
-
- aMainLayout->addWidget( myColorGroup );
-
- connect( myUniformCheckBox, SIGNAL( toggled( bool ) ), myColorButton, SLOT( setEnabled( bool ) ) );
- //connect( myColorButton, SIGNAL( clicked() ), this, SLOT( onColorButtonPressed() ) );
-
- setType( VVTK_SizeBox::Results );
-}
-
-void VVTK_SizeBox::onToggleResults()
-{
- myType = VVTK_SizeBox::Results;
-
- myOutsideSizeLabel->hide();
- myOutsideSizeSpinBox->hide();
-
- myGeomSizeLabel->hide();
- myGeomSizeSpinBox->hide();
-
- myMinSizeLabel->show();
- myMinSizeSpinBox->show();
-
- myMaxSizeLabel->show();
- myMaxSizeSpinBox->show();
-
- myMagnificationLabel->show();
- myMagnificationSpinBox->show();
-
- myIncrementLabel->show();
- myIncrementSpinBox->show();
-
- myColorGroup->hide();
-
- myUniformCheckBox->hide();
-}
-
-void VVTK_SizeBox::onToggleGeometry()
-{
- myType = VVTK_SizeBox::Geometry;
-
- myOutsideSizeLabel->hide();
- myOutsideSizeSpinBox->hide();
-
- myGeomSizeLabel->show();
- myGeomSizeSpinBox->show();
-
- myMinSizeLabel->hide();
- myMinSizeSpinBox->hide();
-
- myMaxSizeLabel->hide();
- myMaxSizeSpinBox->hide();
-
- myMagnificationLabel->show();
- myMagnificationSpinBox->show();
-
- myIncrementLabel->show();
- myIncrementSpinBox->show();
-
- myColorGroup->show();
-
- myUniformCheckBox->hide();
-}
-
-void VVTK_SizeBox::onToggleInside()
-{
- myType = VVTK_SizeBox::Inside;
-
- myOutsideSizeLabel->hide();
- myOutsideSizeSpinBox->hide();
-
- myGeomSizeLabel->hide();
- myGeomSizeSpinBox->hide();
-
- myMinSizeLabel->show();
- myMinSizeSpinBox->show();
-
- myMaxSizeLabel->show();
- myMaxSizeSpinBox->show();
-
- myMagnificationLabel->hide();
- myMagnificationSpinBox->hide();
-
- myIncrementLabel->hide();
- myIncrementSpinBox->hide();
-
- myColorGroup->hide();
-
- myUniformCheckBox->hide();
-}
-
-void VVTK_SizeBox::onToggleOutside()
-{
- myType = VVTK_SizeBox::Outside;
-
- myOutsideSizeLabel->show();
- myOutsideSizeSpinBox->show();
-
- myGeomSizeLabel->hide();
- myGeomSizeSpinBox->hide();
-
- myMinSizeLabel->hide();
- myMinSizeSpinBox->hide();
-
- myMaxSizeLabel->hide();
- myMaxSizeSpinBox->hide();
-
- myMagnificationLabel->hide();
- myMagnificationSpinBox->hide();
-
- myIncrementLabel->hide();
- myIncrementSpinBox->hide();
-
- myColorGroup->show();
-
- myUniformCheckBox->show();
-}
-
-void VVTK_SizeBox::setType( int theType )
-{
- myType = theType;
-
- switch( myType )
- {
- case VVTK_SizeBox::Results : onToggleResults(); break;
- case VVTK_SizeBox::Geometry : onToggleGeometry(); break;
- case VVTK_SizeBox::Inside : onToggleInside(); break;
- case VVTK_SizeBox::Outside : onToggleOutside(); break;
- default : break;
- }
-}
-
-float VVTK_SizeBox::getOutsideSize() const
-{
- return myOutsideSizeSpinBox->value() / 100.0;
-}
-
-void VVTK_SizeBox::setOutsideSize( float theOutsideSize )
-{
- myOutsideSizeSpinBox->setValue( ( int )( theOutsideSize * 100 ) );
-}
-
-float VVTK_SizeBox::getGeomSize() const
-{
- return myGeomSizeSpinBox->value() / 100.0;
-}
-
-void VVTK_SizeBox::setGeomSize( float theGeomSize )
-{
- myGeomSizeSpinBox->setValue( ( int )( theGeomSize * 100 ) );
-}
-
-float VVTK_SizeBox::getMinSize() const
-{
- return myMinSizeSpinBox->value() / 100.0;
-}
-
-void VVTK_SizeBox::setMinSize( float theMinSize )
-{
- myMinSizeSpinBox->setValue( ( int )( theMinSize * 100 ) );
-}
-
-float VVTK_SizeBox::getMaxSize() const
-{
- return myMaxSizeSpinBox->value() / 100.0;
-}
-
-void VVTK_SizeBox::setMaxSize( float theMaxSize )
-{
- myMaxSizeSpinBox->setValue( ( int )( theMaxSize * 100 ) );
-}
-
-float VVTK_SizeBox::getMagnification() const
-{
- return myMagnificationSpinBox->value() / 100.0;
-}
-
-void VVTK_SizeBox::setMagnification( float theMagnification )
-{
- myMagnificationSpinBox->setValue( ( int )( theMagnification * 100 ) );
-}
-
-float VVTK_SizeBox::getIncrement() const
-{
- return myIncrementSpinBox->value();
-}
-
-void VVTK_SizeBox::setIncrement( float theIncrement )
-{
- myIncrementSpinBox->setValue( theIncrement );
-}
-
-bool VVTK_SizeBox::getUniform() const
-{
- return myUniformCheckBox->isChecked();
-}
-
-void VVTK_SizeBox::setUniform( bool theUniform )
-{
- myUniformCheckBox->setChecked( theUniform );
- myColorButton->setEnabled( theUniform );
-}
-
-QColor VVTK_SizeBox::getColor() const
-{
- return myColorButton->color();//palette().color( myColorButton->backgroundRole() );
- //return myColorButton->paletteBackgroundColor();
-}
-
-void VVTK_SizeBox::setColor( const QColor& theColor )
-{
- if ( theColor.isValid() )
- {
- //QPalette aPalette( myColorButton->palette() );
- //aPalette.setColor( myColorButton->backgroundRole(), theColor );
- myColorButton->setColor( theColor );
- }
- //myColorButton->setPaletteBackgroundColor( theColor );
-}
-
-void VVTK_SizeBox::enableSizeControls( bool enabled )
-{
- myMagnificationSpinBox->setEnabled( enabled );
- myMaxSizeSpinBox->setEnabled( enabled );
- myMinSizeSpinBox->setEnabled( enabled );
- myIncrementSpinBox->setEnabled( enabled );
- myGeomSizeSpinBox->setEnabled( enabled );
-}
-
-/*void VVTK_SizeBox::onColorButtonPressed()
-{
- QPalette aPalette( myColorButton->palette() );
- QColor aColor = QColorDialog::
- getColor( aPalette.color(myColorButton->backgroundRole() ), this );
-
- if( aColor.isValid() )
- {
- aPalette.setColor( myColorButton->backgroundRole(), aColor );
- myColorButton->setPalette( aPalette );
- }
-}*/
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// VISU VISUGUI : GUI of VISU component
-// File : VVTK_SizeBox.h
-// Author : Oleg UVAROV
-// Module : VISU
-//
-#ifndef VVTK_SIZEBOX_H
-#define VVTK_SIZEBOX_H
-
-#include "VVTK.h"
-
-#include <QWidget>
-
-class QLabel;
-class QLineEdit;
-class QPushButton;
-class QCheckBox;
-class QGroupBox;
-
-class QtxDoubleSpinBox;
-class QtxIntSpinBox;
-class QtxColorButton;
-
-class VVTK_EXPORT VVTK_SizeBox : public QWidget
-{
- Q_OBJECT
-
-public:
- enum { Results = 0, Geometry, Inside, Outside };
-
-public:
- VVTK_SizeBox( QWidget* );
- ~VVTK_SizeBox() {}
-
-public:
- int getType() const { return myType; }
- void setType( int );
-
- float getOutsideSize() const;
- void setOutsideSize( float );
-
- float getGeomSize() const;
- void setGeomSize( float );
-
- float getMinSize() const;
- void setMinSize( float );
-
- float getMaxSize() const;
- void setMaxSize( float );
-
- float getMagnification() const;
- void setMagnification( float );
-
- float getIncrement() const;
- void setIncrement( float );
-
- bool getUniform() const;
- void setUniform( bool );
-
- QColor getColor() const;
- void setColor( const QColor& );
-
- void enableSizeControls( bool enabled );
-
-protected slots:
- void onToggleResults();
- void onToggleGeometry();
- void onToggleInside();
- void onToggleOutside();
-
- //void onColorButtonPressed();
-
-private:
- int myType;
-
- QLabel* myOutsideSizeLabel;
- QtxIntSpinBox* myOutsideSizeSpinBox;
-
- QLabel* myGeomSizeLabel;
- QtxIntSpinBox* myGeomSizeSpinBox;
-
- QLabel* myMinSizeLabel;
- QtxIntSpinBox* myMinSizeSpinBox;
-
- QLabel* myMaxSizeLabel;
- QtxIntSpinBox* myMaxSizeSpinBox;
-
- QLabel* myMagnificationLabel;
- QtxIntSpinBox* myMagnificationSpinBox;
-
- QLabel* myIncrementLabel;
- QtxDoubleSpinBox* myIncrementSpinBox;
-
- QCheckBox* myUniformCheckBox;
-
- QGroupBox* myColorGroup;
- QLabel* myColorLabel;
- QtxColorButton* myColorButton;
-};
-
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "VVTK_ViewManager.h"
-#include "VVTK_ViewModel.h"
-
-#include <SUIT_ViewWindow.h>
-
-int VVTK_ViewManager::_VVTKViewMgr_Id = 0;
-
-//***************************************************************
-VVTK_ViewManager
-::VVTK_ViewManager( SUIT_Study* study,
- SUIT_Desktop* theDesktop )
-: SVTK_ViewManager( study, theDesktop )
-{
- myId = ++_VVTKViewMgr_Id;
- setViewModel( new VVTK_Viewer() );
-}
-
-//***************************************************************
-VVTK_ViewManager::~VVTK_ViewManager()
-{
-}
-
-//***************************************************************
-void VVTK_ViewManager::setViewName(SUIT_ViewWindow* theView)
-{
- int aPos = myViews.indexOf(theView);
- theView->setWindowTitle( tr( "VTK_VIEW_TITLE" ).arg( myId ).arg( aPos + 1 ) );
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef VVTK_VIEWMANAGER_H
-#define VVTK_VIEWMANAGER_H
-
-#include "SVTK_ViewManager.h"
-#include "VVTK.h"
-
-class SUIT_Desktop;
-
-//! Extend SUIT_ViewManager to deal with VVTK_Viewer
-class VVTK_EXPORT VVTK_ViewManager : public SVTK_ViewManager
-{
- Q_OBJECT;
-public:
- //! Construct the view manager
- VVTK_ViewManager( SUIT_Study* study, SUIT_Desktop* );
-
- //! Destroy the view manager
- virtual ~VVTK_ViewManager();
-
-protected:
- void setViewName( SUIT_ViewWindow* theView );
-
-private:
- int myId;
- static int _VVTKViewMgr_Id;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "VVTK_ViewModel.h"
-#include "VISU_ActorFactory.h"
-#include "VVTK_ViewWindow.h"
-
-#include "VTKViewer_Algorithm.h"
-#include "SVTK_Functor.h"
-#include "VISU_ActorBase.h"
-#include "SVTK_View.h"
-#include "SVTK_Prs.h"
-
-#include <SUIT_ViewManager.h>
-
-#include <vtkActorCollection.h>
-#include <vtkRenderer.h>
-
-//---------------------------------------------------------------
-VVTK_Viewer::VVTK_Viewer()
-{
-}
-
-//---------------------------------------------------------------
-VVTK_Viewer::~VVTK_Viewer()
-{
-}
-
-//---------------------------------------------------------------
-SUIT_ViewWindow* VVTK_Viewer::createView( SUIT_Desktop* theDesktop )
-{
- TViewWindow* aViewWindow = new TViewWindow (theDesktop);
- aViewWindow->Initialize(this);
-
- aViewWindow->setBackgroundColor( backgroundColor() );
- aViewWindow->SetTrihedronSize( trihedronSize() );
- aViewWindow->SetProjectionMode( projectionMode() );
- aViewWindow->SetInteractionStyle( interactionStyle() );
- aViewWindow->SetIncrementalSpeed( incrementalSpeed(), incrementalSpeedMode() );
- aViewWindow->SetSpacemouseButtons( spacemouseBtn(1), spacemouseBtn(2), spacemouseBtn(3) );
-
- return aViewWindow;
-}
-
-//---------------------------------------------------------------
-void VVTK_Viewer::Display(const SALOME_VTKPrs* thePrs)
-{
- // try do downcast object
- if(const SVTK_Prs* aPrs = dynamic_cast<const SVTK_Prs*>(thePrs)){
- if(aPrs->IsNull())
- return;
- if(vtkActorCollection* aCollection = aPrs->GetObjects()){
- aCollection->InitTraversal();
- while(VISU_ActorBase* anActor = dynamic_cast<VISU_ActorBase*>(aCollection->GetNextActor())){
- if(!anActor->GetFactory()->GetActiveState())
- continue;
- QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
- if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i))){
- if(SVTK_View* aView = aViewWindow->getView()){
- aView->Display(anActor, false);
- }
- }
- }
- }
- }
- }
-}
-
-//---------------------------------------------------------------
-namespace VVTK
-{
- struct TIsOneActorVisibleAction
- {
- bool& myResult;
- TIsOneActorVisibleAction(bool& theResult):
- myResult(theResult)
- {
- myResult = false;
- }
- void
- operator()(SALOME_Actor* theActor)
- {
- if(!myResult)
- myResult = theActor->GetVisibility();
- }
- };
-}
-
-//---------------------------------------------------------------
-bool VVTK_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& theIO )
-{
- QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
- if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i))){
- bool aResult;
- VVTK::TIsOneActorVisibleAction anAction(aResult);
- SVTK::ForEachIf<SALOME_Actor>(aViewWindow->getRenderer()->GetActors(),
- SVTK::TIsSameIObject<SALOME_Actor>(theIO),
- anAction);
- return anAction.myResult;
- }
-
- return false;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef VVTK_VIEWMODEL_H
-#define VVTK_VIEWMODEL_H
-
-#include <QColor>
-
-#include "VVTK.h"
-#include "SVTK_ViewModel.h"
-
-class VVTK_ViewWindow;
-
-//! VVTK View Model
-class VVTK_EXPORT VVTK_Viewer : public SVTK_Viewer
-{
- Q_OBJECT;
-
-public:
- typedef VVTK_ViewWindow TViewWindow;
-
- static
- QString
- Type()
- {
- return "VVTK";
- }
-
- VVTK_Viewer();
-
- virtual
- ~VVTK_Viewer();
-
- //! See #SUIT_ViewModel::createView
- virtual
- SUIT_ViewWindow*
- createView(SUIT_Desktop*);
-
- //! See SUIT_ViewModel::getType
- virtual
- QString
- getType() const
- {
- return Type();
- }
-
- //! See #SALOME_View::Display( const SALOME_Prs* )
- virtual
- void
- Display(const SALOME_VTKPrs* thePrs);
-
- //! See #SALOME_View::isVisible( const Handle(SALOME_InteractiveObject)& )
- virtual
- bool
- isVisible(const Handle(SALOME_InteractiveObject)& theIO);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SALOME VTKViewer : build VTK viewer into Salome desktop
-// File :
-// Author :
-// Module : SALOME
-// $Header$
-//
-#include "VVTK_ViewWindow.h"
-#include "VVTK_ViewModel.h"
-#include "VVTK_MainWindow.h"
-#include "SVTK_View.h"
-
-#include "SUIT_Session.h"
-
-#include "VVTK_Renderer.h"
-#include "SVTK_Selector.h"
-#include "SVTK_InteractorStyle.h"
-#include "SVTK_RenderWindowInteractor.h"
-#include "SVTK_GenericRenderWindowInteractor.h"
-
-#include <vtkRenderWindow.h>
-
-#include <QLayout>
-#include <QList>
-#include <QSplitter>
-#include <QToolBar>
-
-//----------------------------------------------------------------------------
-VVTK_ViewWindow
-::VVTK_ViewWindow(SUIT_Desktop* theDesktop):
- SVTK_ViewWindow(theDesktop),
- myMainWindow1(NULL),
- myMainWindow2(NULL),
- myView2(NULL),
- myDumpImage(QImage())
-{}
-
-//----------------------------------------------------------------------------
-void VVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
-{
- if(SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr()){
-
- QSplitter* s = new QSplitter( Qt::Vertical, this );
- setCentralWidget( s );
-
- VISU_WidgetCtrl* aWidgetCtrl = NULL;
- VISU_InsideCursorSettings* anInsideCursorSettings = NULL;
- VISU_OutsideCursorSettings* anOutsideCursorSettings = NULL;
- VISU_PickingSettings* aPickingSettings = NULL;
- SVTK_Selector* aSelector = SVTK_Selector::New();
- {
- myMainWindow1 = new VVTK_MainWindow1(s,
- "VVTK_MainWindow",
- aResourceMgr,
- this);
-
- anInsideCursorSettings = myMainWindow1->GetInsideCursorSettings();
- anOutsideCursorSettings = myMainWindow1->GetOutsideCursorSettings();
- aPickingSettings = myMainWindow1->GetPickingSettings();
-
- SVTK_RenderWindowInteractor* anIteractor =
- new SVTK_RenderWindowInteractor(myMainWindow1,"SVTK_RenderWindowInteractor1");
-
- SVTK_GenericRenderWindowInteractor* aDevice =
- SVTK_GenericRenderWindowInteractor::New();
- aDevice->SetRenderWidget(anIteractor);
- aDevice->SetSelector(aSelector);
-
- VVTK_Renderer1* aRenderer = VVTK_Renderer1::New();
- aRenderer->Initialize(aDevice,aSelector);
-
- aWidgetCtrl = aRenderer->GetWidgetCtrl();
-
- aRenderer->SetInsideCursorSettings(anInsideCursorSettings);
- aRenderer->SetOutsideCursorSettings(anOutsideCursorSettings);
- aRenderer->SetPickingSettings(aPickingSettings);
-
- anIteractor->Initialize(aDevice,aRenderer,aSelector);
-
- SVTK_InteractorStyle* aStyle = SVTK_InteractorStyle::New();
- anIteractor->PushInteractorStyle(aStyle);
- aStyle->Delete();
-
- aDevice->Delete();
- aRenderer->Delete();
-
- myMainWindow1->Initialize(anIteractor,aRenderer);
-
- myView1 = new SVTK_View(myMainWindow1);
- SVTK_ViewWindow::Initialize(myView1,theModel);
-
- anIteractor->getRenderWindow()->Render();
- myMainWindow1->onResetView();
- }
- {
- myMainWindow2 = myMainWindow1->CreateMainWindow2(s,
- "VVTK_SegmantationWindow",
- aResourceMgr,
- this);
- SVTK_RenderWindowInteractor* anIteractor =
- new SVTK_RenderWindowInteractor(myMainWindow2,"SVTK_RenderWindowInteractor1");
-
- SVTK_GenericRenderWindowInteractor* aDevice =
- SVTK_GenericRenderWindowInteractor::New();
- aDevice->SetRenderWidget(anIteractor);
- aDevice->SetSelector(aSelector);
-
- VVTK_Renderer2* aRenderer = VVTK_Renderer2::New();
- aRenderer->Initialize(aDevice,aSelector);
-
- aRenderer->SetWidgetCtrl(aWidgetCtrl);
-
- aRenderer->SetInsideCursorSettings(anInsideCursorSettings);
- aRenderer->SetPickingSettings(aPickingSettings);
-
- anIteractor->Initialize(aDevice,aRenderer,aSelector);
-
- SVTK_InteractorStyle* aStyle = SVTK_InteractorStyle::New();
- anIteractor->PushInteractorStyle(aStyle);
- aStyle->Delete();
-
- aDevice->Delete();
- aRenderer->Delete();
-
- myMainWindow2->Initialize(anIteractor);
-
- myView2 = new SVTK_View(myMainWindow2);
- SVTK_ViewWindow::Initialize(myView2,theModel);
-
- anIteractor->getRenderWindow()->Render();
- myMainWindow2->onResetView();
- }
- aSelector->Delete();
-
- int h = height() / 2;
- QList<int> aSizes;
- aSizes.append( h );
- aSizes.append( h );
- s->setSizes( aSizes );
- myMainWindow2->hide();
-
- myMainWindow = myMainWindow1;
- myView = myView1;
- }
-}
-
-//----------------------------------------------------------------------------
-VVTK_ViewWindow
-::~VVTK_ViewWindow()
-{}
-
-
-//----------------------------------------------------------------------------
-VVTK_MainWindow1*
-VVTK_ViewWindow
-::getMainWindow1()
-{
- return myMainWindow1;
-}
-
-VVTK_MainWindow2*
-VVTK_ViewWindow
-::getMainWindow2()
-{
- return myMainWindow2;
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_ViewWindow
-::AddActor(VTKViewer_Actor* theActor,
- bool theIsUpdate)
-{
- myMainWindow1->AddActor(theActor,theIsUpdate);
- myMainWindow2->AddActor(theActor,theIsUpdate);
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_ViewWindow
-::RemoveActor(VTKViewer_Actor* theActor,
- bool theIsUpdate)
-{
- myMainWindow1->RemoveActor(theActor,theIsUpdate);
- myMainWindow2->RemoveActor(theActor,theIsUpdate);
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_ViewWindow
-::Repaint(bool theUpdateTrihedron)
-{
- myMainWindow1->Repaint(theUpdateTrihedron);
- myMainWindow2->Repaint(theUpdateTrihedron);
-}
-
-//----------------------------------------------------------------
-void
-VVTK_ViewWindow
-::unHighlightAll()
-{
- myView1->unHighlightAll();
- myView2->unHighlightAll();
-}
-
-//----------------------------------------------------------------
-void
-VVTK_ViewWindow
-::highlight(const Handle(SALOME_InteractiveObject)& theIO,
- bool theIsHighlight,
- bool theIsUpdate )
-{
- if(GetSelector()->AddIObject(theIO))
- GetSelector()->EndPickCallback();
- myView1->highlight( theIO, theIsHighlight, theIsUpdate );
- myView2->highlight( theIO, theIsHighlight, theIsUpdate );
-}
-
-//----------------------------------------------------------------
-void
-VVTK_ViewWindow
-::onSelectionChanged()
-{
- myView1->onSelectionChanged();
- myView2->onSelectionChanged();
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_ViewWindow
-::onResetView()
-{
- myMainWindow1->onResetView();
- myMainWindow2->onResetView();
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_ViewWindow
-::onFitAll()
-{
- myMainWindow1->onFitAll();
- myMainWindow2->onFitAll();
-}
-
-//----------------------------------------------------------------------------
-bool
-VVTK_ViewWindow
-::action( const int accelAction )
-{
- if ( myMainWindow1->hasFocus() )
- myMainWindow1->action( accelAction );
- else if ( myMainWindow2->hasFocus() )
- myMainWindow2->action( accelAction );
- else
- return false;
- return true;
-}
-
-//----------------------------------------------------------------------------
-QImage
-VVTK_ViewWindow
-::dumpView()
-{
- if( myMainWindow1->GetInteractor()->hasFocus() )
- {
- if ( myMainWindow1->getToolBar()->testAttribute(Qt::WA_UnderMouse) || myDumpImage.isNull() )
- return myMainWindow1->dumpView();
- else
- return myDumpImage;
- }
-
- if( myMainWindow2->GetInteractor()->hasFocus() )
- {
- if ( myMainWindow1->getToolBar()->testAttribute(Qt::WA_UnderMouse) || myDumpImage.isNull() )
- return myMainWindow2->dumpView();
- else
- return myDumpImage;
- }
-
- return QImage();
-}
-
-//----------------------------------------------------------------------------
-void
-VVTK_ViewWindow
-::setBackgroundColor( const QColor& theColor )
-{
- myMainWindow1->SetBackgroundColor( theColor );
- myMainWindow2->SetBackgroundColor( theColor );
-}
-
-
-//----------------------------------------------------------------------------
-void
-VVTK_ViewWindow
-::RefreshDumpImage()
-{
- if( myMainWindow1->GetInteractor()->hasFocus() )
- myDumpImage = myMainWindow1->dumpView();
- else if ( myMainWindow2->GetInteractor()->hasFocus() )
- myDumpImage = myMainWindow2->dumpView();
-}
+++ /dev/null
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef VVTK_VIEWWINDOW_H
-#define VVTK_VIEWWINDOW_H
-
-#ifdef WIN32
-#pragma warning( disable:4251 )
-#endif
-
-#include "VVTK.h"
-#include "SVTK_ViewWindow.h"
-
-#include <QImage>
-
-#include <string>
-
-class VVTK_MainWindow1;
-class VVTK_MainWindow2;
-class SVTK_View;
-
-//----------------------------------------------------------------------------
-//! Customize the SVTK_ViewWindow in order to manage two SVTK_View (base and segmented one)
-class VVTK_EXPORT VVTK_ViewWindow : public SVTK_ViewWindow
-{
- Q_OBJECT;
-
-public:
- //! To construct the class
- VVTK_ViewWindow(SUIT_Desktop* theDesktop);
-
- //! Destroy
- virtual
- ~VVTK_ViewWindow();
-
- //! To initialize
- virtual
- void
- Initialize(SVTK_ViewModelBase* theModel);
-
- //----------------------------------------------------------------------------
- //! Get access to base SVTK_MainWindow
- VVTK_MainWindow1*
- getMainWindow1();
-
- //! Get access to segmented SVTK_MainWindow
- VVTK_MainWindow2*
- getMainWindow2();
-
- //----------------------------------------------------------------------------
- //! Redefine SVTK_ViewWindow::AddActor method
- /*!
- This is an entry point for publication the presentation into the viewer.
- Pointed actor published into the basic MainWindow. If the actor is
- a Gauss Points one second actor is created from initial actor and
- is put into segemented MainWindow.
- */
- virtual
- void
- AddActor(VTKViewer_Actor* theActor,
- bool theIsUpdate = false);
-
- //! Redefine SVTK_ViewWindow::RemoveActor method
- virtual
- void
- RemoveActor(VTKViewer_Actor* theActor,
- bool theIsUpdate = false);
-
- //! Redefine SVTK_ViewWindow::Repaint method
- virtual
- void
- Repaint(bool theUpdateTrihedron = true);
-
- //----------------------------------------------------------------------------
- /* interactive object management */
- //! Redefine SVTK_ViewWindow::highlight method
- virtual
- void
- highlight(const Handle(SALOME_InteractiveObject)& theIO,
- bool theIsHighlight = true,
- bool theIsUpdate = true);
-
- //! Redefine SVTK_ViewWindow::unHighlightAll method
- virtual
- void
- unHighlightAll();
-
- //! Redefine SVTK_ViewWindow::setBackgroundColor method
- virtual
- void
- setBackgroundColor( const QColor& );
-
- //----------------------------------------------------------------------------
-
- //! Refresh dump images of the viewers
- virtual
- void RefreshDumpImage();
-
-public slots:
- //! Redefine SVTK_ViewWindow::onSelectionChanged method
- virtual
- void
- onSelectionChanged();
-
- //! Redefine SVTK_ViewWindow::onResetView method
- virtual
- void
- onResetView();
-
- //! Redefine SVTK_ViewWindow::onFitAll method
- virtual
- void
- onFitAll();
-
- //----------------------------------------------------------------------------
-protected:
- virtual
- bool
- action( const int );
-
- virtual QImage dumpView();
-
- VVTK_MainWindow1* myMainWindow1; //!< The manage base view
- SVTK_View* myView1; //!< The manage base view
-
- VVTK_MainWindow2* myMainWindow2; //!< The manage segmented view
- SVTK_View* myView2; //!< The manage segmented view
-
-private:
- QImage myDumpImage;
-};
-
-#ifdef WIN32
-#pragma warning( default:4251 )
-#endif
-
-#endif